Large language models have made it possible to build impressive features quickly. A prototype that summarises documents, answers questions or drafts replies can be ready in an afternoon. Turning that prototype into a feature that runs reliably for real users, at reasonable cost and without unpleasant surprises, takes considerably more work.
This checklist covers the engineering practices that matter most before and after launch.
Architecture
- Isolate model access. Route all model calls through a single internal service or library. This makes it easier to switch providers, apply consistent policies and monitor usage.
- Keep prompts out of scattered code. Store prompts as versioned templates, with clear ownership and change history.
- Design for model changes. Models are updated and retired. Avoid tight coupling to one model’s quirks, and plan how you will test and roll out new versions.
- Separate retrieval from generation. If you use retrieval-augmented generation, keep the search and ranking components testable on their own.
- Use structured outputs where possible. When downstream code depends on the model’s output, request and validate a defined structure rather than parsing free text.
Evaluation
- Build an evaluation set of realistic inputs with expected qualities, including edge cases and adversarial examples.
- Automate evaluation runs so they execute on every change to prompts, models or retrieval settings.
- Define pass criteria for launch, agreed with the product owner.
- Calibrate automated grading against human judgment before relying on it.
- Track regressions at the level of individual cases, not just averages.
Reliability
- Handle timeouts and errors. Model APIs can be slow or unavailable. Set sensible timeouts, retry with backoff where safe and degrade gracefully.
- Provide fallbacks. Decide what users see when the AI feature fails: a clear message, a simpler non-AI path or a queued request.
- Manage rate limits. Understand provider limits and design queuing or throttling accordingly.
- Stream where helpful. For long responses, streaming improves perceived speed, but make sure partial outputs are handled correctly.
- Validate outputs. Check structure, length and required fields before using outputs. Reject or retry invalid responses.
Security and privacy
- Protect against prompt injection. Treat user input and retrieved content as untrusted. Do not let them override system instructions, and limit what the model can do with tools.
- Apply least privilege to tools. If the model can call functions or APIs, give it only what it needs, with server-side authorisation checks.
- Respect data permissions. Retrieval must enforce the same access controls as the rest of your application.
- Minimise sensitive data. Avoid sending personal or confidential data to models unless necessary and approved. Redact where possible.
- Review provider terms. Confirm data retention, training use and processing locations meet your requirements.
- Log carefully. Logs of prompts and outputs are valuable but may contain sensitive data. Apply retention limits and access controls.
Observability
- Log each request with prompt version, model, latency, token usage and outcome.
- Trace multi-step flows, especially for agents that call several tools.
- Capture user feedback and behavioural signals such as edits and rejections.
- Monitor quality, not just uptime, through regular sampling and review.
- Alert on anomalies such as error spikes, latency increases or cost jumps.
Cost
- Estimate costs before launch based on expected usage and token counts.
- Choose the right model size for each task; larger is not always better.
- Cache repeated requests where appropriate.
- Set budgets and per-feature limits with alerts.
- Monitor unit cost, such as cost per conversation or per document processed.
User experience
- Label AI-generated content clearly.
- Let users edit, reject and give feedback easily.
- Show sources when answering from documents.
- Communicate limitations honestly.
Launch and operations
- Roll out gradually, using feature flags to release to a small group first.
- Prepare a rollback plan for prompts, models and the feature itself.
- Assign owners for quality, reliability and cost.
- Document runbooks for common incidents, such as provider outages or quality regressions.
- Schedule regular reviews of quality, feedback and costs.
After launch
Production is where you learn the most. Review real interactions, add failure cases to the evaluation set, refine prompts and retrieval, and re-test. Treat the feature as a living product that improves continuously.
Shipping LLM features responsibly is not about slowing down. These practices let teams move faster with confidence, because they can see what is happening and change things safely.