knowledge-base/wiki/tools/model-routing.md
Hector 8f676acfa7 ingest(youtube): Matthew Berman - 90% less AI costs via Model Routing
- raw: raw/youtube/2026-07-07_berman-model-routing.md
- wiki/tools/model-routing.md (new) — Cost-saving routing patterns
- wiki/architecture/model-routing.md (update) — Berman patterns section
- wiki/index.md — 67. Update with new tool + architecture update
- wiki/log.md — changelog entry
2026-07-07 10:31:37 +02:00

68 lines
No EOL
3.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
created: 2026-07-07
updated: 2026-07-07
sources: [youtube/2026-07-07_berman-model-routing.md]
tags: [tools, model-routing, cost-optimization, routing-patterns, fable, planning-execution-split, cross-model-calling, not-diamond, cursor-auto-mode, copy-paste-routing, coinbase, glm-5.2, gpt-5.5]
---
# Model Routing — Cost-Saving Patterns
> **Source:** Matthew Berman — "You NEED to do this right now..." (2026-07-06)
> See raw: [[../../raw/youtube/2026-07-07_berman-model-routing.md]]
## Core Principle
**Route every task to the cheapest model that can handle it well.** The single most impactful pattern is **planning vs. execution separation**: use frontier models for architecture/spec design, then delegate code execution to cheaper models.
## Cost Comparison
| Model | Input Cost / M Tokens | Output Cost / M Tokens | Role |
|-------|----------------------|-----------------------|------|
| **Fable 5** (Anthropic) | $10 | $50 | Planning, Architecture, Specs |
| **GPT 5.5** | $2 | $6 | Code execution |
| **Composer 2.5** | $2 | $6 | Code execution |
| **Claude Sonnet** (mid) | $3 | $15 | Code execution |
| **GLM 5.2** (Z.ai) | ~$0.08 | ~$0.08 | Open-source execution layer |
**Example:** Fable-only = $9.50 baseline → Fable + GPT 5.5 routing = **$6.48 (68% savings)**. Total potential with aggressive routing: **>90%**.
## Routing Patterns
### 1. Manual Copy-Paste (~60% savings)
Developer manually copies code between models. No automation. Works as a proof-of-concept but doesn't scale.
### 2. Cross-Model-Calling (~70% savings)
One model calls another via API. A script/program orchestrates: Fable designs → API passes spec to GPT 5.5/GLM 5.2 → execution model writes code.
### 3. Cursor Auto Mode (~75% savings)
Cursor IDE's auto-mode feature routes tasks to the cheapest capable model automatically. Seamless developer experience.
### 4. Not Diamond (~80% savings)
Dedicated routing layer/API that classifies incoming requests and routes to the optimal model. Adds a routing decision layer between user and model.
### 5. OpenClaw Smart Model Router (see Skill)
[OpenClaw Smart Model Router skill] — Tier-based routing (5 tiers from simple to frontier). Claims 60-90% savings aligned with Berman's findings.
## Enterprise Adoption
**Coinbase** is implementing model routing on **open-source models, specifically GLM 5.2** (Z.ai). This validates:
- The routing pattern is production-grade, not experimental
- Chinese open-weight models (GLM 5.2) are viable as the cost-effective execution layer
- Enterprise security/compliance requirements can be met with routed open-source models
## Key Rules
1. **Separate planning from execution** — Fable designs the architecture, cheap models write the code
2. **Bounded specs produce reliable cheap execution** — when the spec is tight, cheap models stay on track
3. **Output tokens are the cost driver** — frontier models charge $50/M output vs $6/M for cheap models
4. **The pattern is simple** — the hard part is building the discipline and the harness
## Connection to Existing Wiki
- **[[../architecture/model-routing.md]]** — OpenClaw's existing routing architecture (Two-Model-Pipeline, Fallback-Chain, GLM 5.2 support)
- **[[../concepts/llm/chinese-model-cost-routing.md]]** — DeRonin's 87% cost-cut playbook (6 Western→Chinese swaps) complements Berman's patterns with field data
- **[[../concepts/llm/coding-benchmark-price-performance.md]]** — atomic.chat benchmark: GLM 5.2 is B+ at $0.08 vs Fable 5 A+ at $3.12 (39× cheaper)
- **[[../concepts/llm/glm-5.2-zai-coding-model.md]]** — Full GLM 5.2 documentation (1M context, MIT license, coding strength)
- **[[../concepts/llm/fable-5-anthropic.md]]** — Fable 5 documentation (premium frontier)
- **[[../concepts/agents/subconscious-agent.md]]** — OpenClaw's agent orchestration that could benefit from routing
- **[[../concepts/llm/llm-model-fusion-ensembles.md]]** — Alternative pattern: parallel model panels instead of sequential routing