Private LLMs and RAG
Intelligent Model Routing: How to Direct Queries to the Right AI Model On-Premises
How intelligent model routing sends each request to the right on-premises model by cost, latency and quality, within data-class and EU AI Act constraints.
In short
Model routing decides which model handles each request. A routing layer first applies policy, such as data classification, deployment boundary and use-case approval, to find the eligible models, then picks among them by quality, latency and cost. On-premises, this saves scarce GPU capacity for the requests that need it and records which model handled what, and why.
Key takeaways
- Route in two steps: policy decides which models a request may use, and optimisation picks the best of those by quality, latency and cost.
- Rule-based routers are transparent; learned routers, such as those in the RouteLLM study, can cut cost without losing quality, but need preference or evaluation data from your own workload.
- Data classification is the primary policy input: personal and confidential data should reach only models inside an approved trust boundary, and fallbacks must stay inside it too.
- Log every routing decision with the policy version, the eligible models and the reason, so that compliance teams can show which model processed which data.
- For high-risk AI systems, the router is part of the system: change its policy under the same evaluation and change control as a model.
Why is one model rarely enough on-premises?
Requests differ in what they need, so a single model is either too weak for the hard ones or wasteful for the easy ones. Sending everything to the largest model spends scarce GPU capacity on trivial tasks and makes simple requests queue behind complex ones.
A typical on-premises estate includes a large general model for complex analysis, a small fast model for classification and extraction, fine-tuned specialists for domain tasks, embedding models for retrieval, and sometimes approved external services for public data. Having the models is the easy part. Deciding which one handles each request is where cost, latency, quality and compliance meet. The authors of the RouteLLM study state the core trade-off plainly: the choice of model often involves a trade-off between performance and cost.
What is model routing, and how does it differ from load balancing?
Model routing selects which model handles a request; load balancing selects which replica of that model serves it. A router reads the request and its context, applies policy and chooses a model, after which the serving layer’s load balancer picks an instance.
A well-designed router weighs several factors:
- Task complexity: simple look-ups and classifications go to small models; multi-step reasoning goes to larger ones.
- Latency requirements: interactive requests need fast models, while batch jobs can wait for slower, stronger ones.
- GPU capacity: on-premises capacity is fixed, so routing simple work to small models frees capacity for the tasks that need it.
- Domain fit: a fine-tuned specialist can outperform a larger general model in its own domain.
- Policy: data classification, deployment boundary and use-case approval decide which models are allowed at all.
Our explainer on LLM inference serving covers the serving layer underneath the router.
Which routing architectures work on-premises?
Three patterns cover most needs: rule-based routing, learned routing and cascades. Mature set-ups combine them, and always apply policy rules first.
Rule-based routing uses explicit conditions: requests from the contracts application go to the legal specialist, and short classification requests go to the small model. It is transparent, predictable and easy to audit, but it is brittle with ambiguous requests and needs manual tuning as models change.
Learned routing trains a lightweight model to predict which backend will answer a request well enough. In the RouteLLM study, Ong and colleagues trained routers that choose between a stronger and a weaker model, using human preference data and data augmentation. They reported cost reductions of more than two times in certain cases without compromising response quality, and their routers kept their performance when the strong and weak models were changed at test time. Those results come from the authors’ benchmarks and model pairs. A learned router for your workload needs your own preference or evaluation data, and periodic retraining as models and traffic change.
Cascades send each request to a small model first and escalate it to a larger one when the answer fails a confidence or quality check. They optimise for cost by default, but escalated requests pay the latency of two models, and the approach depends on confidence signals that are well calibrated. A high escalation rate suggests that the small model is not good enough for the task or that the threshold is too strict.
How do data classification and compliance constraints shape routing?
Policy comes first: every request carries a data classification and a use-case tag, and the router considers only the models approved for that combination. Optimisation for cost, latency and quality then happens inside that eligible set, never across it.
Apply the classification label where the request enters the AI platform, from the calling application, the user’s context or a data-loss-prevention check, and have the router treat a missing label as the most restrictive class. An example policy with three tiers:
- Public data may go to any approved model, including external APIs, subject to cost and performance.
- Internal data stays on models inside the organisation’s infrastructure or in a dedicated private environment under contract.
- Confidential data, including personal data, financial records, health information and trade secrets, goes only to models inside the organisation’s own security perimeter, with full logging and access control.
The tiers map to deployment boundaries: models on the organisation’s own hardware and network; models in a dedicated private or sovereign environment with contractual data-processing terms; and shared public cloud APIs, where visibility into data handling and logging is limited.
Fallback rules must respect the same boundaries. Confidential requests never fall back to a public API when the on-premises model is unavailable; they queue or fail. Internal requests may fall back to a private environment, but not to public APIs. Enforce these rules centrally in the routing layer, where individual applications cannot override them.
Data protection law is the reason this matters. Under the GDPR, personal data can be transferred to third countries only through a transfer mechanism such as an adequacy decision, standard contractual clauses or binding corporate rules, so that the protection travels with the data. A router that keeps personal data inside approved boundaries makes compliance easier to evidence, but it does not settle the legal assessment. Our guides to GDPR-compliant LLMs and to the CLOUD Act and Schrems II cover those questions.
How should routing handle EU AI Act risk levels and use cases?
Risk under the EU AI Act follows the use case, not the model, so tag every request with its use case and route high-risk use cases only to the models and configurations validated for them. The European Commission describes four risk levels: unacceptable risk, which is banned; high risk; transparency risk; and minimal or no risk.
Consider an organisation that runs an employee helpdesk chatbot and a system that ranks job applications. The chatbot falls under the transparency rules, which have applied since 2 August 2026 whichever model answers. Recruitment belongs to employment, one of the Annex III high-risk areas, where the obligations apply from 2 December 2027. Requests tagged with that use case should go only to the model that was evaluated and documented for it, with decision logging switched on to capture the model version, inputs, retrieved context, output and confidence. A router must never silently substitute a different model for a high-risk use case because the approved one is busy; queueing is safer than an unvalidated answer.
For high-risk systems, the router is part of the system, and the logging duties reach it. Article 12 requires high-risk AI systems to allow the automatic recording of events over their lifetime, including events relevant to identifying risks or substantial modifications and to post-market monitoring. Article 26 requires deployers to use the system in line with its instructions for use, to monitor its operation, and to keep the logs under their control for at least six months, unless other Union or national law, in particular on personal data, provides otherwise. Treat changes to the routing policy for a high-risk use case like model changes: evaluate them, approve them and record them.
The EU AI Act risk checker gives a first indication of a use case’s category, and our guide to high-risk AI systems explains the obligations. This is general information, not legal advice: classification depends on the intended purpose and on your role.
What makes routing decisions auditable?
Log every routing decision with the inputs to the policy, the eligible models, the choice and the reason, and keep those logs under access control and a defined retention period. Without that record, routing is an optimisation; with it, routing becomes a control you can evidence.
Record, for each request:
- the request ID, timestamp and calling application;
- the use-case tag, risk level and data classification;
- the policy version and the set of eligible models;
- the selected model and version, and the reason for the choice;
- any fallback or escalation, and why it happened;
- latency and outcome status.
Prefer metadata to content. Store full prompts and outputs only where a use case needs them, because logs can contain personal data and fall under the same protection rules as the data itself.
Compliance teams should be able to answer questions such as: which models processed personal data last quarter; how many high-risk requests went to a model outside the approved set, where the answer should be zero; and whether any request crossed an unauthorised boundary. Those answers form part of the monitoring evidence that a governance programme needs, which our AI governance work helps to set up.
How do you build and measure the routing layer?
Build routing as a layer in front of model serving, usually inside an AI gateway, with five parts: a request analyser, a policy engine, a decision engine, a model registry and a feedback loop.
- Request analyser: extracts features such as length, language, domain keywords, data classification and use-case tag.
- Policy engine: evaluates data-class, boundary and use-case rules and returns the eligible models.
- Decision engine: applies rules, a learned router or a cascade within the eligible set. Keep it fast, because it sits in the path of every request.
- Model registry: holds each model’s capabilities, approvals, current load, latency and health.
- Feedback loop: captures quality signals, such as user ratings, downstream task success and evaluation scores, to tune routing over time.
Self-hosted gateways provide much of the mechanics. LiteLLM, for example, can run as a proxy server that balances load across deployments of a model and offers routing strategies including weighted, latency-based, least-busy, rate-limit-aware and lowest-cost routing. It falls back to the next model in a list when a deployment fails, can filter out deployments whose context window is too small for a request, and puts failing deployments into cooldown. Its documentation notes that usage-based routing is not recommended for production because of its performance impact. Check whether a gateway can express your data-class and use-case rules; if it cannot, put your own policy layer in front of it.
Measure routing with a small set of metrics:
- Routing quality: on a sampled set, how often the routed model’s answer was as good as that of the strongest eligible model.
- GPU-hours saved, compared with the baseline of sending everything to the largest model.
- Latency distribution at the 50th, 95th and 99th percentiles: routing should cut median latency without hurting the tail.
- Fallback and escalation rates, which reveal small models that are not good enough or thresholds that are too strict.
- Policy denials and boundary violations, where the target for violations is zero.
Start with policy rules and simple routing by task type, measure the effect, and add a learned router once you have evaluation data to train and check it. SysArt designs routing layers, routing policies and audit logging as part of private LLM and on-premises AI implementations.
Photo by Avi Waxman on Unsplash.
Frequently asked questions
What is intelligent model routing?
It is a layer that selects which model answers each request, based on the request and on policy. A short classification might go to a small, fast model, a multi-step analysis to a larger model, and a contract question to a fine-tuned specialist. It differs from load balancing, which spreads requests across replicas of the same model; in practice, a router and a load balancer work together.
How is a router different from a model cascade?
A router chooses one model before generation, using features of the request or a trained predictor. A cascade sends the request to a cheaper model first and escalates to a larger one only if the answer fails a confidence or quality check. Cascades need no upfront prediction, but escalated requests pay the latency of two models, and the approach depends on well-calibrated confidence signals.
Can model routing help with GDPR compliance?
It can enforce part of it. A router can make sure that personal data reaches only models in approved environments and never falls back to an external service. Under the GDPR, transfers of personal data to third countries need a transfer mechanism, such as an adequacy decision or standard contractual clauses. Routing does not establish a legal basis, replace a data protection impact assessment or set retention periods, so those duties remain.
What should a routing log contain?
For each request: a request ID and timestamp, the use-case tag and data classification, the policy version, the eligible models, the model and version selected, the reason, any fallback, and latency. Log metadata rather than full prompts unless a use case needs the content, because logs can hold personal data. Deployers of high-risk systems must keep automatically generated logs for at least six months under Article 26(6), unless other law provides otherwise.
Does the EU AI Act regulate model routing?
Not directly. The AI Act regulates AI systems according to their intended purpose and your role, not individual components. If a router is part of a high-risk system, it falls under that system's requirements, such as automatic logging under Article 12 and deployer monitoring and log retention under Article 26, which apply to Annex III systems from 2 December 2027. This is general information, not legal advice.
Which tools can implement a routing layer on-premises?
Self-hosted AI gateways cover much of the mechanics. LiteLLM's proxy server, for example, balances load across deployments, offers routing strategies such as weighted, latency-based, least-busy and lowest-cost routing, falls back to the next model on failure and puts failing deployments into cooldown. Check whether a gateway can express your data-class and use-case rules; if it cannot, add your own policy layer in front of it.
Sources
- Ong et al.: RouteLLM: Learning to Route LLMs with Preference Data (arXiv:2406.18665) · checked 27 October 2026
- LiteLLM documentation: Router, load balancing, fallbacks and routing strategies · checked 27 October 2026
- European Commission: Rules on international data transfers · checked 27 October 2026
- European Commission: AI Act, regulatory framework for AI (risk levels and application dates) · checked 27 October 2026
- AI Act Service Desk: Article 12, record-keeping (consolidated text) · checked 27 October 2026
- AI Act Service Desk: Article 26, obligations of deployers of high-risk AI systems (consolidated text) · checked 27 October 2026