Open Source · MIT License
Save up to 80% on AI agent costs

Put your AI agents on a diet

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.

01 npm install -g diet-ai
02 diet init

That’s it. Your agents start saving money immediately.

2
tools with auto routing
2
commands to install
0
proxies or middleware

Automatic routing where it works.
Coming soon everywhere else.

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.

GitHub Copilot icon
GitHub Copilot
AGENTS.md
auto routing
OpenAI Codex icon
OpenAI Codex
AGENTS.md
auto routing
Claude Code icon
Claude Code
CLAUDE.md
coming soon
Cursor icon
Cursor
.cursorrules
coming soon

The agent is the router.
Not a regex. Not a proxy.

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.”

1

Scan

Detects your tools — AGENTS.md, CLAUDE.md, .cursorrules and more.

2

Set the diet

Writes a .diet.yaml policy — fast / standard / premium tiers with cost guidance and example patterns.

3

Teach the agent

Injects the policy into your agent’s config. The agent reads it, understands the rules, and picks the right model when spawning sub-tasks.

4

Track

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.

.diet.yaml
# 🥗 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

Your AI models are eating
your budget alive

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
diet-ai

Your agents are hungry.
Time to put them on a diet.

Free. Open source. Two commands.

⭐ Star on GitHub
npm install -g diet-ai
diet init