AI in production
What keeps an LLM in production working for years?
The prompt is the part of an LLM feature that changes most. Build the rest of the system to change least.
Short answer
An LLM in production survives for years when the product treats the model as a replaceable dependency. That means stable internal interfaces around every model call, strict validation of what goes in and comes out, tests and evaluations that run on every change, and a planned path for model upgrades. Prompt wording matters far less over time than these structures, because models, APIs and pricing will all change while your feature has to keep working.
On this page
01What changes under a long-lived LLM feature
A feature built on a language model sits on top of things your team does not control. Over a few years, almost all of them move:
- Models are retired. Providers deprecate older models on a schedule and name a replacement. OpenAI's deprecations page, for example, gives each retired model a shutdown date and a recommended successor, with notice periods that can be as short as a couple of weeks for preview models.
- Behavior shifts between versions. A newer model can be better on average and still change the format, length or tone of answers your code depends on.
- APIs evolve. Parameters, response shapes and tool calling formats change.
- Prices and limits change. A feature that was cheap can become expensive, or the reverse, which changes which model is the right choice.
- Your own product changes. New fields, new tenants and new workflows all touch what the model sees.
A feature survives this when each of those changes is contained to one place in the code and caught by a test before users notice.
02The structures that keep a feature alive

| Layer | What to keep stable | What is allowed to change |
|---|---|---|
| Product interface | The function or endpoint the rest of the product calls | Nothing visible to callers |
| Input schema | Typed, validated request models | Fields added with defaults |
| Prompt and model | Versioned prompts and a model setting per feature | Prompt text, model choice, provider |
| Output schema | Typed, validated response models | Internal parsing details |
| Tests and evals | A fixed test set with known good answers | New cases added over time |
| Observability | One trace per call with model and prompt version | Backend and dashboards |
The key idea is that the rest of the product should never talk to the model directly. It calls an internal function with a typed input and receives a typed output. What happens inside, including which model answers, can change without any caller noticing.
Validation is what makes that promise real. Libraries such as Pydantic define models with typed fields, and when input cannot be made to fit, they raise one error that lists every problem rather than letting bad data through. Applied to both the request and the model's response, that gives you a hard boundary: a model upgrade that changes the shape of its output fails loudly in a test instead of quietly corrupting records.
03How we keep an LLM in production stable through model changes

