Replacing an LLM is an application migration, not a one-line model-name change. This guide provides a reusable checklist for comparing providers, adapting prompts and tools, testing behavior, rolling out safely, and maintaining a rollback path when a model is deprecated or no longer fits your workload.
Overview
An LLM model migration happens when an application moves from one model to another, whether the change is within the same provider or involves switching LLM providers. The trigger may be a deprecation notice, a change in requirements, a need for lower latency, a new context limit, or a decision to consolidate infrastructure. Whatever the reason, the replacement model can behave differently even when it accepts similar API requests.
The safest approach is to treat migration as a controlled software release. First, inventory the current integration. Next, define compatibility requirements and measurable acceptance criteria. Then run the same representative inputs against the existing and replacement models, review differences, and release the new model gradually.
Keep these three artifacts throughout the project:
- Migration inventory: the models, endpoints, prompts, parameters, tools, schemas, and workflows affected.
- Evaluation set: representative inputs with expected properties or human-reviewed reference outcomes.
- Rollback plan: the configuration change, deployment procedure, and owner responsible for returning to the previous model.
A model migration is complete only when the application still satisfies its product, safety, operational, and cost requirements. A response that looks acceptable in a few manual tests is not enough for an AI application with retrieval, tool calling, structured output, or automated workflows.
Checklist by scenario
Scenario 1: Replacing a model with another model from the same provider
Same-provider migrations may require fewer infrastructure changes, but they still need application-level testing. Complete the following checklist:
- Record the current model identifier, API endpoint, SDK version, request parameters, and response fields.
- Confirm that the replacement supports the features your application uses, including streaming, vision, tool calling, structured outputs, or batch processing where applicable.
- Compare context limits and output limits. Recheck the combined size of system instructions, conversation history, retrieved documents, tool definitions, and requested output.
- Run existing prompts without changing them first. This establishes whether behavior changes are caused by the model rather than prompt edits.
- Test temperature, sampling, token, timeout, and reasoning-related parameters individually. Do not assume that every parameter has the same name, range, or effect.
- Review refusals, uncertainty statements, formatting, and instruction-following on both routine and adversarial examples.
- Update the model identifier behind a configuration flag rather than hard-coding it across the application.
Scenario 2: Switching LLM providers
Changing providers adds a translation layer. The conceptual workflow may remain the same, while the request format, authentication, error handling, and observability change.
- Map message roles and content parts from the old request format to the new one.
- Document authentication, regional routing, timeout behavior, rate limits, retry guidance, and error categories using the provider documentation available to your team.
- Build an adapter that exposes a stable internal interface, such as
generateResponse(input, options), while keeping provider-specific logic at the boundary. - Translate tool definitions, function arguments, structured output requirements, and stop conditions. Validate every generated argument before execution.
- Normalize response metadata used by logs and dashboards, including request identifiers, finish reasons, usage fields, and latency measurements when available.
- Test content filtering, refusal behavior, and sensitive-data handling without assuming equivalent safety behavior between providers.
- Confirm that your data-retention, access-control, and deployment requirements are compatible with the selected integration.
Scenario 3: Migrating a RAG application
In a retrieval-augmented generation system, the model is only one part of the answer pipeline. Begin with the same retrieved passages and citations for both models so that generation quality can be compared fairly.
- Freeze a sample of queries, retrieved chunks, metadata, and expected citation locations.
- Check whether the new context limit changes chunk size, document ordering, or the number of passages you can include.
- Test whether the model follows grounding instructions, distinguishes evidence from conversation, and admits when the retrieved material is insufficient.
- Measure citation completeness and answer faithfulness through a repeatable review process rather than judging only fluency.
- Revisit prompt templates if the new model handles delimiters, quoted text, or conflicting passages differently.
For implementation context, compare this process with the step-by-step RAG tutorial and the guide to building a reliable retrieval-augmented generation app.
Scenario 4: Migrating an agent or tool-calling workflow
Agent migrations deserve stricter controls because a model response may trigger an external action. Test not only the final text but also the decision to call a tool, the selected tool, the arguments, and the order of operations.
- Capture representative tool calls and compare names, required fields, types, enums, and optional arguments.
- Reject malformed, incomplete, or unauthorized arguments before a tool executes.
- Test duplicate calls, missing calls, unexpected tool calls, and attempts to bypass approval steps.
- Preserve idempotency and audit logging for actions that create, modify, send, or delete data.
- Use human approval for consequential actions until the replacement model has passed the relevant regression tests.
The production guide to LLM tool calling, schemas, validation, retries, and human approval provides a useful companion checklist. If the application connects assistants to external tools or data sources, also review the MCP integration guide.
What to double-check
Compatibility and API behavior
Create a provider compatibility table before implementation. Include the old model, replacement model, supported endpoint, context and output limits, streaming behavior, structured output support, tool-calling behavior, authentication method, error format, and parameters that require translation. Mark each item as confirmed, needs testing, or not applicable. This prevents assumptions from being hidden in application code.
Prompts and instruction hierarchy
Preserve the current system prompt and user prompt as a baseline. Then test the replacement with long instructions, conflicting instructions, empty inputs, multilingual inputs, quoted untrusted content, and requests that should be declined. Look for changes in tone, verbosity, formatting, instruction priority, and adherence to output constraints.
Keep prompt changes separate from the model change where possible. If both change at once, a regression becomes harder to diagnose. For guidance on making system instructions more reliable, see how to write system prompts for reliable AI assistants.
Structured outputs and parsing
If downstream code expects JSON, treat the output contract as an interface. Test required fields, null handling, arrays, nested objects, enumerated values, escaping, and unexpected commentary. Use schema validation in the application and record validation failures as a migration metric. Do not rely on a prompt alone to guarantee machine-readable output.
Quality, safety, and operations
Use a representative evaluation set rather than a collection of convenient examples. Include successful cases, edge cases, known failures, safety-sensitive requests, long inputs, tool calls, and retrieval questions. Compare task success, factuality, formatting, refusal quality, citation behavior, latency, error rate, and resource usage. The LLM evaluation guide can help turn these checks into a repeatable test set.
Review logs for accidental prompt or user-data exposure. Redact sensitive values, restrict access, and retain only what the team needs for debugging and evaluation. Include prompt-injection tests when the application processes documents, web content, emails, or tool results; the prompt-injection defense checklist covers this area.
Common mistakes
- Changing the model in production first: Use a shadow, offline, staging, or percentage rollout before making it the default.
- Testing only fluent answers: A polished response may still contain an invalid schema, unsupported claim, missing citation, or unsafe tool call.
- Assuming parameter equivalence: Similar parameter names do not guarantee similar semantics. Verify each one and remove unsupported settings.
- Ignoring context growth: Conversation history, retrieval results, and tool definitions can consume the available context before the user message is processed.
- Combining unrelated changes: Avoid changing prompts, retrieval, parsers, business rules, and model selection in one release unless you can isolate their effects.
- Keeping no rollback path: A feature flag, versioned configuration, and tested previous deployment are more useful than an informal promise to switch back.
- Trusting provider labels as quality guarantees: Evaluate the model against your own workload. A model that performs well in one task may be a poor fit for another.
When to revisit
Revisit this checklist before every planned model replacement, provider change, or major application workflow change. It should also be reviewed when a provider announces a model lifecycle change, when an API or SDK version changes, when context or structured-output requirements change, or when monitoring shows a shift in latency, parsing failures, refusals, tool calls, or answer quality.
For a practical migration record, copy this rollback template into the release ticket:
- Previous configuration: model identifier, provider, SDK version, prompt version, and relevant parameters.
- Replacement configuration: the same fields for the candidate model.
- Acceptance evidence: evaluation-set results, manual review notes, tool and schema tests, and operational observations.
- Release controls: feature flag, traffic percentage, monitoring dashboard, alert thresholds, and review owner.
- Rollback action: the exact configuration or deployment change required to restore the previous model.
- Decision date: when the team will review rollout results and either expand, pause, or reverse the migration.
Start with a small representative test set today, record the current behavior, and keep the old model available until the replacement has passed quality, safety, compatibility, and operational checks. This makes an LLM migration a controlled engineering decision rather than an emergency response to a model change.