Adaptive LLM inference router — the right model for every request.
Optimises quality against cost and latency, instead of sending everything to the biggest model available.
Using the strongest model for every request is expensive and slow. Using the smallest model for everything sacrifices quality.
ModelMesh answers one question per request:
Which model should answer this?
Request
│
Task classifier
│
Difficulty estimate
│
Model selection ──────────► Small / Medium / Reasoning / Large
│
Response evaluation
│
├── good enough ──► return
│
└── not good enough ──► escalate to the next tier
Only genuinely difficult requests reach expensive models.
score = quality − λ · cost − μ · latency
λ and μ are tunable, so the same router can be configured for a
cost-sensitive workload or a quality-sensitive one.
| Version | Strategy |
|---|---|
| v1 | Task classification → static tier mapping |
| v2 | Explicit quality / cost / latency optimisation |
| v3 | Adaptive escalation — start small, escalate only on failure |
The router is only interesting if it beats the obvious alternatives, so all four are benchmarked on the same request set:
| Strategy | Quality | Cost | Latency |
|---|---|---|---|
| Always cheapest | — | — | — |
| Always strongest | — | — | — |
| Static rule-based | — | — | — |
| ModelMesh | — | — | — |
A request set spanning the task types a real workload actually contains:
- simple extraction
- classification
- summarisation
- coding
- multi-step reasoning
- complex analysis
Every request logs: query, task type, selected model, quality score, latency, tokens, cost, whether it escalated, and the final model.
- quality retention vs. always-strongest
- cost reduction
- p50 / p95 latency
- routing accuracy
- escalation rate
- throughput
Python · PyTorch · Hugging Face Transformers · embeddings · vLLM
🚧 In development.