Engineering
How to Move from AI Demos to AI Systems
Most teams can prototype AI in days; reliability takes discipline. The evaluation, observability, fallback and ownership practices LehtAI uses to ship AI safely.
Summary
Moving from an AI demo to an AI system means adding the engineering a prototype skips: an evaluation suite that gates every release, end-to-end observability, designed fallbacks for when models fail, and a named owner with service-level objectives. At LehtAI we treat these four controls as launch criteria, because demos that impress on curated inputs usually break on edge cases, cost and drift.
Key takeaways
- A demo proves a model can work once; a system proves it works on every input, at a known cost, with someone accountable when it does not.
- Build the evaluation set before the feature: a few hundred real, labeled examples, versioned and run automatically on every prompt, model or data change.
- Trace every request end to end — input, retrieved context, model version, latency, cost and outcome — with personal data redacted before it is stored.
- Design the failure path explicitly: timeouts, a simpler backup path and a human queue, so a model failure degrades service instead of breaking it.
- Name one owner per AI system, with SLOs, a runbook and an on-call rotation, before launch rather than after the first incident.
On this page
Building an impressive AI demo has never been easier. A capable model, a notebook and a handful of well-chosen examples can produce something that wins a steering-committee meeting in a week. The trouble starts the following Monday, when real users send inputs nobody anticipated, the finance team asks what it costs per request, and nobody can explain why yesterday's answer was different from today's.
This article describes the engineering and operating discipline we use at LehtAI to close that gap. It applies to classic machine learning models and to LLM applications alike, although the examples lean toward generative AI because that is where the demo-to-production gap is currently widest.
Why do AI demos fail in production?
AI demos rarely fail because the model is bad. They fail because a demo is optimized to answer one question — can this work? — while production asks several others: does it work for every user, on every input, at an acceptable cost, and can we tell when it stops working? The recurring failure modes are predictable:
- Input distribution gap. Demo inputs are curated. Production inputs include typos, scanned PDFs, mixed languages, empty fields and adversarial prompts.
- No definition of correct. Without agreed examples of good and bad output, quality becomes a matter of opinion, and every change is a gamble.
- Hidden dependencies. The demo quietly relies on a hand-cleaned file, a developer's API key or a document index that nobody refreshes.
- Unbounded cost and latency. Long prompts, large models and retries that looked free in testing become a real line item at thousands of requests per day.
- Silent degradation. Models do not throw exceptions when they get worse. Data drift, a provider model update or a stale index lowers quality without any alert firing.
- No owner. The prototype team moves on, and the system becomes an orphan that operations cannot debug and product cannot improve.
Each of these has a known engineering answer. The work is not glamorous, but it is what turns a model into a product people can rely on.
What separates an AI demo from an AI system?
The clearest way to scope productionization is to compare the two side by side. Every row in the table below is a piece of work that has to be planned, estimated and owned.
| Dimension | Demo | Production system |
|---|---|---|
| Inputs | Curated examples chosen by the builder | Every real input, including malformed, ambiguous and adversarial ones |
| Definition of quality | "Looks good" in a live walkthrough | Versioned evaluation set with agreed metrics and pass thresholds |
| Failure handling | Restart the notebook | Timeouts, retries, fallback paths and a human queue |
| Visibility | Print statements | Request traces, quality, latency and cost dashboards, drift alerts |
| Cost | Unmeasured | Cost per task tracked against a budget, with routing and caching |
| Change management | Edit the prompt and rerun | Versioned prompts, models and data; evaluation gate; canary rollout |
| Ownership | Whoever built it | Named owner, SLOs, runbook and on-call rotation |
How do you build an evaluation suite that gates releases?
An evaluation suite is the single most valuable production asset an AI team owns. It converts quality from an argument into a number, and it is the only safe way to change prompts, swap models or re-index documents.
Start with a golden set from real traffic
Collect a few hundred real inputs — support tickets, user questions, documents, transactions — and have domain experts label the expected output or the facts a correct answer must contain. Deliberately over-sample the hard cases: rare categories, long documents, questions with no answer in the source material, and inputs that should be refused. Version the set in the same repository as the code, and add to it every time a production failure is found.
Score what the business cares about
Pick a small number of metrics that map to user harm. For a retrieval-augmented assistant, that usually means answer correctness, groundedness in the retrieved sources, citation accuracy, correct refusal when the answer is not in the documents, and latency. For a classifier, it means precision and recall per class, measured on segments that matter, not just overall accuracy.
LLM-as-judge scoring is useful for scaling open-ended evaluation, but treat the judge as a model that needs its own validation. Have experts grade a sample of the same outputs, measure agreement with the judge, and keep the judge's prompt and model version pinned. A judge that silently changes is as dangerous as a production model that silently changes.
Make evaluation a release gate
- Run the full suite in CI on every change to prompts, model versions, retrieval settings or feature pipelines.
- Compare results with the current production baseline, not with an absolute target alone, so regressions on specific segments are visible.
- Block the release automatically when a critical metric drops below its threshold, and require a named reviewer to approve any override.
- Store every evaluation run with its configuration, so you can answer "what changed?" months later.
This is the core of how we deliver generative AI and LLM applications such as an enterprise knowledge assistant: the evaluation set is agreed with stakeholders during the prototype, before anyone debates whether the system is good enough to launch.
What should AI observability capture?
Traditional application monitoring tells you whether a service is up. AI observability has to tell you whether it is right. That requires capturing the full context of each request, not just its status code. For every request, trace:
- The input, after personal data has been redacted or tokenized at the edge
- Retrieved documents or features, with their identifiers and versions
- The prompt template version, model name and model version, and key parameters
- Tool calls made by agents, with arguments, results and timing
- Output, guardrail decisions, latency per step, tokens consumed and cost
- The downstream outcome when available: accepted, edited, escalated, overridden or complained about
Standardize the trace format early. The OpenTelemetry semantic conventions for generative AI (opens in new tab) define common span and metric names for model calls, which keeps traces portable across tools such as Langfuse, Arize Phoenix or your existing observability stack.
On top of traces, build three dashboards: quality (evaluation scores on a sampled slice of live traffic, user feedback, escalation rate), operations (latency percentiles, error and timeout rates, fallback activations) and economics (cost per request and per completed task, cache hit rate). For classic models, add input drift and prediction drift monitors, for example population stability index on key features. This instrumentation is a standard part of our MLOps and LLMOps work, because without it nobody can prove the system is still doing its job.
How should an AI system fail?
Every AI component will fail: the provider times out, the model returns malformed output, confidence is low, or a guardrail blocks the response. The question is whether the failure was designed. We design a fallback ladder for every AI step, from cheapest recovery to safest:
- Retry with a budget. Retry transient errors with exponential backoff and a hard timeout, so one slow call cannot stall a whole workflow.
- Validate and repair output. Enforce a schema on structured output; on failure, retry once with the validation error, then fall through.
- Fall back to a simpler path. Route to a secondary model, a cached answer, a retrieval-only response that shows relevant passages, or a rules-based score.
- Hand off to a person. Send the case to a human queue with full context attached, so the user is served and the case becomes a labeled example.
- Fail closed for irreversible actions. If an agent cannot verify a payment, refund or record change, it should stop and ask rather than guess.
Confidence thresholds are the most practical lever. A fraud detection model can auto-clear low-risk transactions, block very high-risk ones and route the uncertain middle band to analysts. An AI customer support assistant can answer routine questions directly and escalate anything involving account changes or low retrieval scores. For tool-using AI agents, add idempotency keys and circuit breakers, so a retry never sends the same email or posts the same journal entry twice.
Who owns an AI system after launch?
Ownership is the control most often skipped and the one that matters most a year later. An AI system needs the same operating model as any critical service, plus a domain reviewer who can judge whether outputs are correct. We assign three roles before launch:
- Product owner — accountable for the business outcome, the quality thresholds and the decision to launch, pause or retire.
- Technical owner — accountable for reliability, cost and change management; leads the on-call rotation.
- Domain reviewer — an expert from the business who reviews sampled outputs, labels failures and approves changes to the evaluation set.
The owners agree service-level objectives in the sense the Google SRE book (opens in new tab) describes: a target for a measured indicator. For AI systems, define SLOs for availability, p95 latency, quality on sampled live traffic and cost per task. When a quality SLO is breached, the runbook says what to do: roll back to the previous prompt or model version, switch to the fallback path, or pause automation and route everything to people.
Change management closes the loop. Prompts, model versions, retrieval indexes and feature pipelines are all versioned artifacts. Changes go through the evaluation gate, then a shadow run on live traffic without affecting users, then a canary release to a small share of traffic, before full rollout. Provider model updates deserve the same treatment: pin versions where the provider allows it, and re-run the suite before accepting an upgrade.
What does a production-readiness checklist look like?
We use a short checklist as the launch gate for every AI system. It is deliberately short enough to be used on every project, rather than a long document that is skipped under deadline pressure.
- Evaluation set agreed with domain experts, versioned, and passing thresholds on the release candidate
- Tracing in place for every request, with personal data redacted and retention rules applied
- Quality, operations and cost dashboards live, with alerts routed to the on-call owner
- Fallback ladder implemented and tested by deliberately failing each dependency
- Security review completed: access controls, secrets handling, prompt-injection tests for LLM features
- Rollback tested: the previous prompt, model and index versions can be restored in minutes
- Owners named, SLOs agreed, runbook written and on-call rotation staffed
- Feedback loop defined: how overrides and escalations flow back into the evaluation set
None of this requires a large platform on day one. A repository with versioned prompts and evaluation data, a CI job, a tracing tool and a deployment pipeline with rollback covers most of it. What it does require is treating the AI component as a product with a lifecycle rather than an experiment with a launch date — which is the stance our AI product engineering teams take from the first sprint.
If you have a promising prototype and want a second opinion on what it would take to run it reliably, the checklist above is a good place to start the conversation. Teams that work through it honestly usually find the remaining effort is smaller and more predictable than they feared.
Frequently asked questions
How long does it take to move an AI prototype into production?
For a single, well-scoped use case, moving a working prototype into production commonly takes several weeks to a few months. The duration depends less on model work than on data access, the number of systems to integrate, security review and whether an evaluation set already exists. Agreeing quality thresholds and naming owners early is the most reliable way to shorten the timeline.
What is an evaluation set for an AI or LLM application?
An evaluation set is a versioned collection of real inputs paired with expected outputs or grading criteria, labeled by domain experts. Every change to prompts, models or data is scored against it automatically, so quality is measured rather than debated. Good sets over-sample hard cases, include inputs that should be refused, and grow every time a production failure is found.
Do we need a full MLOps platform before launching our first AI system?
No. A first production AI system needs a minimum set of capabilities rather than a platform: version control for code, prompts and evaluation data, an automated evaluation run in CI, request tracing, a deployment pipeline with tested rollback, and basic quality and cost dashboards. Teams can adopt a fuller MLOps or LLMOps platform once several systems share the same needs.
