Axiomancer

Optimize findings

Static analysis over recent RouteShift traffic that surfaces actionable LLM cost leaks — prompt rewrites, model swaps, and caching wins ranked by savings.

The Optimize page runs a recurring pass over the last 7 days of request_logs and produces concrete findings — each with an estimated monthly $ impact and a one-click fix path.

Rendering diagram…
Optimization scan pipeline: the analyzer walks trailing request logs, classifies patterns into finding types, estimates monthly $ impact from the LiteLLM price catalog, and ranks findings by projected savings.

Finding types

FindingWhat it detectsTypical fix
Oversized system promptSystem prompts above a per-model size threshold that don't measurably improve output quality.Trim the prompt or cache the system block.
Duplicate requestsIdentical or near-identical prompts repeated within a short window from the same key.Add idempotency or a client-side cache.
Model mismatchTasks classified as chat running on frontier models, or agentic running on small models.Re-route via a rule.
Underused budgetKeys with monthly budgets that haven't been touched in 30+ days.Lower the budget or revoke.
Stuck in retry loopSessions with retry rate > 50% on the same model.Compare against a stronger model in /models/compare.

How findings are classified

The analyzer uses a combination of structural and statistical signals:

  • Oversized prompt — flags requests where the system prompt exceeds the model-specific token threshold (e.g. 4,000 tokens for gpt-4o-mini, 8,000 for gpt-4o) and the response quality metrics (completion length, stop reason) don't correlate with the prompt size. A 12,000-token system prompt that produces the same output as a 2,000-token version is a trim candidate.
  • Duplicate requests — hashes the prompt content (system + user messages) and flags clusters of 3+ identical hashes within a 60-second window from the same virtual key. Near-duplicates (Jaccard similarity > 0.95 on the message array) are also flagged.
  • Model mismatch — classifies each request's task type from the message structure (single-turn chat, multi-turn conversation, tool-use/agentic, code generation) and compares against the model's intended use case. A single-turn "what's the capital of France?" running on o3 is a mismatch.
  • Stuck in retry — tracks per-session retry rates and flags sessions where more than half the attempts hit the same model with the same error class (typically 429 or 500).

How estimates are calculated

Each finding ships with a projected monthly $ savings, computed from:

  • The volume of matching requests in the last 7 days.
  • The cost delta between the current model and the suggested target (priced from the LiteLLM catalog).
  • A 30-day projection assuming current traffic patterns hold.

Estimates are conservative — RouteShift floors negatives to zero and ignores findings under $1/month so the page only surfaces work worth doing.

Acting on a finding

Each card has an Apply fix button that drops you into the right surface:

  • Oversized prompt → links to the offending requests so you can see which prompt template needs trimming.
  • Duplicate requests → opens the rule editor pre-filled to add a deduplication tag.
  • Model mismatch → opens /models/compare with both models pre-selected, then opens a rule draft.
  • Stuck in retry → same as model mismatch.

Findings auto-resolve when the underlying behavior disappears from the trailing 7-day window.

Best practices

Check the Optimize page weekly — most findings compound. A $12/month oversized-prompt finding that goes unfixed for a quarter is $36 of wasted spend, and the prompt bloat tends to grow as teams append instructions.

  • Start with the highest-$ finding. The page ranks by projected savings, so the top card is always the best ROI.
  • Fix model mismatches with rules, not client changes. A routing rule that re-maps chat tasks from o3 to gpt-4o-mini fixes every affected key at once — no client deploy needed.
  • Pair with budgets. After fixing findings, set a budget on the affected keys so the same waste pattern triggers an alert if it recurs.
  • Review after deploys. New prompt templates or agent deployments are the most common source of new findings. Check Optimize after any significant prompt change.
Was this page helpful?

On this page