Engineering guide · General design considerations, not a client case study or a claim of certified compliance.
Define the task before choosing a model
A production LLM workflow needs a bounded task: extracting fields from an invoice is different from answering questions over internal documents. Specify the allowed inputs, expected output structure and actions the system must never take. Establish a conventional baseline, such as search or deterministic parsing, so an evaluation can show whether a model adds useful capability rather than simply producing fluent text.
Evaluate retrieval and answers separately
Build a representative test set with expected answers, ambiguous questions and questions that cannot be answered from the available material. For document search, measure whether retrieval finds the relevant passages before judging the generated answer. Require source references and a refusal when supporting evidence is absent. Keep development and held-out examples separate; otherwise prompt changes can appear to improve quality while only fitting familiar examples.
Treat model output as untrusted input
Retrieved documents can contain instructions that conflict with the application’s task. Keep those documents separate from system instructions and enforce permissions outside the model. Validate generated JSON against a schema. Tool calls should use narrowly scoped credentials, allowlisted operations and explicit human approval for consequential actions. Neither a confident answer nor a valid JSON object proves that a requested action is authorised.
Operate with measurable limits
Record model and prompt versions, latency, token usage, retrieval failures and review outcomes without logging unnecessary personal data. Set request budgets and timeouts, and define a fallback for provider outages. Roll out a new prompt or model to a small traffic segment before replacing the baseline. An operational checklist should identify who reviews failures, how a release is rolled back and when the workflow must defer to a person.
Related engineering services
More engineering guides
- An opinionated Azure landing zone for regulated workloads
- Multi-tenant data isolation strategies for SaaS
- Zero-trust architecture for enterprise apps
- Platform engineering: from cost center to product
- The pragmatic legacy modernisation playbook
- The custom software development process, step by step
- How to Choose the Right CRM Software for a Growing Business
- Lead Management Software: The Complete Guide to Capturing, Tracking, and Converting Leads
Project requirements, acceptance criteria and operating responsibilities should be agreed before implementation.
Discuss your engineering requirements