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.
The full canvas, before you import it
Click any node to see its config.
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
| Route | Selection criteria | Starter model |
|---|---|---|
| fast | Bounded rewriting, extraction, summarization, and straightforward questions | gpt-4.1-mini |
| coding | Writing, debugging, reviewing, or explaining concrete code | gpt-4.1 |
| reasoning | Multi-step analysis, competing constraints, planning, and tasks that do not clearly fit the other routes | gpt-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
- Task receives the user's request.
- RouteDecision asks a Choice question about which route fits, plus a Score question about task complexity.
- 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.
- ModelSwitch executes one of FastModel, CodingModel, or ReasoningModel.
- 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
- 1Click Import → Copy JSON on this page.
- 2Open your Heym and navigate to a workflow canvas.
- 3PressCmd+V/Ctrl+V— nodes appear instantly.
- 4Add your API keys in the node config panels and click Run.
Discover more automations
- AI AgentsBatch LLM Status TrackerSend an array through the OpenAI Batch API, branch on live status updates, and collect the final per-item results.
- AI AgentsBuild Your First AI AgentA beginner-friendly interactive AI agent with conversation memory — type a message and get context-aware replies.
- AI AgentsBlind Eval TrioThree cross-lab agents evaluate any decision blind: steelman defends, stress_test attacks, gap_finder finds what's missing. No synthesizer — you integrate.
- AI AgentsAI Research Brief Supabase ArchiveTurn research notes into a structured AI brief and save the finished Markdown in Supabase.
- AI AgentsAnime Multi-Source Research BriefBuild a spoiler-aware anime research brief from Jikan profile, character, and review endpoints with deliberate rate-limit waits.
- AI AgentsDecision Model Agent Tool GateLet an agent call a Decision Model as a tool to decide whether a live GitHub status lookup is needed, then fetch only when the answer is yes.
- AI AgentsRAG Knowledge Base Poisoning SentinelReview newly ingested knowledge chunks for instruction injection, provenance gaps, and suspicious content before retrieval.
- Dev & IT OpsHTML Status PageCheck an upstream service and answer a browser GET with a rendered status page instead of JSON.
- Dev & IT OpsWorkflow Change Audit LogCapture every workflow create, update, and delete on your Heym instance and post a batched summary to Slack.
- Customer SupportHITL Support Reply AgentDraft a customer-facing support response, pause for human approval, then continue with the reviewed reply.
- Dev & IT OpsCodex PR Fix AgentSend a coding task to Codex, open a draft PR when it succeeds, and notify Slack when Codex needs follow-up input.
- Dev & IT OpsOpenCode Go PR Fix AgentSend a coding task to OpenCode Go, open a review-ready pull request, and return the implementation result.