FeaturedAI Agents#Decision Model#Model Router#Choice#Score#LLM

Decision Model Smart Model Router

Match each request to a fast, coding, or reasoning model with a Decision Model, then execute only the selected LLM branch and return its answer.

Workflow at a glance

The full canvas, before you import it

Click any node to see its config.

#Decision Model#Model Router#Choice#Score#LLM

Click a node to select it — same as the Heym editor; the panel shows its settings.

10 nodes · Free & source-available

Decision Model Smart Model Router

A short rewrite, a code patch, and a multi-step planning problem do not need the same model configuration. This template uses a Decision Model to choose a route from the task itself, then actually runs the selected LLM. It returns both the answer and the route that produced it.

How the router chooses

RouteSelection criteriaStarter model
fastBounded rewriting, extraction, summarization, and straightforward questionsgpt-4.1-mini
codingWriting, debugging, reviewing, or explaining concrete codegpt-4.1
reasoningMulti-step analysis, competing constraints, planning, and tasks that do not clearly fit the other routesgpt-5-mini

These are editable starter configurations, not a live price comparison or a guarantee of the best model. The examples use GPT-4.1 mini, GPT-4.1, and GPT-5 mini. Choose models available on your own endpoint and revise the criteria when their intended roles change.

What this workflow does

  1. Task receives the user's request.
  2. RouteDecision asks a Choice question about which route fits, plus a Score question about task complexity.
  3. SelectRoute uses the proposed route when confidence is at least 0.65. Lower-confidence requests and complexity scores of at least 2.5 go to the reasoning route.
  4. ModelSwitch executes one of FastModel, CodingModel, or ReasoningModel.
  5. That branch returns the answer, selected model, proposed route, confidence, and complexity. Other LLM branches are skipped.

Setup

Select a Decision Model credential on RouteDecision. Select an LLM credential on each of the three LLM nodes; they can share one credential if its endpoint serves all three models. The reasoning branch has reasoning mode enabled. If you replace it with a non-reasoning model, update that setting too.

Try the routes

  • Fast: "Rewrite this sentence more politely: Send the report today."
  • Coding: "Write a Python function that removes duplicate strings while preserving their order."
  • Reasoning: "Plan a database migration with a five-minute maintenance window, a reversible rollout, and three services that cannot all restart together. Explain the tradeoffs."

The default input is the migration task. Model probabilities vary, and a sufficiently complex coding request can be sent to reasoning by the complexity override. Adjust the 0.65 confidence and 2.5 complexity thresholds against your own task set.

Inspecting the result

Each terminal node is a JSON output mapper with the same fields: answer, selected_model, selected_route, proposed_route, route_confidence, and complexity. One successful run makes a routing decision call and a call to the selected LLM. There is no automatic provider failover in this example.

How to import this template

  1. 1Click Import → Copy JSON on this page.
  2. 2Open your Heym and navigate to a workflow canvas.
  3. 3PressCmd+V/Ctrl+V— nodes appear instantly.
  4. 4Add your API keys in the node config panels and click Run.
More workflow templates
View all templates
Heym
incident analysis · production AI
Observed across 100s of AI rollouts

AI workflows don't fail because of prompts.
They fail because of orchestration.

symptom · glue code01
5 tools
Scripts, vector DB, approval bot, tracing, browser runner — none of them talk.
symptom · visibility02
~0%
Observable behavior across the stack. Debugging is guesswork.
with heym · one runtime
1 canvas
Agents, RAG, HITL, MCP, traces & evals. Self-hosted. Observable.
AI-Native RuntimeProduction-Grade
github.com/heymrun/heym