high
Top-tier models only. Use for planners, complex reasoning, novel code.
X-Frugal-Quality: high
Frugal wraps any command with a local OpenAI-compatible proxy, classifies each request, and routes to the cheapest model that clears the quality bar. No account. No code changes. One command.
$ curl -fsSL https://frugal.sh/install | sh
$ frugal python my_app.py
# frugal starts a proxy, sets OPENAI_BASE_URL, runs your command,
# and shuts down when it exits. Your app doesn't change.
You're paying for capability you don't use on 60–80% of your LLM calls.
A creative brainstorm doesn't need o3. A simple extraction doesn't need
claude-opus. Frugal classifies each request — complexity, domain,
capabilities required — and picks the cheapest model that clears the quality bar.
frugal python app.py
│
├─ starts proxy on a free port
├─ injects OPENAI_BASE_URL into your command's environment
├─ classifies each request (complexity, domain, capabilities)
├─ routes to cheapest model that clears the quality bar
└─ shuts down proxy when your command exits
Frugal speaks the OpenAI chat-completions API. Point your existing SDK at the proxy and nothing else changes.
# unchanged from before frugal
from openai import OpenAI
client = OpenAI()
resp = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "hi"}],
)
// unchanged from before frugal
import OpenAI from "openai";
const client = new OpenAI();
const resp = await client.chat.completions.create({
model: "auto",
messages: [{ role: "user", content: "hi" }],
});
curl "$OPENAI_BASE_URL/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{"model":"auto","messages":[{"role":"user","content":"hi"}]}'
client := openai.NewClient(os.Getenv("OPENAI_API_KEY"))
resp, _ := client.CreateChatCompletion(ctx, openai.ChatCompletionRequest{
Model: "auto",
Messages: []openai.ChatCompletionMessage{{
Role: openai.ChatMessageRoleUser, Content: "hi",
}},
})
Send X-Frugal-Quality: cost for a quick extraction.
Send high for your agent's planner step. Default balanced for everything else.
Top-tier models only. Use for planners, complex reasoning, novel code.
X-Frugal-Quality: high
Best cost-quality tradeoff. The right choice 80% of the time.
X-Frugal-Quality: balanced
Cheapest viable model. Classification, extraction, simple summaries.
X-Frugal-Quality: cost
Pricing synced from models.dev on every startup.
Add more by editing ~/.frugal/config/models.yaml.
GPT-4o · GPT-4o-mini · GPT-4.1 · GPT-4.1-mini · GPT-4.1-nano
Claude Opus 4 · Claude Sonnet 4 · Claude Haiku 3.5
Gemini 2.5 Pro · Gemini 2.5 Flash · Gemini 2.0 Flash
One binary, ~10 MB. Detects your API keys. Adds frugal to
your PATH. Release artifacts are signed with cosign; the installer
verifies the checksum before moving the binary into place.
$ curl -fsSL https://frugal.sh/install | sh
$ git clone https://github.com/brainsparker/frugal.git && cd frugal && make build
$ export FRUGAL_AUTH_TOKEN=$(openssl rand -hex 16)
$ frugal serve
$ export OPENAI_BASE_URL=http://localhost:8080/v1
When binding outside 127.0.0.1, Frugal refuses to start without an
auth token (override with FRUGAL_ALLOW_UNAUTH=1). Prometheus metrics
are served at /metrics. Full env-var reference in the
README.
cosign is present, the signature
before executing anything.X-Request-ID propagation, Prometheus
/metrics, and /v1/routing/explain to see exactly
which model was picked and why.