Right-sized models, grounded answers, bounded agents
The AI-services layer is where business value appears — and where most design mistakes happen. Choose the smallest model that does the job, ground it in permitted documents, and give agents only the power the user already has.
LLM or SLM? Route by task
Tens to hundreds of billions of parameters
- Open-ended reasoning, long documents, multi-step answers
- Example: 70B-class model ≈ 140 GB at 16-bit → two 141 GB-class GPUs
- ≈ 70 GB at 8-bit (FP8) → one 141 GB-class GPU
- Higher latency and cost per answer
About 1–8 billion parameters
- Classification, extraction, routing, short summaries
- Example: 8B-class model ≈ 16 GB at 16-bit → one 96 GB-class GPU with room for many users
- Smaller models fit a hardware partition of one GPU
- Fast and cheap; narrower knowledge
How to choose
- Task fit — reasoning, or a narrow task?
- Quality on YOUR test questions — not only public leaderboards.
- Fits GPU memory with headroom — weights + KV cache + overhead.
- Latency and volume targets — p95 time to first token at peak.
- Licence allows commercial use — “open-weight” is not always “free for anything”.
- Runtime support — your serving runtime and GPU support the model and its quantised format.
The RAG pipeline — how the model reads our documents
A pre-trained model does not know your policies. RAG retrieves the relevant, permitted passages at question time and asks the model to answer only from them, with citations.
Permissions
Capture ACLs at ingestion; filter at retrieval — or restricted text leaks into answers. The most common serious RAG bug.
Quality
Mostly decided by chunking, retrieval and reranking — not the LLM. Evaluate retrieval and generation separately.
Untrusted content
Retrieved text is data, not instructions. Guard against prompt injection hidden in documents.
An LLM that plans, uses tools and checks its work
A chatbot answers once. An agent repeats plan → act → observe until the goal is met or a limit stops it.
Worked example: a 02:10 GPU alert
- Read the hardware error alert on a GPU node.
- Find the runbook through RAG search.
- Ask a human to approve cordoning the node.
- Confirm the pods moved to healthy nodes.
- Open a hardware ticket with a summary.
🔑 Least privilege
Tools are scoped to the requesting user — never a super-user credential. Reading can be automatic; writing needs confirmation.
🧭 Bounded autonomy
Step and cost limits, guardrails, and human approval for risky actions. Open tool protocols standardise how agents reach tools; the security rules stay the same.
A supervisor and a team of specialists
Northwind Bank (fictional) must review 600 loan files overnight. A supervisor agent plans and delegates; only exceptions reach a human credit officer.
Common patterns
Supervisor and workers (shown), a sequential pipeline, or a critic agent that reviews another’s output.
Why split the work?
Focused prompts, the right-sized model per task, parallel processing and easier testing of each step.
Watch out
Tokens, latency and failure points multiply. Give each agent its own identity, limits and evaluation.