Switch models mid-session without losing context
In OHarness, type /model <provider>/<model> and the next turn runs on the new model with the whole conversation intact. Nothing is converted, because history is stored in a vendor-neutral format and rendered into a vendor's wire format only when a request goes out.
Updated
Deze pagina is in het Engels geschreven. De termen die erin worden uitgelegd zijn de termen waarop in het Engels wordt gezocht, en een vertaalde vakterm is een andere term.
The command
/model anthropic/claude-sonnet-5
/model deepseek/deepseek-v4-flash
/model ollama/qwen3-coder:30b/model with no argument shows the current model; /models lists every model the connected providers offer, and /models refresh asks the vendors again. From the command line, -m picks the starting model and -c resumes the last session in the directory — on whatever model you name.
Why switching usually breaks something
Most agents store the conversation in their home vendor's message format. Moving it to another vendor means translating tool calls, tool results and reasoning blocks from one shape to another, mid-session — which is where context gets dropped or a session has to restart. The translation is the problem, not the models.
Why it does not here
OHarness keeps history in a format that belongs to no vendor and renders it into Anthropic Messages, OpenAI chat or Responses, or Gemini at the moment a request is sent. Switching changes which renderer runs next. There is nothing stored in the old vendor's shape, so there is nothing to migrate.
When switching pays off
- Cost: read and search with a cheap model, switch for the hard edit. The cheapest setup prices it.
- Outages and rate limits: a vendor goes down mid-task, and the session continues elsewhere.
- Second opinions: ask a different model to review what the first one wrote, with the full context.
- Privacy: move to a local model before pasting something that should not leave the machine.
Limits worth knowing
A smaller context window on the new model means compaction may summarise earlier turns sooner. Image inputs only reach models that accept images. Reasoning content from one vendor is kept in history but is not replayed to another vendor as its own reasoning.
Common questions
Can I switch AI models in the middle of a coding session?
Yes, in a model-agnostic harness. In OHarness, /model <provider>/<model> switches the next turn to a different model — Claude, GPT, Gemini, DeepSeek or a local model — with the full conversation and tool history intact.
Does switching models lose the conversation history?
Not in OHarness. History is stored vendor-neutral and rendered per request, so no conversion happens at the switch. Tools that store history in one vendor's format have to translate it, which is where context is lost.
Can I switch between Claude and GPT in the same session?
Yes. With keys for both providers (or a subscription for either), /model anthropic/claude-sonnet-5 and /model openai/gpt-5.4 switch back and forth in one session.