Code and dense tables are folded away. Open any of them on demand.
What is a latency budget for an AI agent?
A latency budget is the maximum time an AI agent turn may take before users feel it is slow, split across every step in the turn. Usability guidance puts instant at about 0.1 s and uninterrupted flow at about 1 s. Each serial decision, such as choosing a tool or running a safety check, spends part of that budget.
Users do not experience model latency; they experience waiting. Long-standing usability guidance (Nielsen Norman Group) gives three rough limits: about 0.1 s feels instantaneous, about 1 s keeps the user's flow of thought, and about 10 s is the limit of attention before people switch tasks. Voice is stricter still: studies of conversational turn-taking across languages (Stivers et al., 2009) find typical gaps between speakers of a few hundred milliseconds, so a voice agent that pauses for two seconds feels broken.
An AI agent turn usually contains one large, slow step (an LLM generating a reply or a plan) and several small decisions around it. Those small decisions are where budgets quietly overflow, because each one looks cheap in isolation.
Where the time goes in an agent turn
A typical support or operations agent turn, with every decision made by a hosted LLM call:
Show technical detailsHide technical details· 7 rows × 3 columns
| Step | Kind | Serial? |
|---|---|---|
| Input guardrail: jailbreak, injection, sensitive data | Classification | Yes, before anything else |
| Language and intent detection | Classification | Yes |
| Tool or route selection | Classification | Yes |
| Tool call (search, database, API) | I/O | Yes |
| Response generation | Generation | Yes |
| Output check: policy, PII, tone | Classification | Yes, before sending |
| Escalation decision | Classification | Yes |
Five of seven steps are classification. If each is a generative LLM call at several hundred milliseconds, the decisions alone can consume the entire "keeps the flow" budget before the reply has been written.
Budgeting: serial, parallel and tail
Three rules of thumb help.
Serial steps add. If step B needs step A's output, their latencies sum. Guardrails usually must run before the rest, and output checks after generation. Minimise the number of serial decision points.
Independent decisions should be batched. Intent, urgency, sentiment and language are all functions of the same input. Asking them in one request instead of four sequential calls turns a sum into roughly a maximum.
Plan for the tail, not the median. Dean and Barroso (2013) showed that when a request fans out to many components, the slowest component dominates. A decision service with a 30 ms median and an occasional 2 s stall will, across enough calls, produce 2 s turns. Budget with p95 or p99 figures, and give every call a timeout with a safe fallback.
A simple budget for a chat agent aiming at about one second:
Show technical detailsHide technical details· text sample
These are planning targets, not measurements. Replace them with your own p95 numbers.
What a one-pass decision model costs
Laya answers all questions in a request in one encoder forward pass, with no generated tokens. The model card's measurements on a single Tesla T4:
| Questions per call | laya (English) | laya-multilingual |
|---|---|---|
| 1 | 39.5 ms | 32.8 ms |
| 5 | 84.5 ms | 40.1 ms |
| 10 | 158.6 ms | 72.3 ms |
| 50 | 771 ms | 337 ms |
Batching is where the model shines: ten questions on the multilingual checkpoint cost 7.2 ms each. The card also reports 193 to 464 ms per request on CPU with all checkpoints preloaded, which matters if you self-host without a GPU.
For reference, the card cites independent measurements of TypeSafe Jev at 236 to 276 ms p50 per call (AbdelStark and nibzard benchmarks), and states Laya answers a single question roughly 6 to 8 times faster. Those are model-side numbers on a GPU. A hosted API adds network round-trip time between your servers and the endpoint, which depends on region and connection reuse; measure it from where your agent runs.
Hidden latency: cold starts and model swaps
Model-side latency is only the steady state. Two self-hosting pitfalls are documented in the model card:
- Cold loads. Building a checkpoint takes seconds. Version 0.3.7 cut CPU load time from about 22 s to about 2 s, but a first request that triggers a load still pays for it.
- Swapping checkpoints. A router that keeps only one model resident reloads on every language switch: a 7.4 s median on CPU and 10.3 s on T4. The default keeps two resident, and
preload=Truekeeps all three so routing costs only detection (under 1 ms).
These are mainly self-hosting concerns: with a hosted endpoint such as Laya Studio, checkpoints are loaded on the server rather than per request. They are worth knowing if you ever move the same workload on-premise.
Techniques that keep decisions inside budget
- One request per input, many questions. The biggest win. It also costs no more credits than separate calls, since each question reads the state once either way.
- Keep states short and relevant. Encoder cost grows with input length. Send the message, not the whole CRM record.
- Run independent checks in parallel with other I/O, for example the output check alongside logging.
- Set timeouts with defaults. If a decision call times out, fall back to the conservative route (escalate, or block for guardrails).
- Reuse connections. Keep-alive and HTTP/2 remove TLS handshakes from every call.
- Escalate only the uncertain tail to a slower LLM, gated on calibrated confidence; see act or escalate.
Measuring a batched Laya Studio call
Use curl's timing output to see what one batched decision call costs from your own infrastructure:
Show technical detailsHide technical details· bash sample
Run it a few hundred times with a reused connection and record p50 and p95. Four questions read the state four times per call, billed per input token. See the docs for client examples, and /signup for a free-tier key.
Frequently asked questions
How fast is Laya?
Is it faster to send several questions in one call or separately?
What latency should an agent aim for?
Why is the multilingual checkpoint faster than the English one?
What happens to latency on CPU?
What is p95 latency and why does it matter for agents?
How fast is Laya Studio from Europe?
Sources
- Nielsen Norman Group, Response Times: The 3 Important Limits
- Dean & Barroso (2013), The Tail at Scale
- Stivers et al. (2009), Universals and cultural variation in turn-taking in conversation (PNAS)
- Laya model card: speed and deployment modes
- Jev latency benchmarks (AbdelStark)
- Decision model benchmark (nibzard)
Last updated . Laya Studio is an independent hosted service for the open-source Laya model (Apache-2.0, © Convai Innovations) and is not affiliated with Convai Innovations or TypeSafe.
Next articleTemperature scaling: the one-parameter fix for over-confidenceWhat temperature scaling is, how one fitted number fixes over-confident probabilities without changing predictions, and how to fit it on Laya outputs.