Model routing
Send each prompt to the cheapest model that is enough — fast, balanced or frontier — and play safe when the tier is unclear, with the Model Routing template.
Goal: stop sending every prompt to your most expensive model. A cheap decision picks the tier; your code (or an LLM destination) calls that model.
Create the decision
Templates → Model routing → Create decision:
| Part | Content |
|---|---|
| State | prompt (string, required) |
tier | choice — fast, balanced, frontier, other; minimum confidence 0.6 |
complexity | score — trivial, simple, moderate, hard, very hard |
| Policies | none; fallback action fallback |
| Destinations | function callModel with prompt and model = fast / balanced / frontier per tier; frontier_when_unsure on fallback |
Call it
curl -X POST https://api.dcision.io/v1/decisions/model-routing \
-H "Authorization: Bearer $DCISION_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "state": { "prompt": "Translate '"'"'good morning, how are you?'"'"' to Spanish." } }'The state's prompt is "Translate 'good morning, how are you?' to Spanish.".
{
"schema": "model-routing",
"result": { "tier": "fast", "complexity": "trivial" },
"confidence": { "tier": 0.91, "complexity": 0.88 },
"action": "continue",
"destinations": [{ "key": "fast_model", "type": "function", "function": "callModel", "params": { "prompt": "Translate 'good morning, how are you?' to Spanish.", "model": "fast" } }]
}Act on it
const MODELS = { fast: "openai/gpt-5-nano", balanced: "openai/gpt-5-mini", frontier: "anthropic/claude-opus-5-5" };
const call = decision.destinations.find((d) => d.function === "callModel");
return callModel(call.params.prompt, MODELS[call.params.model]);Tune it
- Let Dcision call the model: replace each function with an LLM destination on your OpenRouter or Vercel AI Gateway key — the answer comes back in the same response.
- Describe your tiers in the option descriptions with examples from your own traffic.
- Watch the Overview: if many prompts land in
fallback, sharpen the options before raising the threshold.
Input guardrail
Check whether a user prompt is safe to pass on to your LLM, and answer unsafe ones with a fixed reply and no model call, with the Input Guardrail template.
Document reranking
Score how well each retrieved document answers the query, sort candidates by a 0–1 rerank score and drop the irrelevant ones, with the Document Reranking template.