Series: Software that acts · Part 3 of 12
What lasts is ours; models plug in
In the previous part, we saw that an agent is a model plus a harness. Let us now make the model itself replaceable.
First, why depend on no provider?
Four reasons
A provider is the company that serves the model: Anthropic for Claude, OpenAI for GPT, Google for Gemini. You can also be your own provider, with an open model that runs on your server.
There are four reasons to depend on none of them.
- A provider can change its prices, its terms of use, or disappear.
- Quality varies with the task: another model can be better, or cheaper for the same result.
- An open model, on your own server, lets you keep some data on site, for example the data of children or patients.
- Having one model's work reviewed by another provider's model reduces blind spots, as we will see in the next part.
My rule fits in one sentence: what lasts is ours, and models plug in. Everything that has long-term value lives in my code repositories, in open formats, so that changing provider comes down to changing a configuration file, not the architecture.
To get there, you need one piece: the gateway.
The gateway
A gateway is a single intermediary between my programs and all the providers. My programs have one address and one key, and they all speak the same format. The gateway chooses the concrete model and speaks to each provider in its own language.
It works like a travel adapter: the device has a single plug, and the adapter takes care of the country.
Mine is open-source software, installed on my server, which also runs an open model on site, without a graphics card. Without any provider key, everything falls back on this local model, so the gateway works from the first start, for free.
- Agent (asks for a tier). The agent names no provider: it asks for the tier its role needs.
- Gateway (picks and counts). It holds the keys, picks the concrete model and records the cost of each call.
- Claude (first choice). If this model answers, the call stops here.
- OpenAI (first fallback). If the first provider does not answer, the gateway makes the call again here, without the agent seeing the difference.
- Local model (last fallback). This open model runs on my server: it is slower and not as good, but always available.
One question remains: who chooses the model?
Roles, not model names
My agents do not even ask for a model: they ask for a role, such as read, build, review or design.
In a team, you do not give the mail sorting to the chief architect: each task goes to the right level of skill, and so of cost.
Two files do the translation. The first links each role to a tier, with no provider name: fast for reading and summarising, standard for writing code, strong for reviewing, maximum for architecture choices. The second links each tier to a concrete model, with its fallbacks.
To change provider, you edit the second file, and never the first or the code of the agents.
Let us now move on to the real measurement.
The same task, five paths
This measurement was made on 14 and 15 November 2026. The task was to read a note and write a summary in three points, with the same code every time: only the model changed.
| Path | Cost | Time | Tokens |
|---|---|---|---|
| Claude Opus 5.5, direct | $0.022 | 6 s | 3,555 |
| Claude Sonnet 5.5, through the gateway | $0.010 | 5 s | 3,446 |
| gpt-5.4, through the gateway | $0.006 | 4 s | 1,457 |
| gpt-5.5, through the gateway | $0.012 | 6 s | 1,781 |
| Local model qwen2.5:3b | $0 | 16 s | 1,919 |
This measurement shows three things.
The first: the code of the loop did not change by a single line between the five paths, while the quality and the cost did. That is what I wanted to prove.
The second: Claude and OpenAI produce a summary of equivalent quality on this simple task, and at this level of difficulty the cheapest is enough.
The third: the local model is enough to test the mechanics for free, but not to get a reliable summary.
Let us add a word on the speed of the local model.
Ten times faster with a single setting
On the first try, the local model was very slow, because it started 8 threads while the server gave it only 4 processors. With the two aligned, the speed was multiplied by ten.
| Setting | Speed |
|---|---|
| 8 threads for 4 processors | 1.5 to 2.3 tokens/s |
| 4 threads for 4 processors | 23 tokens/s |
Without this measurement, I would have concluded that local models are too slow, when it was in fact a setting.
So why keep a local model, if it is not as good?
A local model for outages and sensitive data
I do not keep it for the cost, but for two reasons: it answers even when all the providers are down, and some data must not leave the server.
What to remember
- What lasts lives with you, in open formats, and the provider is the only replaceable part.
- A gateway is a single door to all the models: one address, one key, one format.
- You measure before you choose: on a simple task, Claude and OpenAI are level, and the local model only serves to test the mechanics.
In the next part, we prove it with a working day without Claude.
Architecture · Published on November 22, 2026Lire en français