Building production-grade AI features (beyond the demo)

Most AI demos never survive real users. This is the checklist we use to take an LLM feature from a good demo to a reliable product: evaluation, grounding, cost caps, guardrails and human review.

DDivyaSoft Team 9 min read
Building production-grade AI features (beyond the demo) cover image

An AI feature is production-ready when you can say how often it is right, what it costs per use, what happens when it is wrong, and who finds out. A demo answers none of those questions. This guide is the checklist we use at DivyaSoft to move an LLM feature from "it worked in the meeting" to "we can run it for customers". Last reviewed November 2026.

Why do AI demos fail in production?

A demo uses clean inputs, one friendly user and no budget. Production has the opposite:

  • Messy input. Users paste half a sentence, switch languages, upload the wrong file or try to break it.
  • Cost ceilings. A feature that costs a few cents per use is fine at 100 uses a day and a line item at 100,000.
  • Latency limits. A response that takes eight seconds feels broken inside a checkout or a chat window.
  • Rules. Privacy law, brand voice and "never promise a refund" policies apply to a model just as they apply to staff.
  • Drift. Models, prompts, documents and user behaviour all change, so a feature that passed in March can fail in June without a single code change.

The gap between the demo and the product is where most AI projects stall. Closing it is mostly engineering discipline, not a cleverer prompt.

The five-step checklist

  1. Evaluate before you launch.
  2. Ground the answers in your own data.
  3. Cap cost and latency.
  4. Put guardrails at the edges.
  5. Keep a human in the loop for high-risk actions.

The sections below explain each step and what "done" looks like.

Step 1: How do you evaluate an AI feature before launch?

Build a small test set and grade the feature against it every time anything changes.

  • Collect 50 to 100 realistic inputs. Use real questions, tickets, emails or documents (with personal data removed), not inputs you invented. Include the awkward ones: typos, vague requests, off-topic questions, attempts to make the bot misbehave.
  • Write what a good answer looks like. For some tasks this is an exact answer (a category, a date, a yes or no). For others it is a short rubric: correct, polite, uses only the supplied facts, does not promise anything.
  • Grade on a few dimensions, not one score.
DimensionQuestion to askTypical check
CorrectnessIs the answer factually right?Compare to the reference answer
GroundednessDoes it use only the supplied sources?Check each claim against the retrieved text
Tone and policyDoes it follow brand voice and rules?Rubric review
RefusalsDoes it decline what it should decline?Include out-of-scope and unsafe prompts
FormatIs the output valid for the next system?Schema validation
  • Re-run the set on every change. A new prompt, a new model version, a new knowledge document: each can fix one case and break three. Keep the results so you can compare runs.
  • Set a launch bar and a rollback bar. For example, "ship at 90% correct with zero policy violations on the test set; roll back if live spot checks fall below 85%". Pick numbers that match the risk of the task. Do not borrow numbers from another team.

Another model can help grade large sets, but sample its grades by hand. An automated grader has its own errors.

Step 2: How do you stop the model from making things up?

Ground it. For anything that depends on your facts (prices, policies, order status, product details), do not rely on what the model remembers. Give it the relevant text at question time and tell it to answer only from that text.

  • Use retrieval (RAG) for knowledge-heavy tasks. Split your documents into sections, search them for the user's question, and pass the best matches to the model.
  • Ask for citations. Have the model name which source it used. If it cannot, the safest answer is "I do not know" plus a hand-off to a person.
  • Keep the knowledge base current. A stale price list produces confident wrong answers. Give each document an owner and a review date.
  • Prefer live lookups for live facts. Order status, stock and appointment slots should come from your systems through a tool call, not from a document.
  • Allow "I do not know". A feature that admits gaps is more trusted than one that always answers.

Step 3: How do you control cost and latency?

Work out the unit economics early, then design to them.

  • Measure cost per successful task, not per request. Retries, long contexts and tool calls all add up.
  • Route by difficulty. Send simple, high-volume requests to a smaller, cheaper model and reserve the large model for hard cases. A cheap classifier up front often pays for itself.
  • Trim the context. Send only what the task needs. Long histories and whole documents raise cost and slow the answer.
  • Cache what repeats. Identical questions, shared instructions and unchanged documents are good candidates for caching where your provider supports it.
  • Stream long answers so the user sees progress while the rest generates.
  • Set hard limits. Cap tokens per request, requests per user per hour and spend per day, with alerts before the cap is reached.
  • Set a timeout and a fallback. If the model call fails or is slow, show a useful default or hand the user to a person.

