Morph Model Router
morph_model_router · Nodes · AI
Routes prompts through Morph classify or multimodel selection.
Morph Model Router#
Classifies prompt difficulty or intent with Morph, then returns routing data for workflow branching or model selection. Use it before expensive AI calls when the workflow needs a low-cost decision about where a prompt should go.
Configuration#
Connection - Morph connection id. Use list_connections; pass the returned ULID id, not the connection name.
Mode - classify or multimodel.
Classes - Intent classes for classify mode. Each item has:
{
"label": "coding",
"description": "Requests involving code edits or repository analysis",
"threshold": 0.8
}
Policy - Multimodel routing policy: balanced or cost_efficient.
Default model - Fallback model for multimodel mode:
{
"provider_name": "openai",
"model_id": "gpt-4.1-mini"
}
Allowed providers / allowed models - Limits the model choices Morph can return in multimodel mode.
Inputs & Outputs#
Input: canonical input.
Accepted shapes:
"Prompt text"
{ "prompt": "Prompt text" }
Output: canonical output.
Classify Output#
{
"mode": "classify",
"classifications": [
{ "label": "coding", "score": 0.91 }
]
}
label: one of the configured class labels.score: Morph confidence for that class.
Use classify when the workflow branches by intent, task type, or difficulty bucket.
Multimodel Output#
{
"mode": "multimodel",
"provider_name": "openai",
"model_id": "gpt-4.1-mini",
"difficulty": "easy",
"confidence": 0.9
}
provider_name: model provider to use.model_id: model identifier to call.difficulty: Morph's prompt difficulty classification.confidence: confidence in the selected route.
Use multimodel when the next AI node should choose between cheaper and stronger model tiers.
Example#
[Prompt]
↓
[Morph Model Router: multimodel]
↓ output.provider_name / output.model_id
[AI Agent]
Inputs
inputRequired
Outputs
output
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
connection | connection(morph) | Yes | Morph connection used by the router |
mode | enum(classify, multimodel) | No | Router mode |
classes | array<record> | No | Classes used by classify mode |
policy | enum(balanced, cost_efficient) | No | Multimodel routing policy |
default_model | nullable<record> | No | Default model used by multimodel mode |
allowed_providers | array<string> | No | Provider names allowed for multimodel routing |
allowed_models | array<record> | No | Provider/model identities allowed for multimodel routing |
base_config | record | No | Shared node configuration. failure_mode decides what a failure of this node does to the workflow; leave it at the default stop unless the workflow handles the failure itself on the node's error output (route_to_error) or the node is a rare emergency kill switch (stop_workflow). |