Mullet
An AI coding orchestrator that sends each task to the cheapest model that can handle it, from a free local model up to Claude, and plugs into Claude Code over MCP.
Mullet takes work off an AI coding tool. Claude Code, or any other tool that speaks the Model Context Protocol (MCP), can hand it a task, and Mullet sends the task to the cheapest model that can handle it: a model running locally in LM Studio or Ollama, Kimi, a model on OpenRouter, Gemini, or Claude. The point is to keep the expensive model’s allowance for the work that needs it, and send routine work somewhere cheaper or free.
Mullet is paused rather than finished. I still run it for its knowledge search, but I’ve turned delegation off: a larger Anthropic subscription turned out quicker than handing work to other models. If Anthropic’s prices rise, I’ll switch it back on and send most of the work to cheaper models through Kimi and OpenRouter, which is what it was built for. The public copy is the code as of October 2026, with its licence, packaging and CI fixed for publishing, and its tests pass. Its model list and prices date from then too, and they go out of date quickly.
What it does
- Scores each task before it picks a model. Keywords, the number of subtasks, how much of the system the task touches and whether it needs tests add up to a score out of 100, which puts the task in a tier: LOW, STANDARD, ADVANCED or CRITICAL.
mullet explainshows the working without calling a model. - Watches the budget. It reads how much of a Claude subscription’s five-hour and weekly allowance has gone, weighed against how far through each window you are, and as that pressure rises it moves work away from Claude to providers such as OpenRouter and Kimi. In the last version, its Claude Code hooks only suggest delegating when the allowance is close to running out, and ask for a go-ahead before anything goes to a paid provider.
- Edits files through opencode, an open-source coding agent, and then checks what it did. The list of changed files comes from
git status, not from the model’s report, and a classifier with no model behind it flags edits that often mean trouble. Checking a delegate’s edits before trusting them explains how. - Splits a goal across many parallel Kimi calls and merges the answers, and has longer-running modes that break a task up, work through it and check the result, repeating until every user story passes, up to ten times.
- Searches your own documents and code. Its knowledge engine, Trawl, grew out of Trove: it indexes collections called pools, searches them by keyword and by meaning together, re-ranks the results and can build a knowledge graph.
- Limits which providers it may use with presets. Four are built in: balanced-mix, local-only, claude-only and cheap-cloud.
- Serves an OpenAI-compatible API through
mullet serve, with chat completions, a model list, a health check and Prometheus metrics.
The MCP server has 10 Mullet tools and 43 knowledge tools. mullet_run sends a task to a model with no access to files, mullet_opencode makes edits, mullet_swarm fans a goal out, and mullet_search searches a pool.
How it’s built
Mullet is written in Python and needs Python 3.10 or later. One client covers the OpenAI-compatible APIs of LM Studio, Ollama, vLLM, OpenRouter and OpenAI. Kimi, Anthropic, Gemini and AWS Bedrock have clients of their own, and the Claude and Gemini command-line tools can stand in for an API key.
Routing has three stages. A preflight step estimates how much a task will read and write and how hard it is, asking a local model first, then Gemini Flash, and falling back to heuristics; each estimate is cached for seven days. A routing matrix then picks the cheapest model that can take that input and output at that complexity, and a fallback chain takes over if the model isn’t available. Local models are classified from their names, by parameter count and by whether they’re built for code, vision or reasoning, so routing works with whatever is loaded in LM Studio. Size estimates get a 10% margin before they’re compared with a model’s context window.
The knowledge engine uses ChromaDB for vectors, sentence-transformers for embeddings and re-ranking, rank-bm25 for keyword search, tree-sitter for code and NetworkX for the graph. Sessions are saved as JSON, with a SQLite full-text index for searching past conversations. A redactor masks API keys and tokens in logs and in previews of tool output, and a page added to a pool by URL can’t point at localhost or a private network.
There are more than 17,700 tests, written with pytest. GitHub Actions runs them on Python 3.10, 3.11 and 3.12, with ruff checking for errors.
Mullet is source-available under the Business Source License 1.1. One developer can use it in production, free, for their own work on one running instance, but not offer it to anyone else as a hosted or shared service. Each version becomes Apache 2.0 on 3 April 2030, or four years after its first public release if that comes sooner.
How to use it
git clone https://github.com/tomgould/mullet-public.git
cd mullet-public
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
mullet doctor
mullet explain "add a retry with exponential backoff to the HTTP client"
mullet doctor checks the install and says which providers it can reach. For cloud models, copy .env.example to .env and add the keys you have. Without any, it can still use a local model in LM Studio or Ollama.
mullet setup-claude connects it to Claude Code. Read what it does first: it registers the MCP servers, installs hooks that run in every project, adds delegation rules to ~/.claude/CLAUDE.md and installs opencode.