Glossary

Model Routing

Not every request deserves the biggest model, and not every request may leave the building. Model routing sends each call to the model that fits its cost, speed, difficulty and data-sensitivity rules.

General definition

Model Routing is the decision layer between an application and the models it could use. A team rarely has one model: there is a frontier cloud model for hard tasks, a cheaper or faster one for simple ones, a small language model for classification, and perhaps a locally hosted model for data that may not be sent out. Routing is the set of rules, or a learned classifier, that picks one of them per request, plus the fallback logic that tries the next option when the first fails or is rate limited.

  • By capability: simple lookups and rewrites go to a small model, multi-step reasoning to a large one
  • By cost and latency: budgets and response-time targets per feature or per customer tier
  • By data sensitivity: prompts containing PHI, financial records or secrets stay on a local or in-region model; general questions may use a cloud API
  • By availability: fallback to a second provider or a self-hosted model on errors, timeouts or quota exhaustion
  • By contract: a customer whose agreement forbids a given vendor is routed around it

The common place to implement this is an LLM gateway, since applications already call it through one OpenAI-compatible API and it already holds the credentials for every provider. Routing can also live in the application, which is simpler for one or two rules, or in a dedicated router model that classifies the request first. Whichever layer does it, the sensitivity rule needs to run before any other, because a cost optimisation that sends a patient record to a public API is a breach, not a saving. Private AI deployments often route everything local by default and allow cloud models only for an explicit list of use cases.

Evaluate routing the way you evaluate a model: with a test set of real requests and the quality, latency and cost each route achieves. The cheap route is only a win if the answers are still right.

In the Ethora ecosystem

Ethora gives you two levers. Each agent in the AI SDK has its own model name, so a triage agent can run on a small model while a clinical-documentation agent runs on a larger one, and both share a room with the people they help. The AI service talks to any OpenAI-compatible endpoint, which can be a cloud API or a self-hosted server such as Ollama or vLLM; the endpoint is a service-wide setting, so routing across several providers is done by pointing it at an LLM gateway and letting the gateway apply the rules.

That split suits regulated deployments. A dedicated or self-hosted Ethora server with a local model behind the AI service keeps every prompt, retrieved document and reply inside your network, which is the simplest sensitivity rule there is: nothing is routed out. Where a cloud model is acceptable for some agents, a gateway in front of the service can send those agents’ requests to the provider and keep the rest local, with the Trust and Safety system, the archive and the audit trail applying equally to every agent whatever model answered.

Get started

Build AI agents on your own stack

Ethora’s AI SDK brings agents, RAG and self-hosted LLMs into your product. Talk to our team.

Start Free
Free tier available Enterprise SLA No vendor lock-in