LLM Model Migration Checklist: How to Move an AI Workflow Without Breaking It
Moving an AI workflow to a different model or provider is more than changing an endpoint. This reusable LLM model migration checklist helps you compare APIs, preserve prompt behaviour, test structured outputs and tool calls, review safety controls, and approve a fallback plan before production traffic moves.
Overview
An LLM migration can be triggered by a model reaching end of life, a change in product requirements, a need for better latency, a new privacy constraint, or a desire to reduce operational dependency on one provider. Whatever the reason, treat the change as a compatibility project rather than a simple configuration update.
The safest approach is to separate the migration into four stages:
- Inventory: document how the current model is called and what the application expects.
- Compare: assess the candidate model against functional, operational, security, and commercial requirements.
- Validate: run representative tests using fixed inputs, controlled settings, and application-level checks.
- Release gradually: introduce the new model with observability, rollback controls, and a defined approval threshold.
Do not assume that a model with a compatible chat interface will produce compatible results. Small differences in instruction following, tokenisation, context handling, refusal behaviour, tool selection, or JSON generation can affect downstream code. Your migration plan should therefore test the complete workflow, including retrieval, business rules, validators, human review, and error handling.
For a repeatable evaluation process, use the test design guidance in LLM Evaluation Metrics and Test Cases. If your workflow depends on generated objects, pair it with the LLM Output Validation Checklist.
Checklist by scenario
1. Switching models within the same provider
This may look like the least disruptive option, but model families and versions can still differ materially. Record the existing model identifier, version or release label, SDK version, endpoint, default parameters, and any provider-specific request fields.
- Confirm that the replacement supports the required input and output modalities.
- Compare context limits and maximum output settings for your real prompts, not just their average size.
- Review supported sampling, stop-sequence, seed, reasoning, or response-format controls where applicable.
- Check whether system instructions, conversation roles, and message ordering are interpreted in the same way.
- Re-run prompts that contain long instructions, examples, quoted text, code, tables, or retrieved documents.
- Test your cost and latency measurement code against the new usage fields.
2. Switching LLM providers
Moving between providers usually adds an API translation layer. Build an explicit mapping rather than scattering provider-specific conditionals throughout the application.
- Map authentication, endpoints, regions, timeouts, retries, streaming, and cancellation behaviour.
- Translate message formats, role names, content blocks, attachments, and metadata.
- Document differences in token counts, usage reporting, rate-limit responses, and error codes.
- Confirm how the provider handles safety filters, blocked requests, empty responses, and partial streams.
- Check data handling, retention, access controls, and deployment location against your organisation's requirements.
- Make sure request and response logs do not accidentally expose prompts, personal data, credentials, or retrieved documents.
A provider-neutral internal interface should expose only the capabilities your application actually needs. It can return a normalised response object containing text, structured data, tool calls, usage metadata, finish status, and an error category. Preserve the original provider response in restricted diagnostic logs when permitted, because it can make migration failures easier to investigate.
3. Migrating a structured-output workflow
Structured output is not reliable merely because a model has been asked to return JSON. Test the entire path from prompt to parser to business logic.
- Define the expected schema, including required fields, types, allowed values, null handling, and nesting.
- Test valid, incomplete, ambiguous, oversized, and adversarial inputs.
- Check whether the new model adds Markdown fences, commentary, duplicate keys, unexpected fields, or invalid escape sequences.
- Use schema validation before any generated value reaches a database, API, workflow decision, or user-visible action.
- Specify what the application should do after a parse failure: retry, repair, route to review, or return a safe error.
For prompt examples that use tools or function calls, review Function-Calling Prompt Templates. Tool names, argument schemas, call ordering, and confirmation requirements should all be included in migration tests.
4. Migrating a RAG or document workflow
In retrieval-augmented generation, the model is only one part of the system. A change in context length or instruction-following behaviour can alter how retrieved passages are used.
- Keep the retriever, ranking settings, chunking method, and document set constant during the first comparison.
- Test questions that have a clear answer, no answer, conflicting sources, and insufficient context.
- Require citations or source references in the same format used by the application.
- Check whether the model follows instructions not to infer beyond the supplied context.
- Measure retrieval use and answer quality separately so a model change is not blamed for a retrieval problem.
The RAG Prompting Best Practices guide provides a useful companion checklist for this scenario.
5. Migrating an agent or multi-step workflow
Agentic workflows magnify small behavioural differences because one model response may determine the next tool, query, or branch. Test the workflow as a state machine rather than evaluating isolated answers.
- List every permitted tool, argument constraint, side effect, and approval gate.
- Test tool selection when several tools appear plausible.
- Verify that failed calls, malformed arguments, timeouts, and duplicate calls are handled safely.
- Set explicit limits for steps, tokens, spend, retries, and execution time.
- Check whether the model can stop when the task is complete instead of continuing unnecessarily.
What to double-check before sign-off
Prompt and context behaviour
Freeze a representative prompt set before comparing models. Include ordinary requests, edge cases, long inputs, multilingual content if relevant, code, user-supplied instructions, and known failure cases. Keep system prompts, few-shot examples, retrieved context, temperature or equivalent controls, and output limits recorded with each test run.
Do not “improve” the prompt and change the model at the same time. If both change, you may not know which change caused an improvement or regression. Store prompts as versioned assets and link each result to a prompt version. The guide to Prompt Versioning and Change Management can help formalise this process.
Compatibility and resilience
Test normal responses and operational failures. Confirm timeout behaviour, retry safety, idempotency, streaming termination, connection reuse, concurrency limits, and circuit-breaker logic. A migration is incomplete if the happy path works but a provider error causes duplicate payments, repeated notifications, or an unbounded retry loop.
Quality, safety, and policy controls
Define acceptance criteria in application terms. Examples include factual support from supplied documents, correct classification labels, valid code syntax, safe refusal of disallowed requests, absence of confidential data leakage, or correct escalation to a human. Use the same criteria for the old and new model where possible.
Review moderation, redaction, prompt-injection defence, access control, and audit logging. A provider's built-in control should not be treated as a substitute for application-level checks. Keep high-impact actions behind deterministic validation and explicit authorisation.
Latency, capacity, and cost measurement
Measure the distribution of response times rather than relying on a single average. Separate time to first token from time to completion when streaming is used. Record input and output usage using a normalised internal format, but retain the raw fields because providers may calculate or report usage differently.
Use a fixed evaluation set and a representative traffic sample. Compare quality, latency, failure rate, retry rate, and operational effort together; a cheaper or faster model may not be a better fit if it creates more validation failures or human review.
Side-by-side migration record
| Area | Current model | Candidate model | Evidence and decision |
|---|---|---|---|
| API and SDK | Endpoint, version, request shape | Endpoint, version, request shape | Compatibility test result |
| Prompt behaviour | Pass rate and known failures | Pass rate and regressions | Approved, revise, or reject |
| Structured output | Parse and schema results | Parse and schema results | Validator evidence |
| Tool use | Selection and argument accuracy | Selection and argument accuracy | Guardrail test result |
| Operations | Latency, errors, usage | Latency, errors, usage | Capacity decision |
| Safety | Known risks and controls | Known risks and controls | Security approval |
Sign-off should name the owner, test-set version, release scope, rollback trigger, fallback model or manual path, and date for post-release review.
Common mistakes
- Changing too many variables at once: keep prompts, retrieval, tools, and application logic stable during the baseline comparison.
- Testing only easy examples: include malformed input, empty results, long context, ambiguity, adversarial instructions, and provider failures.
- Comparing prose instead of outcomes: assess whether the response satisfies the application's contract, not whether it uses the same wording.
- Trusting declared context limits: test realistic combinations of system instructions, history, retrieved text, and requested output.
- Ignoring streaming differences: verify partial output handling, final usage events, cancellation, and connection errors.
- Relying on model output as validation: parse and validate every structured response before acting on it.
- Leaving fallback undefined: decide whether failure should trigger a retry, alternate model, queue, cached answer, or human review.
- Forgetting observability: log model and prompt versions, request outcome, latency, token usage, validator result, and error category without exposing sensitive content.
If the migration includes AI-generated code or documentation, keep those workflows separate from production actions and test them with their own acceptance criteria. The AI Test Case Prompt Templates and AI Code Review Prompt Templates offer relevant testing patterns.
When to revisit
Revisit this checklist before each model upgrade, provider change, major prompt revision, retrieval-pipeline change, tool-schema change, or significant traffic increase. It is also useful during seasonal planning cycles, quarterly architecture reviews, and post-incident analysis.
Set a reminder to review provider documentation and your internal compatibility notes when a model identifier, SDK, response format, usage field, limit, or lifecycle status changes. Do not copy assumptions from an earlier migration: capabilities and defaults can change between releases.
For a practical next step, create a migration folder containing the current architecture diagram, provider adapter, prompt versions, fixed evaluation set, expected schemas, load-test sample, risk register, and rollback runbook. Then run this sequence:
- Capture the current model's baseline on representative cases.
- Implement the candidate behind a feature flag or provider adapter.
- Run deterministic compatibility, quality, safety, and failure tests.
- Review the side-by-side record with engineering, security, and product owners.
- Release to a limited, observable slice of traffic.
- Compare real outcomes with the sign-off thresholds.
- Keep rollback available until the post-release review is complete.
That process turns an uncertain provider switch into a controlled AI development change. Keep the checklist with the workflow, update it when the workflow changes, and use the same evidence-based comparison whenever you evaluate another LLM.