Skip to main content
This tutorial assigns different models to different tasks in a single workflow — a cheap, fast model for the spec, a capable model for coding, and a different model for review. The routing is controlled by a CSS-like stylesheet.

The workflow

Multi-Model workflow: Start → Write Spec (Haiku) → Implement (Sonnet) → Write Tests (Sonnet) → Code Review (Sonnet) → Exit
multi-model.fabro

Model stylesheets

The model_stylesheet graph attribute contains CSS-like rules that assign models to nodes:

Selectors

Higher specificity wins. If two rules have the same specificity, the last one in the stylesheet wins.

How this workflow routes

Assigning classes

Set the class attribute on a node to target it with class selectors:
Multiple classes are space-separated: class="coding critical".

Properties

Stylesheets support four properties:

Why route models?

Not every task needs a frontier model:
  • Spec writing, classification, summarization — use a fast, cheap model (Haiku, Flash Lite)
  • Code implementation, complex reasoning — use a capable model (Sonnet, Opus, GPT-5.4)
  • Cross-critique — use a different provider so the reviewer brings fresh eyes
Model routing lets you optimize cost and latency without changing the workflow structure. Swap claude-haiku-4-5 to gemini-3-flash-preview in the stylesheet and the workflow behaves the same — just with a different model underneath.

Explicit overrides

A model set directly on a node attribute always beats the stylesheet:
This node uses Opus regardless of what .coding says. See Model Stylesheets for the full reference and Models for available model IDs.

What you’ve learned

  • Model stylesheets use CSS-like rules to assign models to nodes
  • Selectors match by universal (*), shape, class (.name), or ID (#name)
  • Specificity determines which rule wins when multiple match
  • Route cheap models to simple tasks and capable models to hard ones

Next

Ensemble

Fan out to multiple providers and synthesize their independent opinions.