- 01
Wrap every model call behind an internal interface.
One place in the code knows about the provider, the model name and the prompt. Everything else calls that interface.
- 02
Validate inputs and outputs with typed schemas.
Reject or repair malformed output. Never pass raw model text into your database.
- 03
Version prompts like code.
Prompts live in the repository, are reviewed in pull requests and carry a version that is logged on every call.
- 04
Keep a fixed evaluation set.
Real examples with known good outputs, run on every change and before every model switch.
- 05
Test in tiers.
Fast unit tests on every push. Routing and behavior evals on demand. Slower quality evals, often scored by another model, before releases.
- 06
Track deprecations as part of planning.
Each model in use has an owner and a known shutdown date. Migration is scheduled work, not an emergency.
- 07
Switch models behind a setting, with a fallback.
A per-feature or per-customer model setting, with a default to fall back to, lets you move gradually and roll back quickly.
- 08
Trace every call.
Model, prompt version, tokens, latency and outcome, so a quality change can be tied to its cause.
04What we see in production
From March 2024 to October 2026, one of our engineers worked inside a U.S. company's own team on the backend of its LLM application, built on FastAPI, Pydantic, Postgres and GPT-4. The client owned the product. That stack is a fair picture of how many long-lived LLM features are built: a typed API framework, a validation library at the boundaries, a relational database as the system of record, and a hosted model behind it. An engagement of that length spans several generations of models and API changes, which is exactly why the interfaces and validation around the model matter more than any single prompt.
On a contract extraction pipeline for a healthcare data consultancy, built inside the client's own restricted AWS account, the same principles are visible in more detail. Extraction code built on a few contracts with a similar layout failed on the next one, so we replaced layout rules with one retrieval pipeline that has a definition for every field. A reranking step that looked smarter sometimes lost context in long contracts, so we rolled it back to the simpler pipeline, which read them correctly.
What kept the product working through those changes was not prompt wording. It was field definitions that hold across contract layouts, a rule that a term the contract does not state comes back empty and is never invented, and small, versioned releases the client can review. The client approved the second version after its first review, and the pipeline went live in its own account.
On an AI website builder our team engineers, a prompt runs through a pipeline of AI skills, a validation engine checks the generated code and an auto-fix step repairs it. Generating code from a prompt is easy to demo; a site that builds every time is the product, so the checks sit after the model, not inside the prompt.
05Mistakes that shorten the life of an LLM feature
- Calling the provider from everywhere. When model calls are scattered across the codebase, every upgrade becomes a search and replace across the product.
- Trusting free text output. If your code parses model output with loose string matching, the next model version will break it.
- No fixed test set. Without known good examples, nobody can say whether a new model is better or just different.
- Ignoring deprecation notices. A shutdown date found late turns a planned migration into an outage.
- Tuning prompts to one model's quirks. Heavy prompt tricks tied to one model rarely survive the next one. Clear instructions and validated outputs travel better.
For the cost side of running LLM features over time, see how to reduce AI infrastructure cost in production. And if you are weighing which cloud AI platform to standardize on, our comparison of Bedrock, Azure AI and Vertex AI for existing SaaS covers the trade-offs.
06A yearly check for every LLM feature
Once a year, or whenever a provider announces a deprecation, we run the same review:
- Which model and prompt version does each feature use, and when is that model scheduled for shutdown?
- Does the evaluation set still reflect how customers use the feature?
- Do the input and output schemas still match the product's data?
- What would it take to switch this feature to another model or provider tomorrow?
- Are cost per call and latency still acceptable?
If the answer to the switching question is more than a settings change and an eval run, the feature has drifted toward a single model, and the next upgrade will hurt.
Frequently asked questions
How often do LLM providers retire models?
On a schedule, and sometimes at short notice. OpenAI's deprecations page gives each retired model a shutdown date and a recommended successor. Notice periods can be as short as a couple of weeks for preview models. Give each model in use an owner and a known shutdown date, so migration is scheduled work, not an emergency.
How do we switch models without breaking the feature?
Wrap every model call behind an internal interface with typed, validated inputs and outputs, so callers never talk to the model directly. Switch models behind a per-feature or per-customer setting with a default fallback. Run the fixed evaluation set before every switch. That lets you move gradually and roll back quickly.
Does prompt wording matter for a long-lived LLM feature?
Less than most teams expect. Over time, prompt wording matters far less than stable interfaces, validation, tests and a planned upgrade path. Heavy prompt tricks tied to one model rarely survive the next one. Clear instructions and validated outputs travel better. Version prompts like code, review them in pull requests and log the version on every call.
What should a yearly LLM feature review cover?
Check which model and prompt version each feature uses, and when that model is scheduled for shutdown. Confirm the evaluation set still reflects how customers use the feature and the schemas still match the product's data. Ask what a switch to another model would take. If it is more than a settings change and an eval run, the feature has drifted.
How Datics helps
Datics specializes in Brownfield AI: production AI inside software people already rely on. Once your AI is live, AI Care re-tests it every month on your own cases and keeps it accurate and affordable, for $1,500 a month per capability. Not sure it is ready? The AI Scorecard tests it on 50 of your own cases in two weeks, for $5,000.
›References (2)
Related work
Case studies from our projects on the same subject.
NenoDoc Lexicon by Neno Technologies
GovTech · Archive knowledge workspace
Archive indexers fix grammar and style without a name, date or figure changing
AI rewrites can quietly alter names and numbers. Ours edits only flagged spans, and approved terms are locked before the model sees them.
CleanHaus
Property Management · Turnover operations SaaS
Hosts and cleaners manage rental turnovers in chat, within each person's permissions
Owners, managers and cleaners all talk in one property chat. Now an AI there acts for each of them, only within that person's role.
SovrenAI
Legal Tech · TITO, an AI claim verification engine
Every verdict traces to the founder's own rules, with the model only suggesting
A founder's AI-coded prototype could not be measured or audited; now rules anchor every verdict and each answer shows how it was reached.
More on AI in production
AI in production
LLMOps for SaaS: keep AI features working in production
LLMOps for product teams: evaluation gates, prompt and model versioning, tracing, regression checks, cost per task, kill switches and model upgrades.
AI in production
What is AI observability for agents in production?
AI observability for agents means tracing every model call, tool call and decision in one run, so teams see which step went wrong, not just the output.
AI in production
AI token cost: forecast LLM spend as usage grows
AI token cost grows with every customer. Measure it per feature, tenant and successful task, cut it with architecture choices, and forecast it as usage grows.
AI in production
AI agent monitoring: catch regressions in production
AI agent monitoring for live SaaS products: what to trace on every run, which user signals to watch, how to score traces and when to roll a change back.
AI in production
How can prompt management put domain experts in control?
Prompt management lets domain teams refine AI prompts and scoring rules after launch, while engineering keeps the pipeline, guardrails and staging step.
AI in production
Why add an AI kill switch to every feature and agent?
An AI kill switch lets you disable or degrade an AI feature in seconds, without a release. Here is how we design kill switches and safe fallbacks.
Your customers already expect AI from your product.
Let us make it real inside the product you run today.
