DEV Community

AskWisa
AskWisa

Posted on

How to switch AI models without changing tools

Changing an AI model and changing the tool that sends it requests are two separate decisions. If you change both at once, a broken run tells you very little: the model might have misunderstood the task, the client might have dropped a setting, or the endpoint might never have received a valid request. Keep the client fixed, record the connection settings, and test the new model against a small set of tasks you already know how to grade.

This guide works for an editor plugin, a desktop chat client, or a script you maintain. The goal isn't to find the best model in general. It's to decide whether a particular model works for a particular job, and to leave yourself a clean way back if it doesn't.

1. Save a baseline before you touch the endpoint

Save the working provider profile, or record its non-secret settings in a note: client version, protocol, base URL, model ID, output limit, streaming toggle, and enabled tools. Record the name of the environment variable or secret-store entry, not the API key. If the client supports named profiles, duplicate the working one instead of editing it in place.

Then run one ordinary task through the current setup. Save the input, the raw output, and what you did with it. For a coding workflow, that might mean recording whether a patch applied cleanly and whether the relevant tests passed. For an extraction workflow, it might mean recording which fields had to be corrected by hand. Use a fixture or sanitized sample you are allowed to send outside your machine.

You now have two useful things: a known-good profile to select if the experiment fails, and a result to compare against. If you need to change providers to reach the candidate model, verify that new connection first. Don't interpret a comparison across two providers as a pure model benchmark: defaults, context handling, and request translation can all differ. It can still tell you which setup works better in your client.

2. Match the protocol before you choose a model ID

A custom base URL tells a client where to send a request. It doesn't tell the client how to build it. Two endpoints can use the same API key style and still disagree on the request body, streaming events, or tool-call format. Check which API mode your client actually sends, not just whether its settings screen says “custom provider.”

Client API mode Typical request route Check before connecting
OpenAI Chat Completions POST /v1/chat/completions The client sends a messages array and can parse chat-completion responses.
OpenAI Responses POST /v1/responses The client supports Responses input and output items, including its event format if streaming.
Anthropic Messages POST /v1/messages The client sends the headers and content structure required by the provider.

These routes illustrate the protocols, not a universal base URL layout. Some clients ask for a base URL and append a route; others ask for the full request URL. For example, if your client already appends /v1/chat/completions, supplying a base URL that ends in /v1 may produce /v1/v1/chat/completions. Use the provider's instructions for your client and API mode. Pick the exact model ID available to your key, not a display label from a chat menu.

For a first check, turn off optional features. Send one short non-streaming request without files, tools, or structured-output options. For Chat Completions, a minimal request body looks like this; replace the placeholder before sending it:

{
  "model": "REPLACE_WITH_PROVIDER_MODEL_ID",
  "messages": [
    {"role": "user", "content": "Reply with the single word READY."}
  ],
  "stream": false
}
Enter fullscreen mode Exit fullscreen mode

For another protocol, use a minimal request in that protocol, not the same JSON pasted into a different route. Check for a successful status and readable output. An extra period after READY isn't a connection failure. A successful response with nothing rendered in the client, on the other hand, is a reason to check the response parser or API mode before rewriting prompts.

3. Use a fixture with an answer you can grade

A prompt like “write a good summary” produces an impression. A fixture with a known answer produces a result. For example, suppose your app extracts issue IDs from plain text for a triage queue. Put these rules in the prompt:

  • An ID starts with uppercase BUG- and has exactly three digits. Ignore IDs embedded in longer words or followed by another digit.
  • Return unique IDs in first-seen order. Do not change case or pad digits.
  • Return a JSON object with exactly one key, ids, whose value is an array of strings. No Markdown wrapper.

Use several inputs, including a negative case:

Input Expected ids
BUG-014 blocks BUG-002; follow-up on BUG-014. ["BUG-014", "BUG-002"]
bug-014, BUG-14, XBUG-014, BUG-0149 []
Resolved (BUG-305); see BUG-100. ["BUG-305", "BUG-100"]

Parse the raw output with the same JSON parser your app uses. Check the key set, the value types, and the exact list order. Don't silently strip Markdown fences for the candidate if production wouldn't do it. This toy task is intentionally easy to grade; you'd usually implement the extraction itself with ordinary code. For a real evaluation, substitute your actual workflow and keep one boundary case and one empty case. For code suggestions, grade against a test or expected diff behavior rather than which explanation sounds more confident.

Run the same cases for both profiles. Keep prompts, attachments, and output budgets comparable where the APIs let you. Save any differences you can't control. One pass is a smoke test; rerun cases that matter enough to block a rollout, since repeated requests can produce different results. If the provider exposes usage, record input and output tokens separately and use its published rates to estimate cost. Note retries and hand edits too: a cheaper request isn't cheaper work if it regularly needs a second attempt.

4. Test the feature your client actually depends on

A model that answers a text prompt can still fail on the feature that made your client useful. Enable that feature by itself and run a small check. For streaming, make sure partial text renders and the client recognizes completion. For structured output, check whether the client sends an actual schema or only a prompt asking for JSON. If you rely on tool calls, use a harmless read-only stub that returns a fixed value. Verify that the client receives the arguments, sends the result back, and renders the final answer. Don't hand a new profile shell or write access just to see whether tool calling works.

Use failures to decide what to inspect next, rather than treating every error as a reason to switch models again:

  • Authentication or permission error: Check which secret the client actually loaded and whether the key can access that model. Don't paste request headers into a public issue.
  • Not found: Check the constructed URL for a repeated path segment, then check the exact model ID. Use the response body to distinguish a missing route from an unavailable model where possible.
  • Bad request: Try again without optional fields. Add them back one at a time to identify the unsupported field or protocol mismatch.
  • Rate-limit or quota response: Check the provider's error details before retrying. Waiting may help a temporary limit; it won't refill an exhausted balance.
  • Works without streaming, fails with it: Keep the model and prompt fixed while you check the client's support for that protocol's stream events.

5. Decide where a shared gateway helps

A direct provider connection is a good default when you depend on provider-specific features. If your clients already speak a protocol that several candidate models support through a shared gateway, you may be able to keep the client integration and change the model ID. Verify compatibility per client and per model; a gateway doesn't make every optional feature portable.

Disclosure: I work on WISA, one option here. Its web chat offers seven starter choices, including Auto, with email signup and no card; the one-time starter credit can run out. Use chat to preview a model's responses, then test it separately in your client. For the gateway, create a key, choose the supported protocol and its base URL, and select a compatible model available to that key. Pi, Oh My Pi, and Cherry Studio can connect through custom provider settings. The console offers CC Switch import shortcuts for Claude Code (Anthropic Messages) and Codex (OpenAI Responses) when a compatible model is available to the account. Speed and availability can vary.

6. Set a switch rule and keep the rollback

Decide what must pass before making the candidate your default. For example: every fixture parses, the critical coding task passes its tests without edits, and the feature you rely on works in your client. Treat latency and token usage as measurements from the test runs, not promises. If the candidate passes the short suite, give it a limited trial on ordinary work before replacing the old profile.

Keep the previous profile selectable and write down the reason for changing. “Passed the parser fixtures and preserves streaming in this client” will help more next month than “felt better.” Try one candidate model against your saved baseline before you change any other part of the stack.

Top comments (0)