Why we built Nadir: the $0.45 docstring problem

We were paying Claude Opus prices for 'write a docstring'. That's when we decided to build an intelligent router that sends simple prompts to cheaper models.

Published 2026-03-15 by Dor Amir on the Nadir blog.

Filed under Nadir & Alternatives.

The $0.45 docstring

Last year I was using Claude Opus for a coding project. Great model. But then I looked at my API bill and noticed something: a significant chunk of my spend was on prompts like:

These prompts were hitting Opus at $15/1M input tokens. They could have been handled by Haiku at $0.80/1M or Gemini Flash at $0.075/1M. Same quality output, 20-200x cheaper.

The manual approach doesn't work

I tried switching models manually. The problem: you don't know the complexity of a prompt until you've read it. And in agentic workflows (Claude Code, Cursor, Aider), the model is called hundreds of times automatically. You can't manually pick the model for each call.

What we built

Nadir sits between your app and the LLM providers. It classifies each prompt in ~50ms using a DistilBERT-based classifier, then routes to the cheapest model that can handle it:

The classifier runs locally. Your API keys never leave your machine. No third-party proxy.

Why source-available

We're PolyForm Noncommercial licensed because we think model routing should be infrastructure, not a service that can pull the plug on you. Self-host it, fork it, contribute to it. If you want a hosted version with extra features, that's what the Pro plan is for.

More on nadir & alternatives

Pages on this site

Machine-readable summaries of this site: llms.txt and llms-full.txt.