Introduction
Studying find out how to migrate prompts between LLM suppliers has change into a core engineering talent, as a result of nearly each manufacturing AI group finally switches distributors or provides a second one. The market makes switching straightforward on the API stage, since OpenRouter lists greater than 400 fashions and LiteLLM covers greater than 100 behind a single interface. Simple calls disguise laborious habits, as a result of a immediate tuned for one mannequin carries assumptions about formatting, verbosity, refusals, and power use that the subsequent mannequin doesn’t share. Groups that swap solely the mannequin string usually see satisfactory demos after which uncover regressions in long-tail site visitors weeks after launch. This information walks by means of what modifications between suppliers, find out how to measure these modifications, and find out how to roll out a brand new mannequin with out shocking your customers. It combines vendor documentation, engineering postmortems, and open tooling into one eight-step workflow you possibly can run in opposition to your individual prompts. By the top you’ll know find out how to migrate prompts between LLM suppliers with proof as an alternative of hope.
Fast Solutions on Transferring Prompts Between LLM Suppliers
How do you migrate prompts between LLM suppliers?
Stock each immediate, construct an eval set from actual site visitors, adapt formatting and parameters, then evaluate each fashions on similar assessments. Roll the brand new prompts out by means of shadow site visitors and a small canary with rollback triggers.
Why do prompts behave otherwise on one other LLM?
Every mannequin household has completely different formatting preferences, system immediate dealing with, tokenizers, and refusal habits, so similar prompts produce completely different size, construction, and accuracy. Prompts encode assumptions about one mannequin that hardly ever switch unchanged between suppliers.
Can a gateway or optimizer migrate prompts for you?
Gateways standardize the API name and optimizers can rewrite prompts robotically, however neither proves high quality. You continue to want an eval set, shadow testing, and human overview earlier than transferring manufacturing prompts between LLM suppliers.
Key Takeaways
- Figuring out find out how to migrate prompts between LLM suppliers means treating a swap as a habits change, so each immediate wants adaptation and testing.
- An eval set of fifty to 200 consultant inputs, scored with the identical rubric on each fashions, is the one most dear migration asset.
- Shadow site visitors and a canary rollout with automated rollback triggers catch the regressions that offline assessments miss.
- Gateways and optimizers cut back effort however by no means change human overview of the prompts that carry actual enterprise danger.
Understanding Immediate Migration Between LLM Suppliers
Figuring out find out how to migrate prompts between LLM suppliers means adapting, testing, and step by step rolling out immediate textual content, parameters, and power definitions so a brand new mannequin matches the outdated mannequin’s high quality, format, price, and security habits as an alternative of merely swapping the endpoint.
An Interactive From AIplusInfo
How Large Is Your Immediate Migration?
Modify the variety of prompts, the dimensions of your eval set, and the rollout type to see a planning estimate constructed from revealed migration ranges.
Immediate engineering effort
16 to 40 days
2 to five days per main immediate
Estimated calendar time
5 to 11 weeks
One engineer, adaptation plus rollout
Mannequin calls per eval move
960
Prompts occasions circumstances occasions two fashions
Shadow-run additional spend
+46%
Of 1 month of inference, whereas shadowing
Darkish: immediate adaptation (higher estimate). Blue: shadow run. Gold: canary.
Your eval set sits contained in the 50 to 200 case vary that revealed playbooks recommend.
Ranges come from a mannequin migration playbook and a deprecation evaluation. Deal with the output as a planning estimate, not a quote.
Interactive by AIplusInfo
Why Groups Transfer Prompts to a New Supplier
Constructing on that definition, the primary query is why groups migrate in any respect, as a result of the motive shapes how a lot danger you possibly can settle for. Value is the most typical set off, since per-token costs and caching reductions differ sufficient to vary a month-to-month invoice by a significant fraction. High quality is the second set off, as a result of a more recent mannequin could deal with lengthy paperwork, structured extraction, or multi-step instrument use higher than the one you shipped on. Reliability and capability matter too, as charge limits, regional availability, and outages push groups towards a second vendor. Each certainly one of these motives is authentic, but every carries a special tolerance for regression, so write down the motive earlier than you contact a single immediate.
Pricing strain deserves a better look as a result of the headline numbers hardly ever inform the entire story. One migration information lists GPT-4o at $2.50 enter and $10.00 output per million tokens. Claude Sonnet 4.6 is listed at $3.00 and $15.00, but cached Sonnet enter drops to $0.30 per million tokens. A less expensive listing value can lose to a pricier mannequin as soon as caching, retries, and tokenizer variations are counted. For a deeper view of how these economics transfer over time, see our evaluation of generative AI price per token developments and budgeting. Deal with any financial savings estimate as a speculation that your individual eval and shadow runs should affirm.
Vendor change additionally arrives with out your consent, which is the third pressure behind migration. Suppliers retire fashions on revealed schedules, and one evaluation stories that Anthropic commits to no less than 60 days of discover whereas OpenAI as soon as retired 33 fashions in a single wave. Common mannequin lifespans of 12 to 18 months imply that even groups proud of their vendor will migrate prompts frequently. A group that treats migration as a one-off venture will rebuild the identical equipment yearly. A group that treats it as a routine functionality, with versioned prompts and a standing eval set, pays the price as soon as.
What Breaks When a Immediate Crosses a Supplier Boundary
Stepping again from motives, the sensible downside is that prompts fail in ways in which assessments written for the outdated mannequin hardly ever detect. Researchers have reported that small formatting modifications can transfer few-shot accuracy by as much as 76 factors, which exhibits how a lot a immediate will depend on the mannequin it was tuned in opposition to. A immediate is subsequently much less like moveable textual content and extra like a configuration file for one mannequin’s habits. When the habits change, the identical phrases produce longer solutions, completely different refusals, or subtly completely different construction. The failure is normally quiet, as a result of the output nonetheless seems to be believable to an informal reader.
Breakage falls into a number of repeatable households which are value naming earlier than you check. Format drift occurs when the brand new mannequin wraps JSON in prose, provides markdown headings, or modifications listing types that downstream parsers anticipated. Habits drift exhibits up as new caveats, over-eager refusals, or a special willingness to ask clarifying questions. Functionality drift seems when instrument calls run in parallel on one mannequin and sequentially on one other, altering each latency and correctness. Naming every household up entrance permits you to write a focused check for it as an alternative of hoping a generic benchmark catches the issue.
Value and size drift are the subsequent household and the one finance groups discover first. Tokenizers cut up the identical textual content otherwise, so one evaluation noticed tokenizer drift of as much as 112 %, that means a 500-token immediate might price over 1,000 tokens elsewhere. A mannequin that’s 30 % extra verbose multiplies output spend even when the listing value falls. Latency modifications comply with, as a result of longer solutions and completely different reasoning defaults transfer each median and tail response occasions. If you would like a sensible method to consider these hidden prices, our information on prompt-like-a-pro LLM techniques exhibits how immediate construction influences output size.
Lastly, there may be information and course of drift, which no mannequin card will warn you about. Labeled examples, traces, and eval outcomes stay in whichever instrument your group adopted first, and so they could not export cleanly to the subsequent one. Few-shot examples chosen for the outdated mannequin could mislead the brand new one, and system prompts that relied on provider-added defaults could should be written out explicitly. Reviewers additionally carry expectations about tone and format that have been calibrated on the outdated outputs. Capturing these expectations in a written rubric earlier than the migration turns arguments about style into measurable standards.
Message Codecs and API Form Variations
Past habits, the mechanical variations between supplier APIs are the very first thing each migration should deal with. OpenAI’s chat completions place the system immediate as a message with a system position, whereas Anthropic’s messages endpoint takes it as a separate top-level parameter. Anthropic additionally requires a max tokens worth on each request, helps solely consumer and assistant roles, and returns one completion per name with out an n parameter. Responses differ as nicely, since OpenAI returns a string on the first alternative whereas Anthropic returns an array of typed content material blocks. These particulars are nicely documented, and a migration information from Rene Zander lays out the total mapping area by area.
Stepping by means of the response and utilization fields exhibits why an adapter layer pays for itself. Token utilization seems as immediate and completion tokens on one API and as enter and output tokens on the opposite. Streaming additionally differs, since one API sends delta tokens whereas the opposite emits typed occasions reminiscent of message begin, content material block delta, and message cease. Error courses and charge restrict semantics differ too, with Anthropic exposing separate enter token, output token, and request limits. Wrapping all of this behind a small supplier interface retains utility code steady whereas every supplier class handles its personal formatting. Our comparability of ChatGPT and Claude key variations offers the product-level context behind these API selections.
An adapter layer ought to translate shapes, but it surely ought to by no means disguise habits that it is advisable check. Functionality negotiation, reminiscent of whether or not a mannequin helps a given structured output mode, belongs in configuration that fails loudly at startup. Immediate textual content ought to keep exterior the adapter and stay in versioned recordsdata per mannequin. Mixing the 2 produces an abstraction that makes each mannequin barely worse, a failure mode that has been described in practitioner writing on gateway design. Maintain the adapter skinny, maintain the prompts specific, and maintain the assessments near each.
Formatting Conventions: Markdown, XML, and Delimiters
Turning to immediate textual content itself, the most typical adaptation is the best way you separate directions from information. OpenAI fashions have a tendency to reply nicely to markdown headers, emphasis, and lists, whereas Anthropic fashions have a tendency to reply nicely to XML tags that wrap every enter part. Neither choice is a rule, but altering delimiters is reasonable and infrequently yields a measurable enchancment in instruction following. A typical conversion wraps paperwork, examples, and directions in descriptively named tags and refers to these tags by identify within the job description. The reverse conversion strips the tags and makes use of headers and fenced blocks, which is why a group immediate library ought to retailer the construction individually from the wording.
Take a look at delimiter modifications in isolation, as a result of formatting alone can swing accuracy greater than any wording edit. Change solely the delimiters on a replica of the immediate, run the eval set, and file the distinction earlier than touching directions. Tone phrases matter as nicely, since one practitioner information suggests softening laborious prohibitions for Claude and restoring directness for GPT-4o. Deal with these strategies as hypotheses, as a result of actual prompts want cautious rewriting fairly than string alternative. Doc what labored for every mannequin household so the subsequent migration begins from proof.
Sampling Parameters and Hidden System Habits
Shifting from textual content to settings, sampling parameters and invisible defaults clarify many shocking variations. Closed suppliers add system directions that customers by no means see, so a immediate could silently depend upon politeness, security framing, or formatting guidelines equipped by the seller. Groq’s migration documentation advises writing an intensive system message that makes these hidden guidelines specific, overlaying persona, tone, hedging, disclaimers, and coverage limits. It additionally recommends matching the supply mannequin’s temperature first, usually 1.0, then adjusting after measurement. Many Llama deployments reportedly carry out higher between 0.2 and 0.4, which exhibits how a lot the correct worth will depend on the mannequin.
Reasoning habits is the opposite invisible default that’s value checking earlier than any check run. Some fashions suppose earlier than answering and expose settings reminiscent of reasoning effort or a considering finances that counts in opposition to the output restrict. Fashions with out that habits want the reasoning spelled out within the immediate by means of step-by-step directions, a verification move, or sampled votes. Once you transfer to or from a reasoning mannequin, protect the outdated reasoning setting for the primary check move and alter one variable at a time. Our explainer on how reasoning fashions suppose covers why easier directions usually work higher for them. File each parameter within the immediate’s model metadata so outcomes keep reproducible.
Seeds and determinism deserve a ultimate be aware as a result of groups usually depend on them in assessments. Some suppliers don’t expose a seed parameter or log possibilities, which removes instruments you could have used to stabilize comparisons. With out them you want bigger eval units and repeated runs to separate actual regressions from sampling noise. Plan for no less than three runs on borderline prompts and evaluate rating distributions fairly than single numbers. This additional rigor prices little and prevents false alarms throughout canary evaluation.
Transferring on to machine-readable output, structured codecs are the place migrations fail most expensively. OpenAI provides a strict JSON schema mode with constrained decoding, whereas Anthropic traditionally really useful forcing a instrument option to acquire schema-shaped output. One evaluation notes that Anthropic’s structured outputs reached common availability in early 2026 however depend on instruction following, so conformance ought to be measured fairly than assumed. Constrained decoding ensures syntax, but it surely doesn’t assure that area values are appropriate. Both method, your parser ought to validate each response and your eval set ought to rating schema conformance as its personal metric.
Device definitions differ in form in addition to within the semantics that fashions connect to them. OpenAI nests a perform object with a parameters schema, whereas Anthropic makes use of a flat definition with an enter schema area. Device arguments arrive as a JSON string on one API and as a parsed object on the opposite. Device outcomes return as a instrument position message on one and as a typed block inside a consumer message on the opposite. These are mechanical modifications, but every one is a spot the place a silent bug can disguise. Our guides on perform calling in LLMs and on find out how to design instrument schemas that fashions use appropriately clarify the underlying patterns.
Habits differs even when schemas match, which is why instrument use wants its personal assessments. Some fashions name instruments in parallel whereas others name them separately, which modifications latency and the order of unwanted effects. Fashions additionally differ in how usually they name a instrument unnecessarily, how they get better from an error end result, and whether or not they ask for lacking arguments. Measure tool-call accuracy, name depend, and restoration habits individually from reply high quality, as a result of a mannequin can enhance one whereas regressing the opposite. Embrace circumstances with lacking arguments, ambiguous requests, and failing instruments in your eval set.
For brand spanking new programs, customary protocols cut back the mixing half of the issue. The Mannequin Context Protocol turns an N by M connector downside right into a shared customary for instrument entry. The protocol is finest understood as a transport for instruments fairly than a information to prompting. A shared protocol nonetheless doesn’t make prompts moveable, as a result of the mannequin’s determination about when and find out how to name a instrument stays a habits. Maintain instrument descriptions concise and concrete, and check every one individually for each mannequin you assist. Deal with descriptions as a part of the immediate, as a result of the mannequin reads them that method.
Tokenizers, Context Home windows, and Value Math
Wanting on the numbers, tokenizers and context habits quietly change each price and high quality throughout a migration. Anthropic’s tokenizer is reported to separate the identical textual content into extra tokens than OpenAI’s, so per-token costs can’t be in contrast with out measuring actual prompts. Our primer on tokenization in LLMs explains byte pair encoding and why the identical sentence prices completely different quantities on completely different fashions. Context home windows differ as nicely, with a 2024 comparability placing flagship fashions close to 128,000 tokens, Sonnet 3.5 at 200,000, and Gemini fashions at 1 million or extra. Marketed context limits are ceilings, and a mannequin can degrade nicely earlier than it reaches them. One comparability discovered GPT-4 strongest as much as about 32,000 tokens whereas an older Sonnet degraded past 8,000 to 16,000, although these figures describe older fashions and have to be re-measured at this time.
The sensible rule is to make use of the decrease of the marketed restrict and the restrict you measure by yourself paperwork. Construct a long-context check that locations a reality in the beginning, center, and finish of inputs close to your actual most size. Run it on each fashions and file the place retrieval accuracy falls. Set alerts beneath that threshold so manufacturing site visitors by no means drifts into the degraded zone unnoticed. Recompute price from noticed token counts on a pattern of actual requests fairly than from listing costs alone.
How you can Construct an Eval Set Earlier than You Contact a Immediate
Constructing on the price image, the eval set is the asset that turns a migration from opinion into proof. A sensible migration information recommends evaluating outputs facet by facet on no less than 20 check circumstances. A regression harness information suggests a golden dataset of about 50 to 200 consultant inputs. MLflow’s immediate rewriting documentation recommends no less than 20 to 50 numerous examples, together with edge circumstances and blended inputs. Pattern from actual manufacturing site visitors, stratify by use case, language, and enter size, and embody the ugly circumstances that assist tickets point out. Have somebody exterior the immediate authoring group overview the set, as a result of authors unconsciously check what they already know works.
Scoring wants the identical care as sampling, and it ought to be outlined earlier than you see any outcomes. Write per-case standards that mix deterministic checks, reminiscent of schema validity and required fields, with semantic checks {that a} human or a decide mannequin applies. Outline thresholds for accuracy, format compliance, latency, price, security, and power burn up entrance, so no one argues about acceptable regressions after the very fact. Determine the move bar earlier than the primary comparability run, as a result of a threshold chosen after seeing the numbers is a rationalization. Our information on evaluating outputs with an LLM as decide covers decide biases and calibration.
Lastly, maintain the eval set alive after the migration ends. Add each manufacturing failure, escalated ticket, and shocking output as a brand new case, so the set grows along with your site visitors. Model it alongside prompts and file which immediate model handed on which mannequin model. One evaluation discovered a mannequin scoring 94 % on evals however 78 % on long-tail manufacturing site visitors, a niche that solely steady additions can shut. Deal with that hole because the true measure of how consultant your set is. A set that by no means grows will finally certify prompts that actual customers have already outgrown.
From there, automation can shorten the variation step, offered you deal with its output as a draft. OpenAI’s immediate optimizer cookbook describes pasting a baseline immediate right into a playground, working the optimizer, reviewing the defined modifications, and saving the end result as a versioned immediate object. MLflow provides an experimental optimize prompts API that makes use of the GEPA optimizer to rewrite prompts so a brand new mannequin reproduces the unique mannequin’s outputs. Groq paperwork llama-prompt-ops, which rewrites prompts written for GPT or Claude into Llama-friendly phrasing and provides a regression mode in opposition to a baseline. Every of those instruments wants instance inputs, and every works finest when your eval set already exists.
These optimizers have actual limits that you need to plan round. Matching the outdated mannequin’s outputs preserves its quirks and errors, so a immediate optimized for equivalence can’t be higher than the unique. Optimization additionally consumes additional mannequin requires reflection and scoring, which provides price and requires entry to a number of endpoints. Run optimizer output by means of the identical eval gate as a hand-edited immediate, and browse the diff like a code overview. Our walkthrough of evaluating Bedrock brokers with RAGAS exhibits one strategy to rating such rewrites robotically, and the MLflow rewrite prompts information paperwork the workflow.
How you can Run Shadow Site visitors, Canaries, and Rollback Plans
Stepping again from offline testing, manufacturing site visitors is the one check that features actual customers, so migrations want a staged rollout. In shadow mode you duplicate stay requests to the candidate mannequin, log its solutions with out displaying them to customers, and evaluate offline. One playbook estimates that one to 2 weeks of shadowing roughly doubles inference spend, which is a value value budgeting fairly than avoiding. Watch structured output conformance, refusal charges, verbosity, and tail latency, as a result of a 2 % drop in conformance can imply a whole bunch of failed requests every day at scale. Shadow runs additionally reveal enter shapes that your eval set by no means contained.
After shadowing comes a canary, which exposes a small slice of actual site visitors to the brand new mannequin. Begin with inside customers, then 1 to five % of a low-risk phase, and ramp over days to 25, 50, and at last 100%. Resist the urge to maneuver rapidly, as a result of ramping over hours hides slow-moving issues reminiscent of assist ticket spikes. One evaluation argues {that a} two-week canary can nonetheless miss results that solely seem over longer soak home windows. Maintain every canary stage lengthy sufficient for uncommon inputs, weekend site visitors patterns, and downstream enterprise metrics to indicate up.
Rollback standards ought to be written down earlier than the canary begins. Examples from revealed playbooks embody structured output conformance beneath 97 %, or p99 latency above 800 milliseconds for quarter-hour. Pair every set off with an computerized motion, reminiscent of a function flag that routes requests again to the outdated mannequin and not using a deployment. Maintain the outdated mannequin’s configuration heat and the outdated prompts in model management till the brand new mannequin has been steady by means of no less than one enterprise cycle. A rollback you could have by no means rehearsed is a rollback you can not belief.
Instrumentation makes all of this doable, and it ought to exist earlier than the migration begins. Dashboard refusal charge by immediate class, token utilization per request, schema validation failures, and downstream accuracy for the brand new and outdated fashions facet by facet. Our guides on benchmarking LLM latency and throughput and on tracing give the measurement foundations. Proceed monitoring for no less than 30 days after the cutover, as a result of behavioral drift usually surfaces slowly. Maintain the shadow harness out there so the subsequent mannequin improve begins from working infrastructure.
Gateways and Abstraction Layers: What They Resolve and What They Disguise
Regardless of the attraction of a single endpoint, gateways clear up solely a part of the migration downside. Braintrust’s gateway, OpenRouter, and LiteLLM allow you to name many suppliers by means of one interface. The Braintrust evaluation notes {that a} shared API confirms requests succeed however not that output high quality holds. Routing, retries, authentication, price monitoring, and failover are precisely the considerations an abstraction ought to personal. They’re additionally the considerations that change least between fashions, which is why centralizing them is protected. A gateway permits you to swap the mannequin identifier in a single place and run the identical eval suite in opposition to each fashions.
The actual dangers come from the provider-specific particulars that gateways flatten away. Supplier-specific providers reminiscent of file APIs, vector shops, fine-tuning, batch processing, immediate caching, multimodal codecs, and proprietary instrument options should not lined by a generic interface. A lowest-common-denominator abstraction may depart capabilities unused, as a result of the interface can not categorical one of the best function of every mannequin. Summary the plumbing, not the immediate technique, and maintain functionality variations seen in configuration. Our evaluation of vendor lock-in for agentic AI platforms exhibits how dependencies accumulate above the mannequin layer.
Fallbacks deserve a particular warning as a result of they appear like free insurance coverage. A gateway can retry the identical mannequin by means of one other supplier after an outage, which is protected as a result of the mannequin is unchanged. Falling again to a special mannequin is a habits change, so the alternative have to be mapped upfront and should have handed the identical evals. In any other case your failover path silently serves lower-quality solutions through the incident when you possibly can least afford it. Take a look at the fallback mannequin on the identical eval set and overview its prompts like another migration goal.
The place Immediate Migrations Fall Brief: Dangers and Failure Modes
Given the numerous transferring elements, it helps to catalog how migrations truly fail so you possibly can check for every mode. The most typical failure is fake confidence, the place a group swaps the mannequin, runs a fast smoke check, and ships. One illustrative situation within the deprecation literature describes a triage assistant that started providing unsolicited diagnostic opinions three weeks after a rushed swap. Token utilization rose fivefold and JSON parsing failed in the identical situation. Different failures embody refusal spikes, verbosity progress, damaged few-shot patterns, and parser errors when output construction shifts. Most migration failures are detected by customers and finance groups fairly than by assessments, which implies your check design is the management that issues.
Hidden prices are the second class, and so they shock executives greater than engineers. One evaluation stories migration prices starting from $30,000 to $250,000 or extra, pushed by duplicate inference, human overview, immediate adaptation, and information export. Timelines additionally slip, since groups sometimes estimate one to 2 weeks whereas most migrations take 4 to eight. Funds two to 5 days of immediate engineering per main immediate and begin with the highest-traffic ones. When schedules are compelled by a retirement date, start early sufficient that you could nonetheless roll again. Our information to AI agent failure modes provides a debugging vocabulary for the incidents that slip by means of.
Ethics, Governance, and Vendor Dependence
Rounding out the technical image, migrations increase governance questions that engineering checklists are likely to skip. A immediate carries coverage, as a result of it encodes how the system treats customers, what it refuses, and what disclaimers it provides. When the mannequin modifications, that coverage can change with none code overview, so migrations ought to move by means of the identical approval path as different coverage modifications. Security guardrails positioned in system prompts want adversarial testing on each new mannequin, since some fashions weight the system immediate extra closely than consumer directions. Doc who authorised the behavioral modifications and why, so the choice will be audited later.
Moral duties lengthen to the individuals affected by the outputs. If a mannequin feeds hiring, lending, healthcare, or training selections, a quiet shift in refusal charges or tone can change outcomes for particular teams. Examine outputs throughout demographic and language segments, not simply in mixture, earlier than and after the transfer. A migration that improves the common rating whereas degrading one group’s outcomes is a regression, not a win. Maintain human overview within the loop for delicate classes till the brand new mannequin has a observe file. Share the outcomes with the governance physique that owns AI danger, utilizing the identical format each time.
Vendor dependence is the structural challenge behind all of this. A handful of suppliers provide most manufacturing fashions, and a coverage change, value change, or retirement at certainly one of them can pressure migration on each buyer without delay. Holding prompts, evals, and traces in moveable codecs beneath your management is the primary protection. Our explainer on AI observability and tracing for LLM functions describes find out how to maintain that proof in open codecs. Contracts additionally matter, so ask suppliers about deprecation discover intervals, information retention, and export rights earlier than relying on them. Dependence can’t be eradicated, however it may be priced and deliberate.
The Way forward for Immediate Portability
Wanting forward, the price of transferring prompts will shrink however won’t attain zero. Automated optimizers, shared analysis tooling, and customary protocols for instruments are already eradicating the mechanical work, and extra of will probably be automated annually. Many suppliers now expose OpenAI-compatible endpoints, which narrows the mechanical variations between APIs. Fashions are additionally getting higher at following directions that have been written for a special mannequin. The remaining portability tax is behavioral, and habits can solely be verified by measurement. Our work on context engineering for LLM brokers suggests the self-discipline is shifting from wording prompts to managing every little thing a mannequin sees.
Groups ought to subsequently spend money on capabilities fairly than one-off conversions. A standing eval set, versioned prompts, a compatibility matrix of which immediate model handed on which mannequin, and a rehearsed rollout path make each future migration cheaper. Steady drift monitoring turns provider-side mannequin updates, which may change habits with out discover, into routine occasions. The organizations that migrate nicely can be people who deal with prompts as versioned, examined software program artifacts with house owners. In that world, realizing find out how to migrate prompts between LLM suppliers turns into a routine upkeep talent fairly than a disaster response.
Chart From AIplusInfo
The place the weeks go in an eight-week immediate migration
Weeks allotted to every stage of the plan, one engineer, ten to twenty manufacturing prompts.
Supply: stage durations comply with the mannequin migration playbook and the deprecation evaluation. Every day price assumes 1M enter and 200K output tokens at revealed listing costs, with the GPT-4o and Sonnet figures taken from René Zander, and varies by contract.
Chart by AIplusInfo
Placing It Into Follow: How you can Migrate Prompts Between LLM Suppliers in Eight Steps
With that groundwork in place, the next eight steps flip the ideas above right into a repeatable workflow. The sequence for find out how to migrate prompts between LLM suppliers follows the order utilized by revealed playbooks, which begin with a list and finish with monitoring and documentation. Every step produces an artifact that you could retailer in model management, so the migration leaves behind property as an alternative of tribal information. Don’t skip the early steps to achieve the rollout sooner, as a result of each later determination will depend on the stock, standards, and eval set. Funds a number of days per main immediate, and count on the entire effort to take weeks fairly than days for a multi-prompt system. The code samples are intentionally small so you possibly can adapt them to your individual stack.
Step 1 – Stock each immediate and mannequin name
Begin by itemizing each place your codebase calls a mannequin, as a result of migrations fail most frequently on prompts no one remembered. Seek for consumer calls, mannequin identify strings, and recordsdata that retailer immediate templates, then file the mannequin, parameters, proprietor, and site visitors quantity for every. OpenAI’s improve steering for its newer fashions recommends this similar stock and asks you to pair every mannequin utilization with its closest immediate, flagging any hyperlink you’re uncertain about. Classify every utilization as a mannequin string change solely, a lightweight immediate rewrite, or blocked by API variations. The classification tells you the place the work is concentrated and which prompts deserve eval consideration first. Kind the stock by site visitors and income influence, and migrate the highest-risk prompts final, after the primary 2 or 3 low-risk prompts have confirmed the method.
grep -rnE "chat.completions.create|messages.create|generateContent" src/
| type > model_call_inventory.txt
wc -l model_call_inventory.txt
Step 2 – Write acceptance standards earlier than testing
Determine what beauty like earlier than you see any numbers from the brand new mannequin. Outline thresholds for accuracy, schema conformance, refusal charge, latency, price per job, security, and tool-call accuracy, and retailer them in a file that reviewers can learn. Playbooks recommend instance rollback triggers reminiscent of structured output conformance beneath 97 % or p99 latency above 800 milliseconds for quarter-hour. Set the move bar per immediate, since a customer-facing summarizer and an inside classifier deserve completely different tolerances. Writing the factors first protects the group from the widespread temptation to decrease the bar after a disappointing end result.
{
"prompt_id": "support-summary-v3",
"min_accuracy": 0.92,
"min_schema_conformance": 0.97,
"max_refusal_rate": 0.03,
"max_p99_latency_ms": 800,
"max_cost_per_task_usd": 0.01
}
Step 3 – Construct the eval set from actual site visitors
Pattern actual requests, strip or masks private information, and label the anticipated habits for every case. Goal for no less than 50 circumstances per necessary immediate, stratified by use case, language, and enter size, and add edge circumstances from assist tickets. Pair deterministic checks with a rubric, and use a decide mannequin solely the place human labels could be too sluggish, then calibrate the decide in opposition to a small human-labeled slice. The MLflow steering suggests 20 to 50 numerous examples as a flooring for optimizer workflows. Retailer the set in a plain file format so it survives instrument modifications.
import json
import random
def sample_cases(path, n=100, seed=7):
rows = [json.loads(line) for line in open(path)]
random.Random(seed).shuffle(rows)
return rows[:n]
Step 4 – Adapt message format and immediate construction
Translate the API form first, then adapt the immediate textual content. Transfer the system immediate to the top-level area when concentrating on Anthropic, set the required most output tokens, and convert instrument definitions and outcomes into the goal format. Then restructure the immediate textual content itself for the brand new mannequin household. For instance, wrap paperwork and directions in named XML tags when transferring to Claude, or convert them to headers when transferring the opposite method. Change one factor at a time and rerun the eval after every of the 4 or 5 edits, as a result of it’s the solely strategy to know which edit helped. Maintain the brand new immediate in a separate versioned file for every supplier.
def to_anthropic(messages, max_tokens=2000):
system = [m["content"] for m in messages if m["role"] == "system"]
chat = [m for m in messages if m["role"] != "system"]
return {
"system": "nn".be a part of(system),
"messages": chat,
"max_tokens": max_tokens,
}
Step 5 – Match parameters and make hidden guidelines specific
Copy the supply mannequin’s sampling settings first, then tune them with measurements fairly than instinct. Groq’s steering advises matching temperature to the supply mannequin, leaving prime p at 1.0 initially, and noting that many Llama deployments carry out higher between 0.2 and 0.4. Write out any habits the outdated supplier equipped invisibly, reminiscent of persona, tone, refusal templates, and disclaimers, inside an specific system message. In case you are transferring to or from a reasoning mannequin, maintain the reasoning effort or considering finances the identical for the primary run. File each setting in a configuration file subsequent to the immediate so a future migration can reproduce the end result.
prompt_id: support-summary-v3
supplier: anthropic
mannequin: example-model-name
temperature: 0.3
top_p: 1.0
max_tokens: 2000
system_prompt_file: prompts/support-summary-v3.claude.xml.txt
Step 6 – Run each fashions on the eval set and evaluate
Execute the identical eval set in opposition to the outdated and new fashions utilizing similar scoring code, and maintain each uncooked output for overview. The Braintrust migration steps suggest reviewing every scorer individually, since a candidate could achieve accuracy whereas shedding format compliance or tool-call reliability. Run borderline prompts a number of occasions to separate regressions from sampling noise. Learn no less than 50 to 100 paired outputs by hand for customer-facing prompts, as a result of averages disguise the odd failures that customers keep in mind. Iterate on the immediate till the brand new mannequin meets each threshold, or determine that this workload ought to keep the place it’s.
def run_eval(call_model, circumstances, rating):
outcomes = []
for case in circumstances:
output = call_model(case["input"])
outcomes.append({"id": case["id"], "output": output, "rating": rating(case, output)})
return outcomes
Step 7 – Shadow, canary, and roll out with rollback triggers
Ship duplicated manufacturing requests to the brand new mannequin with out displaying its solutions, then evaluate offline for one to 2 weeks. Transfer on to a canary of 1 to five % of a low-risk phase, and ramp to 25, 50, and 100% over days fairly than hours. Tie every stage to the rollback triggers from step 2, and automate the swap again by means of a function flag so no one has to deploy code throughout an incident. Maintain the outdated mannequin heat and the outdated prompts in model management till the brand new mannequin has survived a full enterprise cycle. A LiteLLM type gateway could make the site visitors cut up a configuration change fairly than a code change.
rollout:
phases: [1, 5, 25, 50, 100]
hold_hours_per_stage: 48
rollback_if:
schema_conformance_below: 0.97
p99_latency_ms_above: 800
refusal_rate_above: 0.05
Step 8 – Monitor, doc, and model the end result
After cutover, observe refusal charge, token use per request, schema failures, and downstream accuracy for no less than 30 days. File which immediate model handed on which mannequin model in a compatibility matrix, and retailer the eval outcomes subsequent to it. Add each new manufacturing failure to the eval set so the subsequent migration begins from a stronger baseline. Schedule a periodic re-evaluation, as a result of suppliers replace fashions and your site visitors modifications. Share a brief migration report with the house owners of the affected options so the behavioral modifications are understood and authorised.
{
"prompt_id": "support-summary-v3",
"validated": [
{"provider": "provider-a", "model_version": "2026-05", "eval_pass_rate": 0.94},
{"provider": "provider-b", "model_version": "2026-09", "eval_pass_rate": 0.93}
]
}
Really useful by AIplusInfo
Books to go deeper on mannequin migration
Two practitioner books that cowl analysis, prompting, and mannequin habits for groups planning a supplier swap.
As an Amazon Affiliate, AIplusInfo earns from qualifying purchases.
E book
AI Engineering: Constructing Purposes with Basis Fashions
Covers analysis, immediate engineering, and deployment of basis mannequin functions, the precise abilities behind a protected mannequin swap.
Key Insights on Transferring Prompts Between LLM Suppliers
- Analysis cited in a portability evaluation discovered that small formatting modifications can shift few-shot accuracy by as much as 76 factors, so prompts hardly ever switch unchanged.
- Groups usually estimate one to 2 weeks for a mannequin swap, but a migration playbook stories that almost all take 4 to eight weeks as soon as adaptation, shadowing, and rollout are included.
- Reported migration prices vary from $30,000 to $250,000 or extra, pushed by duplicate inference, human overview, immediate adaptation, and information export, so the work deserves an actual finances.
- Tokenizer drift of as much as 112 % has been noticed in deprecation analysis, that means a 500-token immediate on one mannequin can price greater than 1,000 tokens on one other.
- A immediate migration information recommends side-by-side comparability on no less than 20 check circumstances and human overview of fifty to 100 actual dialog samples earlier than cutover.
- For a every day workload of 1 million enter and 200,000 output tokens, one pricing comparability lists $4.50 for GPT-4o and $6.00 for Claude Sonnet 4.6, or $3.30 cached.
- MLflow recommends no less than 20 to 50 numerous examples when its experimental immediate optimizer rewrites prompts for a brand new mannequin, as a result of optimization can solely be taught from the circumstances it sees.
- Notion runs regression evals with 70 engineers and stories deploying appropriate new fashions in beneath 24 hours, which exhibits what a mature eval pipeline buys.
Taken collectively, these figures describe a migration downside that’s largely about proof fairly than syntax. Formatting sensitivity and tokenizer drift clarify why similar prompts diverge, whereas the hole between two-week estimates and eight-week actuality explains why initiatives slip. Prices of tens of 1000’s of {dollars} comply with from the duplicate inference, overview hours, and adaptation work that cautious groups can not keep away from. Eval units of 20 to 200 circumstances are the most cost effective strategy to convert these unknowns into selections. Organizations that construct the proof pipeline as soon as, as Notion’s instance suggests, can undertake new fashions in hours as an alternative of weeks.
Supplier Variations at a Look
On prime of the sooner dialogue, the desk beneath condenses the mechanical and behavioral variations that matter most when prompts cross a supplier boundary. It compares the OpenAI chat type, the Anthropic messages type, and open fashions served by means of hosted endpoints, utilizing the steering cited all through this text. Deal with each cell as a beginning speculation, as a result of distributors change defaults and a mannequin launched subsequent quarter could behave otherwise. Use the desk to determine which assessments to jot down, to not skip testing. Value per job deserves its personal measurement, and our piece on agent price per job exhibits find out how to compute it from traces as an alternative of listing costs. Confirm every row in opposition to the present documentation earlier than counting on it.
| Dimension | OpenAI chat type | Anthropic messages type | Open fashions on hosted endpoints |
|---|---|---|---|
| System immediate placement | A system position message contained in the messages array | A separate top-level system parameter | Often a system message; write hidden vendor guidelines out explicitly |
| Most output tokens | Non-obligatory with a model-specific default | Required on each request | Set explicitly to manage size and price |
| Most popular immediate construction | Markdown headers, lists, and delimiters | XML tags round every enter part | Brief numbered guidelines and specific reasoning steps |
| Device definition | A perform object with a parameters schema | A reputation with an enter schema area | Verify the mannequin helps instrument use earlier than migrating |
| Device arguments and outcomes | JSON string arguments and a instrument position end result | Parsed object arguments and a end result block in a consumer message | Varies by mannequin and host, so check every sample |
| Structured output | Strict JSON schema mode with constrained decoding | Pressured instrument alternative or instruction-following structured outputs | Decrease temperature, usually 0.2 to 0.4, plus validation |
| A number of completions | An n parameter for a number of candidates | One completion per name | Is dependent upon the host |
| Reasoning controls | A reasoning effort setting on reasoning fashions | A considering finances that counts in opposition to max tokens | Spell out reasoning steps within the immediate |
| Utilization fields | Immediate tokens and completion tokens | Enter tokens and output tokens | Varies by host, so normalize within the adapter |
Examples of Immediate Migration in Follow
OpenAI’s Immediate Optimizer on a High-Okay Process
Constructing on the concept of automated rewriting, OpenAI’s cookbook ran its immediate optimizer on a coding immediate. The immediate requested for a Python script that finds the top-Okay most frequent tokens in a textual content stream. The authors pasted a baseline immediate with contradictory directions into the optimizer, accepted its refinements, and saved the end result as a versioned immediate object. Throughout 30 runs per immediate on 5 million tokens, common runtime fell from 7.906 to six.977 seconds and peak reminiscence dropped from about 3,626 KB to 578 KB. Exactness and sorting stayed at 100% for each variations, so the beneficial properties confirmed up in pace, reminiscence, and judged high quality fairly than correctness. The OpenAI optimizer cookbook itself lists limits, together with a single check machine, judge-based high quality scores, and baselines that already had little headroom. That candor is a helpful reminder that optimizer beneficial properties rely closely on how weak the beginning immediate was.
MLflow’s Immediate Rewriting for a Cheaper Mannequin
MLflow’s documentation walks by means of transferring a sentiment classification immediate from GPT-5 to the cheaper GPT-4o-mini utilizing its experimental immediate optimization API. The group registered the immediate, captured the unique mannequin’s outputs on 10 pattern inputs as coaching information, and ran the GEPA optimizer with an equivalence scorer. The workflow wants no human-labeled floor fact, which removes the slowest a part of most migrations. The said intention is a value discount from the smaller mannequin, however the web page stories no measured financial savings. It recommends 20 to 50 numerous examples for actual use, so the 10-input demo is simply a toy, and the function continues to be marked experimental. Particulars seem in MLflow’s rewrite prompts information, which additionally notes that optimization provides calls to reflection and scoring fashions.
Notion’s Eval-Pushed Mannequin Adoption
Notion makes use of Braintrust with a group of 70 engineers to run regression and frontier evals at any time when a brand new mannequin ships. The group constructed its analysis pipeline in order that appropriate fashions will be deployed in beneath 24 hours, which turns migration right into a routine occasion. That pace comes from a standing eval suite, shared scorers, and a gateway that lets the group change the mannequin identifier in a single place. The Braintrust evaluation of supplier lock-in is a vendor publication, so its framing favors its personal platform and ought to be learn with that bias in thoughts. The identical web page additionally warns that gateways don’t cowl provider-specific providers reminiscent of batch processing, caching, or fine-tuning. These items nonetheless want separate migration work even when the prompts are prepared.
Classes From Actual Migration Case Research
Case Examine: DeHaze Labs Strikes a Model Intelligence Pipeline
Regardless of delivery rapidly on GPT-4.1, DeHaze Labs confronted recurring issues in a pipeline that extracts model mentions from video and podcast transcripts. Lengthy transcripts prompted chunk boundary errors, ambiguous mentions inflated the handbook overview queue, and unreliable structured output required retry logic and handbook intervention. The group ran a production-style comparability that held the pipeline fixed and diversified solely the mannequin, then swapped the consumer in its abstraction layer and adopted Claude. They adjusted immediate formatting for system messages and structured output, up to date tokenization assumptions, and relaxed the chunking technique to cut back cross-chunk reconciliation. After cutover they stored GPT-4.1 in shadow mode on a subset of manufacturing site visitors and reported no regressions that they had not already seen in analysis. The DeHaze Labs write-up publishes no % enchancment, price, or latency figures, so the outcomes are qualitative.
The constraints are value finding out as intently as the end result. The authors admit the unique GPT-4.1 alternative was made beneath timeline strain and was not rigorously evaluated. Lengthy-transcript boundary results have been by no means absolutely solved, and tightening chunking in a single place created errors elsewhere. Ambiguous validation circumstances nonetheless depend upon human overview, and the submit doesn’t identify the opposite fashions it thought-about. The lesson is that even a profitable migration hardly ever removes an issue completely, which makes standing evaluations and periodic re-checks the true deliverable. The group says it re-evaluates its mannequin alternative periodically for precisely that motive.
Case Examine: An Illustrative Triage Assistant Swap
A situation described within the mannequin deprecation literature exhibits how a rushed migration goes fallacious. A healthcare triage group that confronted a retirement deadline obtained 90 days of discover, swapped the mannequin string, and shipped after a fast handbook smoke check. Three weeks later the brand new mannequin was giving unsolicited diagnostic opinions, token utilization had risen fivefold, immediate templates have been breaking, and JSON parsing was failing. The answer the evaluation proposes is a structured course of constructed on mannequin name abstraction and a immediate compatibility matrix. It provides a golden dataset of fifty to 200 inputs and an eight-week plan with shadow mode and a canary. That plan baselines in weeks one and two, remediates in weeks three and 4, and shadows in weeks 5 and 6. A canary of 1 to five % follows earlier than full rollout. The deprecation evaluation labels the triage story illustrative, so deal with it as a cautionary sample fairly than a documented firm incident.
The really useful plan carries its personal prices and limits that groups ought to weigh fastidiously. An eight-week schedule that begins 60 days earlier than retirement leaves little slack if a supplier shortens its discover. Working two fashions in shadow mode roughly doubles inference spend for the length, and golden datasets want an impartial reviewer to keep away from authors testing solely what they count on to work. The situation additionally exhibits how a safety-relevant habits change, unsolicited diagnoses, can disguise behind a passing smoke check. Groups in regulated domains ought to add behavior-specific checks for refusals, disclaimers, and scope earlier than any site visitors strikes.
Case Examine: Google’s Value-Per-Process Routing Throughout Gemini Fashions
Confronted with coding-agent payments that stored rising whilst per-token costs fell, a Google Builders Weblog experiment argued that price per profitable job is the higher metric. The authors constructed a router that sends each job to a light-weight mannequin first and escalates duties flagged as complicated to a stronger mannequin on low considering. In a 50-question auto-graded benchmark, the router solved all 50 duties, and its classifier scored 48 of fifty on classification. A regex and size heuristic fell from 93.8 % on improvement inquiries to 70.6 % on unseen ones. The smaller mannequin alone missed 6 of 25 laborious duties, and capping output tokens broke 7 of 25 laborious duties, so naive price cuts carried actual high quality danger. The Google Builders Weblog submit additionally notes that resending cached context can price 75 to 90 % much less, however a cache is tied to 1 mannequin.
The article states its personal limitations plainly, which makes it a very good mannequin for find out how to learn migration proof. Every setup ran as soon as on 50 prompts with hand-assigned issue labels and easy computerized grading, so the figures will differ with immediate size, caching, and manufacturing load. Outcomes come from one classifier, and self-hosted classifiers are billed by GPU hour fairly than per token. Routing can battle with caching, so lengthy context-heavy turns could also be higher stored on a single mannequin. For migration planners the takeaway is that selecting between fashions can also be a routing determination, and each routing rule wants its personal eval set earlier than it reaches manufacturing.
Regularly Requested Questions About Migrating Prompts Between LLM Suppliers
Step one is a list of each place your system calls a mannequin, together with the immediate, parameters, proprietor, and site visitors for every. Figuring out find out how to migrate prompts between LLM suppliers begins with realizing precisely what you could have at this time. With out that listing, forgotten prompts floor as manufacturing incidents after the swap. Classify every utilization as a mannequin string change, a lightweight rewrite, or blocked by API variations.
You may usually run the identical immediate textual content on one other supplier, however the outcomes will normally differ in size, construction, and refusals. Small formatting modifications alone have been reported to shift few-shot accuracy by as much as 76 factors. Deal with the unique immediate as a primary draft for the brand new mannequin and adapt formatting, system directions, and examples. Then confirm the tailored model in opposition to an eval set earlier than transferring any site visitors.
Revealed steering ranges from no less than 20 side-by-side circumstances for a small system to a golden dataset of fifty to 200 consultant inputs. Optimizer instruments reminiscent of MLflow suggest 20 to 50 numerous examples at the least. Extra necessary than the depend is protection of actual site visitors, edge circumstances, and failure modes from assist tickets. Have somebody exterior the immediate authoring group overview the set.
Measure schema conformance, refusal charge, verbosity, tool-call accuracy, latency on the median and tail, and price per accomplished job. Every of those metrics can regress even whereas common accuracy improves total. Outline thresholds for each metric earlier than working the comparability so outcomes can’t be rationalized afterward. For customer-facing prompts, add human overview of fifty to 100 paired outputs.
A single agent with a stable benchmark suite could take two to 3 days, whereas multi-agent programs usually take one to 2 weeks by one information’s estimate. One other playbook stories that almost all migrations take 4 to eight weeks as soon as shadowing and canary rollout are included. Funds two to 5 days of immediate engineering per main immediate. Schedules lengthen when embeddings have to be reindexed or when no eval set exists.
Gateways standardize the API name, so you possibly can change the mannequin identifier and maintain your consumer code. They don’t affirm that output high quality, format compliance, or instrument habits holds on the brand new mannequin. Supplier-specific options reminiscent of caching, batch processing, and fine-tuning additionally fall exterior a generic interface. Use a gateway for routing and failover, and maintain immediate testing in your individual eval suite.
Optimizers can shorten the variation step, particularly when you have already got instance inputs and outputs. OpenAI’s optimizer, MLflow’s experimental GEPA-based API, and llama-prompt-ops are documented examples. Their output ought to be reviewed like a code change and run by means of the identical eval gate as a hand-edited immediate. Do not forget that optimizing for equivalence preserves the outdated mannequin’s errors together with its strengths.
Translate the schema codecs first, then measure conformance and power habits as their very own metrics. OpenAI provides a strict JSON schema mode, whereas Anthropic makes use of compelled instrument alternative or instruction-following structured outputs. Validate each response in code and fail loudly when the schema is violated. Take a look at lacking arguments, ambiguous requests, and failing instruments, as a result of fashions differ in how they get better.
Tokenizers cut up the identical textual content into completely different numbers of tokens, and researchers have noticed drift of as much as 112 %. Output verbosity additionally differs by mannequin, so longer solutions enhance output spend even when listing costs fall. Caching reductions and retry charges change the efficient price additional. Compute price per accomplished job from actual traces fairly than evaluating listing costs.
Write rollback triggers earlier than the canary begins, reminiscent of schema conformance beneath 97 % or tail latency above a set threshold. Route site visitors by means of a function flag so you possibly can return to the outdated mannequin and not using a deployment. Maintain the outdated mannequin’s configuration heat and its prompts in model management. Rehearse the rollback no less than as soon as earlier than the canary reaches a big share of site visitors.
Begin by matching the supply mannequin’s temperature, then alter primarily based on measurements fairly than instinct. Groq’s migration steering notes that many Llama deployments carry out higher between 0.2 and 0.4. Decrease values swimsuit factual solutions and strict codecs reminiscent of JSON. File the ultimate setting with the immediate model in order that outcomes keep reproducible.
Retailer prompts as versioned recordsdata per mannequin, with metadata for parameters and the eval outcomes that validated them. Maintain a compatibility matrix of which immediate model handed on which mannequin model. Put routing, retries, and price monitoring behind a skinny abstraction, however depart immediate technique exterior it. Keep a dwelling eval set so each future migration begins from proof.








