[{"data":1,"prerenderedAt":452},["ShallowReactive",2],{"blog-\u002Fblog\u002Fprompt-and-model-versioning":3,"blog-surround-\u002Fblog\u002Fprompt-and-model-versioning":430,"blog-related-\u002Fblog\u002Fprompt-and-model-versioning":439},{"id":4,"title":5,"audience":6,"body":10,"cluster":393,"contentRole":394,"conversionGoal":394,"date":395,"description":396,"draft":397,"extension":398,"factCheckedAt":394,"faq":399,"featured":397,"language":394,"meta":409,"navigation":410,"order":411,"originalAsset":394,"path":412,"pillar":413,"primaryKeyword":414,"relatedProject":394,"releaseScope":394,"reviewCycle":415,"reviewStatus":416,"reviewedBy":417,"searchIntent":418,"seo":419,"sources":394,"stem":420,"tags":421,"type":428,"updated":394,"__hash__":429},"blog\u002Fblog\u002Fprompt-and-model-versioning.md","Prompt & Model Versioning: Production Governance for AI Products",[7,8,9],"solo-founder","ai-product-builder","ai-engineer",{"type":11,"value":12,"toc":382},"minimark",[13,27,32,35,51,54,58,61,131,143,147,150,171,179,183,186,210,216,220,231,234,254,257,261,264,306,317,321,353,356,359],[14,15,16,20,21,26],"p",{},[17,18,19],"strong",{},"A prompt is production code, and the model behind it is a dependency you don't control. Most AI products treat both like scratch notes — and it shows."," This is a big part of ",[22,23,25],"a",{"href":24},"\u002Fblog\u002Fwhy-most-ai-built-apps-feel-like-demos","why so many AI-built apps feel like demos",": the prompt lives in a dashboard, nobody knows which version is live, the model floats on whatever alias the SDK defaults to, and \"testing\" is trying three examples by hand. That's fine for a prototype and a slow-motion disaster for a product real people rely on. Production AI needs the same governance as any other production system — adapted to the two things that make it different: prompts you author and a model you rent. Here's how I keep it from silently drifting.",[28,29,31],"h2",{"id":30},"two-things-change-your-output-and-you-own-one-of-them","Two things change your output — and you own one of them",[14,33,34],{},"Every AI feature's behavior is a product of two inputs:",[36,37,38,45],"ol",{},[39,40,41,44],"li",{},[17,42,43],{},"Your prompt"," (and its settings) — which you write and control.",[39,46,47,50],{},[17,48,49],{},"The model"," — which the provider controls and can change under you.",[14,52,53],{},"The failure mode is treating the first as casual and the second as fixed. It's the opposite: the prompt deserves the discipline of code, and the model deserves the wariness of an external dependency with its own release schedule. Get those two right and most \"why did it suddenly get worse?\" mysteries never happen.",[28,55,57],{"id":56},"what-to-version-and-why","What to version — and why",[14,59,60],{},"\"Versioning\" is vague until you list what actually needs it. For an AI feature, the versioned unit is bigger than just the prompt text:",[62,63,64,77],"table",{},[65,66,67],"thead",{},[68,69,70,74],"tr",{},[71,72,73],"th",{},"What to version",[71,75,76],{},"Why it matters",[78,79,80,91,101,111,121],"tbody",{},[68,81,82,88],{},[83,84,85],"td",{},[17,86,87],{},"Prompt text",[83,89,90],{},"The literal instructions — the core of the behavior",[68,92,93,98],{},[83,94,95],{},[17,96,97],{},"Model + version",[83,99,100],{},"A different model (or version) is a different product",[68,102,103,108],{},[83,104,105],{},[17,106,107],{},"Settings",[83,109,110],{},"Temperature, max tokens, tools — they change output too",[68,112,113,118],{},[83,114,115],{},[17,116,117],{},"Output contract",[83,119,120],{},"The shape your code depends on (JSON schema, fields)",[68,122,123,128],{},[83,124,125],{},[17,126,127],{},"Eval dataset",[83,129,130],{},"The bar you measure against — versioned with the prompt",[14,132,133,134,137,138,142],{},"The one people forget is the ",[17,135,136],{},"output contract",". If your code parses the model's response, the ",[139,140,141],"em",{},"shape"," of that response is an API between the model and your app — and a prompt or model change can break it silently, producing output that's still plausible prose but no longer parses. Pin the contract, validate against it, and fail loudly when it breaks rather than shipping a malformed result downstream.",[28,144,146],{"id":145},"prompts-are-code-treat-them-like-it","Prompts are code: treat them like it",[14,148,149],{},"Concretely, that means:",[151,152,153,159,165],"ul",{},[39,154,155,158],{},[17,156,157],{},"The prompt lives in the codebase",", in version control, not only in a provider's dashboard where changes are untracked and un-reviewable.",[39,160,161,164],{},[17,162,163],{},"Changes are deployed, not tweaked live."," A prompt edit is a change like any other — reviewed, versioned, releasable, reversible.",[39,166,167,170],{},[17,168,169],{},"You can always say which version is live",", and roll back to the previous one in one step when a change regresses.",[14,172,173,174,178],{},"This is the same principle as ",[22,175,177],{"href":176},"\u002Fblog\u002Fhow-i-turn-a-rough-idea-into-a-claude-code-ticket","turning a rough idea into a proper ticket"," rather than hacking in the dark: the discipline that feels like overhead on day one is what lets you move fast without breaking users on day one hundred.",[28,180,182],{"id":181},"the-model-is-a-dependency-you-dont-control","The model is a dependency you don't control",[14,184,185],{},"You can pin your own code; you can't fully pin someone else's model. So you manage it like any external dependency that can change:",[151,187,188,194,200],{},[39,189,190,193],{},[17,191,192],{},"Pin to specific model versions"," rather than floating aliases wherever the provider lets you — so \"the model changed\" is a decision you make, not a surprise you receive.",[39,195,196,199],{},[17,197,198],{},"Read the release notes."," Model versions get deprecated and updated; a deprecation you didn't plan for is an outage with a countdown.",[39,201,202,205,206,209],{},[17,203,204],{},"Never adopt a new model version blind."," Run it against your eval set first (next section). A newer, \"better\" model can be better on average and worse on ",[139,207,208],{},"your"," specific tasks or output format.",[211,212,213],"pull-quote",{},[14,214,215],{},"Your product can regress while your code sits untouched, because the model moved. If you're not running evals against model changes, your users are your regression test — and they report failures as churn.",[28,217,219],{"id":218},"eval-datasets-the-regression-suite-for-ai","Eval datasets: the regression suite for AI",[14,221,222,223,226,227,230],{},"The single practice that most separates a product you can change safely from one you're scared to touch is an ",[17,224,225],{},"eval dataset",": a curated set of representative inputs with known-good expected outputs (or scoring criteria) that you run any prompt or model change against, and get a ",[139,228,229],{},"score",".",[14,232,233],{},"It does for AI what a test suite does for code:",[151,235,236,242,248],{},[39,237,238,241],{},[17,239,240],{},"Objective judgment."," \"It feels better\" becomes \"it scored higher on the set.\" Vibes don't survive contact with a real change; scores do.",[39,243,244,247],{},[17,245,246],{},"Regression safety."," A change that quietly breaks a case you'd forgotten shows up immediately, before users find it.",[39,249,250,253],{},[17,251,252],{},"Safe model migration."," A new model version is judged on evidence — improved, held, or regressed — not on a hopeful skim of three outputs.",[14,255,256],{},"Build it deliberately: cover the normal cases, the edge cases, and the ones that have burned you before (every production failure becomes a new eval case). Version it alongside the prompt, because the bar and the thing being measured belong together.",[28,258,260],{"id":259},"the-production-loop","The production loop",[14,262,263],{},"Put together, governed AI features run on a loop that looks a lot like normal engineering, with two AI-shaped additions:",[36,265,266,272,278,284,290,296],{},[39,267,268,271],{},[17,269,270],{},"Change"," the prompt, settings, or model — as a versioned change.",[39,273,274,277],{},[17,275,276],{},"Eval"," against the dataset — improved, held, or regressed?",[39,279,280,283],{},[17,281,282],{},"Validate the output contract"," — does it still parse and conform?",[39,285,286,289],{},[17,287,288],{},"Deploy"," deliberately, knowing the live version.",[39,291,292,295],{},[17,293,294],{},"Log and monitor"," real outputs — so drift (yours or the model's) shows up as data.",[39,297,298,301,302,305],{},[17,299,300],{},"Roll back"," in one step if something regresses; ",[17,303,304],{},"add the failure to the eval set"," so it can't recur silently.",[14,307,308,309,312,313,230],{},"Steps 2 and 3 — evals and the output contract — are the AI-specific ones, and they're exactly the ones prototypes skip. They're also what let you keep a human in the loop on ",[139,310,311],{},"quality"," without hand-checking every output — the same spirit as ",[22,314,316],{"href":315},"\u002Fblog\u002Fhow-i-use-ai-without-letting-ai-decide","using AI without letting it decide",[28,318,320],{"id":319},"what-good-looks-like","What good looks like",[151,322,323,329,335,341,347],{},[39,324,325,328],{},[17,326,327],{},"Prompt, model version, settings and output contract are all versioned"," in the codebase, not tweaked live.",[39,330,331,334],{},[17,332,333],{},"The model is pinned and its release notes are read","; a new version is adopted only after it passes evals.",[39,336,337,340],{},[17,338,339],{},"An eval dataset scores every change",", and every production failure becomes a new eval case.",[39,342,343,346],{},[17,344,345],{},"Outputs are validated against a contract"," and monitored live, so drift is data, not tickets.",[39,348,349,352],{},[17,350,351],{},"Rollback is one step",", because you always know what's deployed.",[14,354,355],{},"None of this is heavy — it's a prompt in git, a pinned model, a folder of eval cases, and the discipline to run them before you ship. But it's the difference between an AI product that improves safely over time and one that's a haunted house where nobody dares touch the prompt because no one knows what will break. Treat prompts as code and the model as a dependency, and the \"magic\" becomes something you can actually engineer, change and trust.",[357,358],"hr",{},[14,360,361],{},[139,362,363,364,368,369,372,373,376,377,381],{},"Part of the ",[22,365,367],{"href":366},"\u002Ftopics\u002Fbuilding-ai-products","Building AI Products guide",". See also ",[22,370,371],{"href":24},"why most AI-built apps feel like demos"," and ",[22,374,375],{"href":315},"how I use AI without letting AI decide",". The ",[22,378,380],{"href":379},"\u002Fnewsletter","newsletter"," sends one finance-systems pattern, product decision or build lesson every two weeks.",{"title":383,"searchDepth":384,"depth":384,"links":385},"",2,[386,387,388,389,390,391,392],{"id":30,"depth":384,"text":31},{"id":56,"depth":384,"text":57},{"id":145,"depth":384,"text":146},{"id":181,"depth":384,"text":182},{"id":218,"depth":384,"text":219},{"id":259,"depth":384,"text":260},{"id":319,"depth":384,"text":320},"engineering",null,"2026-07-28","A prompt is production code and a model is a dependency you don't control. How I version prompts, handle model changes, run eval datasets, and keep outputs from silently regressing.",false,"md",[400,403,406],{"question":401,"answer":402},"Why do you need to version prompts?","Because a prompt is production code — it determines what your users get — and if you change it without versioning, you can't say what produced yesterday's output, can't roll back a change that made things worse, and can't tell whether a regression came from your edit or from somewhere else. Versioning a prompt means the exact text (and its settings) is tracked, tied to a version, and deployed deliberately, the same way you'd treat any code that shapes the product. The moment a prompt is doing real work for real users, 'I tweaked it in the dashboard' stops being acceptable — you need to know which version is live, what changed, and how to go back.",{"question":404,"answer":405},"What happens when the model provider updates the model?","Your product can change behavior even though you changed nothing — because the model is a dependency you don't fully control. A provider update, a version deprecation, or a silent change to a model alias can shift outputs, break an output format your code depends on, or alter quality in ways your users notice before you do. The defenses are pinning to specific model versions rather than floating aliases where you can, running an eval set against any new model version before adopting it, and monitoring live output so a shift shows up as data rather than as support tickets. Treat the model as an external dependency with its own release notes, because that's exactly what it is.",{"question":407,"answer":408},"What is an eval dataset for an AI product?","An eval dataset is a curated set of representative inputs with known-good expected outputs (or scoring criteria), that you run a prompt or model against to measure quality objectively — the AI equivalent of a regression test suite. Instead of eyeballing a few examples and hoping, you run the whole set and get a score, so a prompt change or a new model version is judged on evidence: did it improve, hold, or regress. It's what turns 'this feels better' into 'this passes,' and it's the single practice that most separates an AI product you can change safely from one you're afraid to touch.",{},true,8.7,"\u002Fblog\u002Fprompt-and-model-versioning","building-ai-products","prompt and model versioning","annual","reviewed","Tan Gravam","informational",{"title":5,"description":396},"blog\u002Fprompt-and-model-versioning",[422,423,424,425,426,427],"ai-products","prompt-engineering","versioning","evals","governance","model-changes","text","mTtZzxdk2lm7N77qFvqQdcJMJRepMTU3Q-7nzTgbPi8",[431,435],{"title":432,"path":433,"stem":434,"type":428,"language":394,"draft":397,"children":-1},"Project Intake Process for Finance and Engineering Teams","\u002Fblog\u002Fproject-intake-process-for-finance-and-engineering-teams","blog\u002Fproject-intake-process-for-finance-and-engineering-teams",{"title":436,"path":437,"stem":438,"type":428,"language":394,"draft":397,"children":-1},"RAID Logs: Managing Risks, Assumptions, Issues and Dependencies","\u002Fblog\u002Fraid-log-risks-assumptions-issues-dependencies","blog\u002Fraid-log-risks-assumptions-issues-dependencies",[440,444,448],{"path":441,"title":442,"description":443},"\u002Fblog\u002Fproduction-ai-observability","Production AI Observability: Watching What the Model Does","You can't fix what you can't see. How I think about observing AI features in production — quality, cost, latency, drift and failures — so problems show up as data, not churn.",{"path":445,"title":446,"description":447},"\u002Fblog\u002Fai-output-contracts-and-failure-handling","AI Output Contracts & Failure Handling","A model will eventually return garbage, the wrong shape, or a confident lie. How I design output contracts, validation, fallbacks and graceful degradation so the product fails safely.",{"path":449,"title":450,"description":451},"\u002Fblog\u002Fai-evaluation-and-regression-testing","AI Evaluation & Regression Testing","How I build eval datasets for AI features — the cases, the scoring, and the regression gate — so a prompt or model change is judged on evidence, not on trying three examples and hoping.",1785237640109]