CHAPTER 04 · Model-Provider Abstraction and Multi-Model Strategy · 2 / 8
What makes providers hard to abstract
Providers disagree at the wire level about nearly everything:
- Tool-schema format: each wants its own shape, and some reject edge cases (an empty parameter object) that others accept.
- Message format: content blocks vs. parts vs. input items; some require you to replay the model's prior turn verbatim, sometimes including opaque signatures that must be echoed exactly.
- Streaming events: different event vocabularies for text, reasoning, and tool calls.
- Reasoning/thinking: different switches and different ways the reasoning is surfaced.
- History chaining: some resend full history; some use a server-side "previous response id."
If any of this leaks into your agent loop, every provider-specific quirk becomes load-bearing and a fourth provider means a rewrite.