Alvin Routing
How Alvin automatically selects the right AI model for each request.
Alvin reads each prompt and sends it to the model best suited to it. You don't pick a model; you just ask for what you want.
How it works
Alvin evaluates each prompt against the current model catalog and sends it to the model best suited to it, then reports which model answered.
Selection accounts for what the request needs — the kind of task, how demanding it is, how much context it carries — and for cost, so that capable but expensive models are used where they're warranted rather than by default. The catalog changes as providers ship and retire models, and routing follows it.
Seeing the routing decision
Every response shows the model that answered it, alongside token count and latency. That attribution is deliberate: you should always be able to tell what actually ran.
You can also review routing patterns over time in Analytics, and see the cost breakdown by model in the cost dashboard.
Overriding Alvin
To use a specific model instead:
- Click the Model dropdown in chat settings
- Select the model you want
- Subsequent messages use it
- Click Use Alvin to hand routing back
Worth overriding when you need a particular model's capabilities, when you're comparing models directly, or when you're debugging. Otherwise routing generally does better than a fixed choice, because no single model is the right answer for every prompt.
Manually pinning a frontier model for everything is the most common cause of an unexpectedly large bill. If cost matters, leave routing on.
Using Alvin from the API
Set the model to alvin:
curl -X POST https://api.elyxir.ai/v1/chat/completions \
-H "Authorization: Bearer elyxir_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "alvin",
"messages": [{"role": "user", "content": "Write a Python function to sort a list"}]
}'Routing metadata
Auto-routed responses carry the decision in both the headers and the body:
| Header | Description |
|---|---|
X-Alvin-Model | The model that handled the request |
X-Alvin-Task-Type | The task class Alvin assigned to the prompt |
X-Alvin-Confidence | Classification confidence, 0.00–1.00 |
The body carries the same information in a routing field alongside the standard OpenAI response shape, so clients that can't read headers still get it.
alvin is a virtual model — it appears in GET /v1/models but has no provider of its own. Requests for any other model ID bypass routing and go straight to that model.
Related
- AI Chat overview — using the chat interface
- Model Hub — browse available models
- Cost dashboard — track spend by model