Like a real diet — you learn the rules, but you decide what to eat.
Give your agent a cost policy. It decides which model fits each task.
That’s it. Your agents start saving money immediately.
True model routing requires sub-agent support — the ability to spin up a task on a cheaper model. Today, that’s GitHub Copilot CLI and OpenAI Codex. Others are on our roadmap.
diet-ai gives your agent a cost policy. The agent — already an LLM — semantically understands each task and picks the cheapest model that fits. No keyword matching. No middleware.
Think of it like a real diet.
You read the diet plan. You understand the rules. But you decide what to eat at each meal — not a calorie-counting app making every choice for you.
Same here. The agent reads .diet.yaml, understands the tiers, and makes its own call: “This is a file search — Haiku is fine” or “This is a security review — I need Opus.”
Detects your tools — AGENTS.md, CLAUDE.md, .cursorrules and more.
Writes a .diet.yaml policy — fast / standard / premium tiers with cost guidance and example patterns.
Injects the policy into your agent’s config. The agent reads it, understands the rules, and picks the right model when spawning sub-tasks.
Every routing decision is logged. Run diet stats to see how much you’ve saved.
Why not all tools? The agent needs the ability to delegate tasks to a different model. Copilot CLI’s task(model: "haiku") and Codex support this today. Claude Code and Cursor run a single model per session — no sub-agent routing yet. We’ll add support as soon as they ship it.
# 🥗 Generated by diet-ai profile: coding default_tier: standard tiers: fast: # $1.25 / 1M tokens models: [claude-haiku-4.5] standard: # $9.00 / 1M tokens models: [claude-sonnet-4.6] premium: # $45.00 / 1M tokens models: [claude-opus-4.6] rules: - name: simple-tasks match: keywords: [draft, email, format, recap, summary, list] agent_types: [explore, task] tier: fast - name: code-changes match: keywords: [implement, refactor, fix, debug, build] tier: standard - name: deep-analysis match: keywords: [research, architecture, security, strategy] tier: premium
Every task defaults to your most expensive model. Most of them don’t need it.
| Task | Needs | Without diet-ai | With diet-ai |
|---|---|---|---|
| Draft an email | 🟩 fast | $45 / 1M tokens | $1.25 / 1M tokens |
| Format a recap | 🟩 fast | $45 / 1M tokens | $1.25 / 1M tokens |
| Refactor a function | 🟡 standard | $45 / 1M tokens | $9.00 / 1M tokens |
| Review a PR | 🟡 standard | $45 / 1M tokens | $9.00 / 1M tokens |
| Security architecture | 🔴 premium | $45 / 1M tokens | $45 / 1M tokens |
| 100 calls/day (avg 2K tokens) — Monthly cost | ~$270 / month | ~$54 / month | |
Free. Open source. Two commands.
⭐ Star on GitHub