Check your provider's current pricing page when you do the maths. Prices and limits change.

Step 4: What guardrails does an AI feature need?

Treat model output like any other untrusted input.

  • Validate structure. If the next system expects JSON, enforce a schema (Zod or JSON Schema) and reject or retry anything that does not match.
  • Validate content. Check that required fields exist, numbers are in range, links go to your domains and no private data is echoed back.
  • Defend against prompt injection. Text from users, emails, web pages or documents can contain instructions. Keep system instructions separate, never give the model more permissions than the task needs, and do not let it act on instructions found inside retrieved content.
  • Limit what tools can do. Give each tool the narrowest permission (read-only where possible) and log every call.
  • Filter the output. Block phrases and promises your policy forbids, such as guarantees, legal or medical advice, or price commitments.
  • Protect personal data. Send the model only the personal data the task needs, and check your provider's data-handling and retention terms against your obligations.

Step 5: When should a human review the output?

Whenever a mistake is expensive or hard to undo.

RiskExamplePattern
LowDraft a reply, summarise a callAuto-run, sample for quality
MediumSend a customer email, update a CRM recordShow the draft, one-click approve
HighRefund money, delete data, sign or send a contractHuman decides; AI only prepares

Make hand-off easy: pass the full conversation and what the AI already tried, so the person does not start from zero. Log every correction. Corrections are your best new test cases.

How do you monitor an AI feature after launch?

  • Log inputs, outputs, model version, prompt version, cost and latency for every call (with personal data handled according to your privacy policy).
  • Track a handful of live numbers: failure and fallback rate, hand-off rate, thumbs-down rate, cost per task, p95 latency.
  • Review a weekly sample by hand. Twenty conversations read carefully beat a dashboard.
  • Version your prompts like code, and test changes against the evaluation set before release.
  • Re-run the full evaluation whenever the model, the knowledge base or the prompt changes, and on a schedule even if nothing changed.
  • Have an off switch. You should be able to disable the feature, or route to a person, in minutes.

Common mistakes

  • Launching with no test set, then judging quality by feel.
  • Fixing one bad answer with a prompt tweak that quietly breaks others.
  • Letting the model call tools with broad permissions "to keep it simple".
  • Measuring only cost per request and missing that retries double it.
  • Treating the first week's quality as permanent.
  • Hiding the AI from users. Say clearly when someone is talking to an AI and make a human option easy to reach.

A pre-launch checklist you can copy

  • [ ] Test set of 50 to 100 real inputs with reference answers
  • [ ] Launch and rollback thresholds written down
  • [ ] Answers grounded in current documents or live lookups
  • [ ] "I do not know" and human hand-off paths tested
  • [ ] Cost per task measured; daily spend cap and alerts set
  • [ ] Timeout, retry limit and fallback in place
  • [ ] Output validated against a schema
  • [ ] Prompt-injection and abuse cases in the test set
  • [ ] Tools limited to the least permission needed
  • [ ] Human approval on high-risk actions
  • [ ] Logging, weekly review owner and off switch in place

Frequently asked questions

How long does it take to take an AI feature from demo to production?

It depends on the risk and the data. A narrow feature with clean data and a human approving every output can be live in a few weeks. A feature that touches money, personal data or several systems takes longer, mostly because of evaluation, integration and review work, not the model call itself.

Do we need RAG for every AI feature?

No. Use retrieval when answers depend on your own documents or data. For tasks such as rewriting text, classifying messages or extracting fields from a form, a well-written prompt with a schema is often enough.

How big should the evaluation set be?

Start with 50 to 100 realistic cases that cover normal, awkward and unsafe inputs, then add every real failure you find. A small, honest set that you re-run often is more useful than a large one you never run.

How do we keep AI costs predictable?

Measure cost per successful task, route easy requests to cheaper models, trim the context, cache repeated work and set daily spend caps with alerts. Review the numbers weekly for the first month.

Can DivyaSoft build and run this for us?

Yes. We build AI features and agents for clients, from evaluation sets to monitoring. See our AI services and custom software development, or tell us what you need. If you are still deciding between buying a tool and hiring a team, read our AI agency or AI software decision guide.

#AI#LLM#Engineering

Need this done for you?

Talk to the DivyaSoft team

Software, AI, video ads and digital marketing from our team in Kathmandu. Tell us what you need and we reply by email with questions or a quote.

Get new guides by email

Ready to grow with AI, marketing & technology?

Book a consultation and tell us what you're working on. We'll get back within one business day with a concrete next step — not a sales pitch.