Evals
Tracking cost and latency
Cost per request, per conversation, per tenant and per feature — next to quality.
What it is and why it exists
Token usage × price per model, plus retrieval, reranking and tool costs, attributed to user, tenant, feature and prompt version. Latency tracked as p50/p95 for TTFT and total. Quality without cost hides unprofitable features; cost without quality hides false savings.
Quick prototype
Check the provider dashboard monthly.
In production, at scale
Usage logged per call with attribution tags, daily cost dashboards per tenant/feature, budgets and anomaly alerts, and cost and latency as columns in every eval comparison.
Vendors and tools
| LiteLLM / Helicone / Portkey | Gateways with cost tracking |
|---|---|
| Langfuse / LangSmith | Cost per trace |
On AWS: Bedrock application inference profiles with cost allocation tags; AWS Cost Explorer; CloudWatch metrics per model.
How it fails
- A single customer driving 40% of spend unnoticed
What the interviewer asks next
How do you attribute LLM cost to tenants?
Tag every call with tenant and feature at the gateway, log usage and computed cost, and aggregate daily; on Bedrock, per-application inference profiles with cost allocation tags.