<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <id>https://docs.litellm.ai/blog</id>
    <title>liteLLM Blog</title>
    <updated>2026-09-01T10:00:00.000Z</updated>
    <generator>https://github.com/jpmonette/feed</generator>
    <link rel="alternate" href="https://docs.litellm.ai/blog"/>
    <subtitle>liteLLM Blog</subtitle>
    <icon>https://docs.litellm.ai/img/favicon.ico</icon>
    <entry>
        <title type="html"><![CDATA[Auto-Router: Route on Context Size and Modality]]></title>
        <id>https://docs.litellm.ai/blog/auto-router-more-routing-configurations</id>
        <link href="https://docs.litellm.ai/blog/auto-router-more-routing-configurations"/>
        <updated>2026-09-01T10:00:00.000Z</updated>
        <summary type="html"><![CDATA[The Auto-Router now supports more routing configurations: context-window escalation moves oversized prompts to the cheapest tier that fits them before dispatch, modality routing sends image requests to tiers that can see, classification can run on user turns only, and shadow evaluations can compare several router configs on a team's live traffic.]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="Auto-Router: one router, more routing signals; complexity, context size, and modality" src="https://docs.litellm.ai/assets/images/hero-f0bffd88c9f6c659db6e733b866ca5cf.png" width="2400" height="1260" class="img_ev3q"></p>
<p>The Auto-Router picks a model by asking how hard the request is. This release adds the questions that come right after: does the request fit the model we picked, and can that model even see it?</p>
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>🚀 Help shape the Auto-Router</div><div class="admonitionContent_BuS1"><p>Get early access, work directly with the LiteLLM team, and influence the roadmap with your production traffic.</p><a class="button button--primary button--lg" style="background:#2e8555;border-color:#2e8555;color:#fff" href="https://calendar.app.google/i2e7qVEJphHi5S8UA">Apply to Become a Design Partner</a><br><br><p>Already testing it? Share your results in <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>.</p></div></div>
<p>Complexity tiers don't predict routability. A trivially simple question asked 300k tokens into a coding session still can't go to a small model, and a "what's in this screenshot?" request can't go to a text-only model no matter how easy the question is. The router now checks for both before dispatch, and shadow evaluations let you prove any of these configurations on a team's live traffic before rolling it out.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="one-router-more-routing-signals">One router, more routing signals<a href="https://docs.litellm.ai/blog/auto-router-more-routing-configurations#one-router-more-routing-signals" class="hash-link" aria-label="Direct link to One router, more routing signals" title="Direct link to One router, more routing signals">​</a></h2>
<table><thead><tr><th>Routing signal</th><th>What it does</th><th>Config key</th><th>Default</th></tr></thead><tbody><tr><td><strong>Complexity</strong></td><td>Classifies the request and picks a tier</td><td><code>tiers</code></td><td>core behavior</td></tr><tr><td><strong>Context size</strong></td><td>Escalates prompts that provably don't fit the decided tier</td><td><code>enable_context_window_escalation</code></td><td><strong>on</strong></td></tr><tr><td><strong>Modality</strong></td><td>Routes image-bearing requests to vision-capable tiers</td><td><code>modality_routing</code></td><td>off, opt-in</td></tr><tr><td><strong>Turn type</strong></td><td>Classifies new user asks only, skipping continuation turns</td><td><code>classification_mode: user_turn</code></td><td><code>every_request</code></td></tr></tbody></table>
<p>Every gate reports what it did. Escalated decisions carry <code>context_escalated</code> or <code>modality_escalation</code> plus the tier the classifier originally picked, so nothing the router does is invisible.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="context-window-based-routing">Context-window based routing<a href="https://docs.litellm.ai/blog/auto-router-more-routing-configurations#context-window-based-routing" class="hash-link" aria-label="Direct link to Context-window based routing" title="Direct link to Context-window based routing">​</a></h2>
<p>The market-standard answer to "the prompt didn't fit" is reactive: send the request, catch the context-length 400, retry on a bigger model. You pay for the failed call and the latency, on every turn of a long session. When we surveyed how routing products handle this, reactive fallback was the norm; we didn't find one that filters candidates by token count before dispatch.</p>
<p>The Auto-Router now does it pre-dispatch:</p>
<ul>
<li><strong>Estimates the full prompt footprint before sending</strong>, including system prompts and tool definitions; for coding agents like Claude Code those carry most of the payload</li>
<li><strong>Escalates to the cheapest tier that provably fits.</strong> A fitting model group in the decided tier wins first, so you never pay for more model than the prompt requires</li>
<li><strong>Unknown context windows are left alone.</strong> The gate acts only when it can prove a mismatch</li>
<li><strong>Escalated decisions are never session-pinned.</strong> When the session shrinks back down, routing comes back down with it</li>
<li><strong>On by default</strong>, with a safety buffer (<code>context_window_escalation_buffer: 0.95</code>) so prompts near the limit escalate instead of gambling</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="modality-based-routing">Modality-based routing<a href="https://docs.litellm.ai/blog/auto-router-more-routing-configurations#modality-based-routing" class="hash-link" aria-label="Direct link to Modality-based routing" title="Direct link to Modality-based routing">​</a></h2>
<p>If your cheap tier is text-only and a request carries an image, the old outcome was a provider-side error after the request had already left the gateway. With <code>modality_routing: true</code>:</p>
<ul>
<li><strong>Images are detected anywhere in the request</strong>: OpenAI <code>image_url</code> and <code>input_image</code> parts, Anthropic <code>image</code> blocks, and images nested inside tool results, the shape real agent screenshots arrive in</li>
<li><strong>The router walks up to the nearest vision-capable tier</strong> from the one the classifier decided</li>
<li><strong>No tier can see? A clear 400 from the gateway</strong>, instead of a confusing provider error</li>
<li><strong>Conservative by design.</strong> Only models explicitly marked as lacking vision are excluded; unknown models stay eligible</li>
<li><strong>Opt-in</strong>, off by default</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="classify-when-it-matters">Classify when it matters<a href="https://docs.litellm.ai/blog/auto-router-more-routing-configurations#classify-when-it-matters" class="hash-link" aria-label="Direct link to Classify when it matters" title="Direct link to Classify when it matters">​</a></h2>
<p>Agentic sessions fire many requests per conversation, and most of them (tool results, follow-ups, retries) aren't new questions. With <code>classification_mode: user_turn</code>, the classifier runs only when the newest message is an actual new user ask, and the standing decision carries the continuation turns. Fewer classifier calls, less routing overhead, and steadier model selection mid-task.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="shadow-evaluate-it-on-a-team-before-anyone-notices">Shadow-evaluate it on a team, before anyone notices<a href="https://docs.litellm.ai/blog/auto-router-more-routing-configurations#shadow-evaluate-it-on-a-team-before-anyone-notices" class="hash-link" aria-label="Direct link to Shadow-evaluate it on a team, before anyone notices" title="Direct link to Shadow-evaluate it on a team, before anyone notices">​</a></h2>
<p><a href="https://docs.litellm.ai/blog/auto-router-shadow-evaluations">Shadow evaluations</a> test the Auto-Router against your live traffic without changing a single user-facing response. Here's what you can do with them now:</p>
<ul>
<li><strong>Target a <code>key</code>, a <code>team</code>, or a <code>user</code>.</strong> JWT-authenticated traffic has no virtual key to point at; team and user targeting makes it evaluable for the first time</li>
<li><strong>Compare several router configs in one job</strong>, against the same sampled traffic</li>
<li><strong>Trust the comparison: sampling is paired.</strong> Every config sees the identical request, so quality and cost differences come from the config, never traffic luck</li>
</ul>
<p>That closes the loop on everything above: draft a config with the new gates on, shadow it against your current router on a real team's traffic, read the paired comparison, promote the winner.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="turning-it-on">Turning it on<a href="https://docs.litellm.ai/blog/auto-router-more-routing-configurations#turning-it-on" class="hash-link" aria-label="Direct link to Turning it on" title="Direct link to Turning it on">​</a></h2>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> openai/gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/OPENAI_API_KEY</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> openai/gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/OPENAI_API_KEY</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5.5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> openai/gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5.5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/OPENAI_API_KEY</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> smart</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> auto_router/complexity_router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">tiers</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">SIMPLE</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">MEDIUM</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">COMPLEX</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">   claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">REASONING</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5.5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token comment" style="color:rgb(0, 128, 0)"># on by default: escalate prompts that provably don't fit</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">enable_context_window_escalation</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">context_window_escalation_buffer</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(9, 134, 88)">0.95</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token comment" style="color:rgb(0, 128, 0)"># opt-in: route image requests to vision-capable tiers</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">modality_routing</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token comment" style="color:rgb(0, 128, 0)"># classify new user asks, carry the decision through continuation turns</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classification_mode</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> user_turn</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_default_model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><br></span></code></pre></div></div>
<p>Context-window escalation is already on; long sessions just stop failing. Modality routing is one line. Both show up in the routing decision, so you can watch exactly when and why each gate fired.</p>
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Try it on your traffic</div><div class="admonitionContent_BuS1"><p>Point a shadow-eval job at your busiest team, compare your current config against one with the new gates on, and tell us what you see in <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>, or</p><a class="button button--primary button--lg" style="background:#2e8555;border-color:#2e8555;color:#fff" href="https://calendar.app.google/i2e7qVEJphHi5S8UA">Apply to Become a Design Partner</a></div></div>]]></content>
        <author>
            <name>Tin Lo</name>
        </author>
        <category label="routing" term="routing"/>
        <category label="complexity-router" term="complexity-router"/>
        <category label="engineering" term="engineering"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Day 0 Support: Claude Fable 5.1]]></title>
        <id>https://docs.litellm.ai/blog/claude_fable_5_1</id>
        <link href="https://docs.litellm.ai/blog/claude_fable_5_1"/>
        <updated>2026-09-01T10:00:00.000Z</updated>
        <summary type="html"><![CDATA[Day 0 support for Claude Fable 5.1 on the LiteLLM AI Gateway, with the 0.025x cache read price tracked from the first call.]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="LiteLLM x Claude Fable 5.1" src="https://docs.litellm.ai/assets/images/litellm_claude_fable_5_1_announcement-dd783c4bc96339d15895dc7e5d9275fc.png" width="4800" height="2508" class="img_ev3q"></p>
<p>LiteLLM supports <a href="https://www.anthropic.com/claude-fable-and-mythos-5-1" target="_blank" rel="noopener noreferrer">Claude Fable 5.1</a> on Day 0 across Anthropic, Bedrock, Gemini Enterprise Agent Platform, and Azure, with spend, rate limits, fallbacks, and logging in one place.</p>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="whats-new-in-fable-51">What's new in Fable 5.1<a href="https://docs.litellm.ai/blog/claude_fable_5_1#whats-new-in-fable-51" class="hash-link" aria-label="Direct link to What's new in Fable 5.1" title="Direct link to What's new in Fable 5.1">​</a></h2>
<p>Pricing, the 1M-token context window, the 128K output ceiling, and always-on adaptive thinking carry over from Fable 5. What changed, in the order it costs a gateway work:</p>
<ul>
<li><strong>Cache reads cost $0.25 / MTok, down from $1.00.</strong> That is 0.025x base input, where every other Claude model sits at 0.1x. LiteLLM reads the rate from the cost map and falls back to base input without it, a 40x overcount.</li>
<li><strong>Forced tool use returns a 400.</strong> Thinking is always on, and a forced call would skip it. LiteLLM maps OpenAI's <code>tool_choice: "required"</code> to Anthropic's <code>any</code>, so a request that worked on Fable 5 fails here unchanged. Keep <code>auto</code> with <code>strict: true</code> for schema-valid JSON, or name the tool in the prompt to force a call.</li>
<li><strong>Thinking blocks are bound to the model that wrote them.</strong> Fable 5.1 reads earlier models' blocks; none of them read its own.</li>
<li><strong>Editing earlier turns invalidates thinking blocks.</strong> Rebuilding <code>system</code> or <code>tools</code> mid-conversation errors with <code>The block is bound to a different conversation</code>, on accounts created from August 31, 2026.</li>
<li><strong>Effort is steerable per message</strong> behind the <code>mid-conversation-output-config-2026-07-01</code> beta header, without invalidating the prompt cache.</li>
</ul>
<p>Anthropic's <a href="https://platform.claude.com/docs/en/models/fable-5-1/whats-new-fable-5-1" target="_blank" rel="noopener noreferrer">what's new page</a> has the benchmarks and capability gains.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="usage">Usage<a href="https://docs.litellm.ai/blog/claude_fable_5_1#usage" class="hash-link" aria-label="Direct link to Usage" title="Direct link to Usage">​</a></h2>
<div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Anthropic</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Bedrock</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Gemini Enterprise Agent Platform</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Azure</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">fable</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">fable</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">fable</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> bedrock/converse/us.anthropic.claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">fable</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">aws_access_key_id</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/AWS_ACCESS_KEY_ID</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">aws_secret_access_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/AWS_SECRET_ACCESS_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">aws_region_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> us</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">east</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">1</span><br></span></code></pre></div></div><p>Bedrock serves it through inference profiles. <code>us.</code> and <code>eu.</code> carry the 10% regional premium, <code>global.</code> stays at base.</p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">fable</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> vertex_ai/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">fable</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">vertex_project</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/VERTEX_PROJECT</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">vertex_location</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> global</span><br></span></code></pre></div></div><p>Google renamed Vertex AI to Gemini Enterprise Agent Platform; the LiteLLM prefix is still <code>vertex_ai/</code>. Pinned regions carry a 10% premium over global, which LiteLLM applies.</p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">fable</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> azure_ai/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">fable</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/AZURE_AI_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_base</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/AZURE_AI_API_BASE  </span><span class="token comment" style="color:rgb(0, 128, 0)"># https://&lt;resource&gt;.services.ai.azure.com</span><br></span></code></pre></div></div></div></div></div>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">curl --location 'http://0.0.0.0:4000/chat/completions' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">--header 'Content-Type: application/json' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">--header 'Authorization: Bearer $LITELLM_KEY' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">--data '{</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  "model": "claude-fable-5-1",</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  "messages": [{"role": "user", "content": "what llm are you"}],</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  "reasoning_effort": "xhigh"</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">}'</span><br></span></code></pre></div></div>
<p><code>reasoning_effort</code> maps to adaptive thinking, the only mode Fable 5.1 accepts. Fixed budgets, assistant prefill, and non-default <code>temperature</code> or <code>top_p</code> return a 400. Pass <code>output_config: {"effort": "max"}</code> for the full ladder <a href="https://docs.litellm.ai/blog/claude_fable_5">Fable 5 uses</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="feedback">Feedback<a href="https://docs.litellm.ai/blog/claude_fable_5_1#feedback" class="hash-link" aria-label="Direct link to Feedback" title="Direct link to Feedback">​</a></h2>
<p>Hitting something unexpected? Share it on <a href="https://github.com/BerriAI/litellm/discussions/39163" target="_blank" rel="noopener noreferrer">GitHub discussion #39163</a>.</p>]]></content>
        <author>
            <name>Misbah Syed</name>
            <uri>https://github.com/misbahsy</uri>
        </author>
        <author>
            <name>Mateo Wang</name>
            <uri>https://www.linkedin.com/in/mateo-wang</uri>
        </author>
        <author>
            <name>Krrish Dholakia</name>
            <uri>https://www.linkedin.com/in/krish-d/</uri>
        </author>
        <author>
            <name>Ishaan Jaffer</name>
            <uri>https://www.linkedin.com/in/reffajnaahsi/</uri>
        </author>
        <category label="anthropic" term="anthropic"/>
        <category label="claude" term="claude"/>
        <category label="fable 5.1" term="fable 5.1"/>
        <category label="day 0 support" term="day 0 support"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[August Townhall Updates: Security, Stability, and Product]]></title>
        <id>https://docs.litellm.ai/blog/august-townhall-updates</id>
        <link href="https://docs.litellm.ai/blog/august-townhall-updates"/>
        <updated>2026-08-27T12:00:00.000Z</updated>
        <summary type="html"><![CDATA[A recap of the August LiteLLM town hall: 79 security fixes, 375 bug fixes, 142 feature commits, a new Director of Security, the public status dashboard, and Auto-Router results from production.]]></summary>
        <content type="html"><![CDATA[<p>Thank you to everyone who joined our August town hall. We used it to share this month's security and stability work and our latest product updates: <strong>79 security fixes</strong>, <strong>375 bug fixes</strong>, and <strong>142 feature commits</strong>, a new Director of Security, a public status dashboard, and Auto-Router results from production.</p>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="security">Security<a href="https://docs.litellm.ai/blog/august-townhall-updates#security" class="hash-link" aria-label="Direct link to Security" title="Direct link to Security">​</a></h2>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="79-security-fixes-shipped-this-month">79 security fixes shipped this month<a href="https://docs.litellm.ai/blog/august-townhall-updates#79-security-fixes-shipped-this-month" class="hash-link" aria-label="Direct link to 79 security fixes shipped this month" title="Direct link to 79 security fixes shipped this month">​</a></h3>
<p>Here is where they landed:</p>
<table><thead><tr><th>Category</th><th>Fixes</th><th>Share</th></tr></thead><tbody><tr><td>Access control / authz hardening</td><td>25</td><td>32%</td></tr><tr><td>Credential / secret / PII hardening</td><td>23</td><td>29%</td></tr><tr><td>General hardening (unsafe outbound, UI role gating)</td><td>21</td><td>27%</td></tr><tr><td>Quota / budget / rate-limit hardening</td><td>10</td><td>13%</td></tr></tbody></table>
<p>We backport security fixes across the last four minor release lines. If you're on a version older than a month, upgrading to a newer version is recommended. The current release is v1.99.</p>
<p>We also announced that Oliver Jensen has joined as Director of Security; he was most recently CISO at Regrello.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="whats-next-for-security">What's next for security<a href="https://docs.litellm.ai/blog/august-townhall-updates#whats-next-for-security" class="hash-link" aria-label="Direct link to What's next for security" title="Direct link to What's next for security">​</a></h3>
<p>We're expanding the bug bounty program and hardening the recurring code patterns through the stability sprint.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="stability">Stability<a href="https://docs.litellm.ai/blog/august-townhall-updates#stability" class="hash-link" aria-label="Direct link to Stability" title="Direct link to Stability">​</a></h2>
<p>In August we shipped <strong>375 bug fixes</strong>.</p>
<table><thead><tr><th>Area</th><th>Fixes</th></tr></thead><tbody><tr><td>Other / SDK</td><td>118</td></tr><tr><td>Proxy Core &amp; Resilience</td><td>88</td></tr><tr><td>UI + Auth / SSO</td><td>66</td></tr><tr><td>Cost, Budgets &amp; Observability</td><td>34</td></tr><tr><td>Providers &amp; Model Transforms</td><td>29</td></tr><tr><td>Streaming / Realtime APIs</td><td>22</td></tr><tr><td>MCP Gateway</td><td>18</td></tr></tbody></table>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="statuslitellmai-is-live">status.litellm.ai is live<a href="https://docs.litellm.ai/blog/august-townhall-updates#statuslitellmai-is-live" class="hash-link" aria-label="Direct link to status.litellm.ai is live" title="Direct link to status.litellm.ai is live">​</a></h3>
<p>In an effort to increase transparency, we shipped a public dashboard to display what tests actually ran on the release. You can open any recent release and see which tests passed, drill into a specific area like quota management or Claude Code, and go through the full run history. For example, on the 1.98.0rc1 release, 104 Claude Code tests ran and all of them passed before it shipped.</p>
<p><img decoding="async" loading="lazy" alt="status.litellm.ai showing all 677 executed tests passing on the 1.99.0rc1 release, broken down by module" src="https://docs.litellm.ai/assets/images/status-dashboard-a71fc1f8d57927b217631b273f96748d.png" width="1866" height="1354" class="img_ev3q"></p>
<p>Tracked live at <a href="https://status.litellm.ai/" target="_blank" rel="noopener noreferrer">status.litellm.ai</a>. If you have feedback on how we can improve transparency around releases, let us know.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="what-kinds-of-fixes-shipped">What kinds of fixes shipped<a href="https://docs.litellm.ai/blog/august-townhall-updates#what-kinds-of-fixes-shipped" class="hash-link" aria-label="Direct link to What kinds of fixes shipped" title="Direct link to What kinds of fixes shipped">​</a></h3>
<ul>
<li><strong>Cost tracking and budgets.</strong> Spend logs capture every entry under load, budget resets land on schedule, and cost maps stay accurate as pricing changes roll in.</li>
<li><strong>Batches API.</strong> Multi-pod polling bills each batch exactly once, cost attribution on passthrough batches is correct, and malformed batch uploads get caught before they run.</li>
<li><strong>MCP credential hygiene.</strong> 18 MCP-scoped fixes. Tool calls run under each caller's own credentials, and OAuth sessions stay valid for the full length of a task.</li>
<li><strong>AI gateway auth.</strong> Billing and identity data stay in sync. Cost maps reflect current pricing, spend records persist through traffic spikes, and budgets enforce correctly at renewal and across multi-team splits.</li>
<li><strong>Guardrail masking.</strong> PII and PCI stay masked across spend logs, debug logs, and logging-only responses. Coverage spans every path data can take out of the system.</li>
</ul>
<p>Spend tracking under heavy load was a large area of investment, and it will keep getting attention in the next months.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="the-target-80-e2e-coverage-in-september">The target: 80% E2E coverage in September<a href="https://docs.litellm.ai/blog/august-townhall-updates#the-target-80-e2e-coverage-in-september" class="hash-link" aria-label="Direct link to The target: 80% E2E coverage in September" title="Direct link to The target: 80% E2E coverage in September">​</a></h3>
<p>End-to-end coverage is at 70% across endpoints today. The goal for September is 80%, holding current velocity on bug fixes while we get there.</p>
<p>Most of that work is catching real customer use cases and getting them into the E2E suite. If there's a scenario you think our testing misses, feel free to let us know.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="product">Product<a href="https://docs.litellm.ai/blog/august-townhall-updates#product" class="hash-link" aria-label="Direct link to Product" title="Direct link to Product">​</a></h2>
<p><strong>142 feature commits</strong> this month.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="dark-mode-is-here">Dark mode is here<a href="https://docs.litellm.ai/blog/august-townhall-updates#dark-mode-is-here" class="hash-link" aria-label="Direct link to Dark mode is here" title="Direct link to Dark mode is here">​</a></h3>
<p>Dark mode shipped on the dashboard. Choose dark, light, or follow your system setting.</p>
<p><img decoding="async" loading="lazy" alt="The LiteLLM usage dashboard in dark mode, showing project spend, usage metrics, and daily spend" src="https://docs.litellm.ai/assets/images/dark-mode-ecb2895481ccd36ae462b363559e24cc.png" width="2046" height="1133" class="img_ev3q"></p>
<p>The dashboard is now moved onto one shared component system. The navbar, playground, guardrails, usage, cost tracking, models and endpoints, team and user surfaces, the log details drawer, and the AI Hub, all migrated onto shadcn.</p>
<p>Two engineers did this in under a month, alongside their stability work. The UI looks noticeably different from a month ago as a result.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="day-0-model-support-in-under-an-hour">Day 0 model support in under an hour<a href="https://docs.litellm.ai/blog/august-townhall-updates#day-0-model-support-in-under-an-hour" class="hash-link" aria-label="Direct link to Day 0 model support in under an hour" title="Direct link to Day 0 model support in under an hour">​</a></h3>
<p>Over the last month and a half we've brought time-to-release for a new model down from a day to under an hour.</p>
<ul>
<li><strong>Gemini 3.7 Flash</strong> (Google) shipped in under an hour.</li>
<li><strong>Grok 4.6</strong> (xAI) on a similar timeline.</li>
</ul>
<p>Both landed August 13, the day each provider launched, and shipped in the v1.98.0 stable release on August 22.</p>
<p>Developers ask for the newest model the day it lands, and we're pushing to make this under an hour.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="auto-router-51-cost-savings-in-production">Auto-Router: 51% cost savings in production<a href="https://docs.litellm.ai/blog/august-townhall-updates#auto-router-51-cost-savings-in-production" class="hash-link" aria-label="Direct link to Auto-Router: 51% cost savings in production" title="Direct link to Auto-Router: 51% cost savings in production">​</a></h3>
<p>A design partner ran Auto-Router across 450+ users between April 15 and August 9, covering 272,876 requests and 7.08 billion tokens. Spend came in at $12,249 against a $23,985 all-flagship baseline, a 51.1% reduction, with no meaningful quality impact. Savings climbed from 42.9% in May to 60.7% in August as tier maps were tuned on real traffic. 95% of requests never needed the flagship tier.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="the-classifier-got-smarter">The classifier got smarter<a href="https://docs.litellm.ai/blog/august-townhall-updates#the-classifier-got-smarter" class="hash-link" aria-label="Direct link to The classifier got smarter" title="Direct link to The classifier got smarter">​</a></h3>
<p>Auto-Router now reads the last N turns of a conversation. That change produced a <strong>5.6x improvement in routing accuracy</strong> on referential follow-ups, at no measurable latency cost. It came directly out of community feedback.</p>
<p><img decoding="async" loading="lazy" alt="LiteLLM Auto-Router V2 routing accuracy on complex scenarios, 5.6x more accurate when the classifier reads the last three turns of the conversation" src="https://docs.litellm.ai/assets/images/autorouter-classifier-7f85d531121021d7963ba96867f43774.png" width="2046" height="1069" class="img_ev3q"></p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="auto-routing-and-prompt-caching-stack">Auto-routing and prompt caching stack<a href="https://docs.litellm.ai/blog/august-townhall-updates#auto-routing-and-prompt-caching-stack" class="hash-link" aria-label="Direct link to Auto-routing and prompt caching stack" title="Direct link to Auto-routing and prompt caching stack">​</a></h3>
<p>The most common concern we heard was whether auto-routing would break prompt caching, since caching delivers real savings on its own.</p>
<p>It doesn't. The two stack. Router plus caching came in around 50% cheaper than caching alone in our benchmarks.</p>
<p>The reason is TTL. Prompt cache entries live at least five minutes, and when the router switches models as often as it does, you typically come back to a given model inside that window while its cache is still warm. The hit still lands. <a href="https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark" target="_blank" rel="noopener noreferrer">Full writeup</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="att-cut-ai-costs-56">AT&amp;T cut AI costs 56%<a href="https://docs.litellm.ai/blog/august-townhall-updates#att-cut-ai-costs-56" class="hash-link" aria-label="Direct link to AT&amp;T cut AI costs 56%" title="Direct link to AT&amp;T cut AI costs 56%">​</a></h3>
<p>AT&amp;T reported a 56% cost reduction on coding and other advanced AI tasks after adopting LiteLLM model routing, with a 2% quality drop. Open-source models handle 40% of their employee queries today, and they plan to take that to 60-70%. Reported by <a href="https://www.pymnts.com/news/artificial-intelligence/2026/att-slashes-ai-costs-by-adopting-model-routers-and-open-source/" target="_blank" rel="noopener noreferrer">PYMNTS</a>.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="auto-router-benchmarks">Auto-Router benchmarks<a href="https://docs.litellm.ai/blog/august-townhall-updates#auto-router-benchmarks" class="hash-link" aria-label="Direct link to Auto-Router benchmarks" title="Direct link to Auto-Router benchmarks">​</a></h3>
<p>Four benchmarks published this month, each against its own baseline.</p>
<ul>
<li><strong>Claude Code coding tasks.</strong> 40.4% lower cost at 97.1% of top-model quality.</li>
<li><strong>RouterArena.</strong> On a wider, independently graded prompt set, 74.5% lower cost at 87.3% quality.</li>
<li><strong>Prompt caching.</strong> Stacked with caching, the router beats caching alone by up to 69% on cost.</li>
<li><strong>Terminal-Bench 2.0.</strong> Matches the top model's solve rate on real agentic tasks at 27% lower cost.</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="what-else-shipped-on-auto-router">What else shipped on Auto-Router<a href="https://docs.litellm.ai/blog/august-townhall-updates#what-else-shipped-on-auto-router" class="hash-link" aria-label="Direct link to What else shipped on Auto-Router" title="Direct link to What else shipped on Auto-Router">​</a></h3>
<ul>
<li>
<p><strong>1-click deploy templates.</strong> Pick a model family instead of configuring tiers by hand. Choose Anthropic or OpenAI and the simple, medium, complex, and reasoning tiers come pre-populated. When a provider adds a new model, we update the configuration so you don't have to. Custom configuration is still there if you want it.</p>
<p><img decoding="async" loading="lazy" alt="Add Auto Router dialog with the Anthropic Family, OpenAI Family, and Lite templates listed, each showing whether it matches your deployments" src="https://docs.litellm.ai/assets/images/autorouter-templates-38e4e5bacadd66f5a3cd690bdd3468a9.png" width="2048" height="1314" class="img_ev3q"></p>
</li>
<li>
<p><strong>Auto-Router dashboard.</strong> A usage tab under Cost Optimization showing savings per session, turns per session, session length, and cache-hit analytics. You can compare multiple auto-routers side by side.</p>
<p><img decoding="async" loading="lazy" alt="Auto-Router usage tab under Cost Optimization, showing total estimated savings, average saved per session, and prompt cache hit rate by bucket" src="https://docs.litellm.ai/assets/images/autorouter-dashboard-a85fa567b14f0abc6c87b9a85bf1fbfc.png" width="2048" height="1184" class="img_ev3q"></p>
</li>
<li>
<p><strong>Shadow evaluations.</strong> The biggest blocker to adoption was wanting to see how the router would perform in production before rolling it out. Now you can sample a percentage of one key's traffic through a router, set a spend budget for the test, and pick your own judge model. In our run, the router matched or beat the current model on 75% of sessions.</p>
<p><img decoding="async" loading="lazy" alt="Shadow eval results showing the router matched or beat the current model on 75% of judged responses, broken down by model compared against and prompt difficulty" src="https://docs.litellm.ai/assets/images/shadow-evals-1716120d260b4db421bed90b11a55241.png" width="2048" height="777" class="img_ev3q"></p>
</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="try-auto-router">Try Auto-Router<a href="https://docs.litellm.ai/blog/august-townhall-updates#try-auto-router" class="hash-link" aria-label="Direct link to Try Auto-Router" title="Direct link to Try Auto-Router">​</a></h3>
<ul>
<li><strong>Local CLI:</strong> <a href="https://docs.litellm.ai/docs/learn/autorouter_cli" target="_blank" rel="noopener noreferrer">docs.litellm.ai/docs/learn/autorouter_cli</a></li>
<li><strong>On proxy:</strong> <a href="https://docs.litellm.ai/docs/proxy/auto_routing" target="_blank" rel="noopener noreferrer">docs.litellm.ai/docs/proxy/auto_routing</a></li>
<li><strong>Join the discussion:</strong> <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">GitHub Discussion #32168</a>, pinned in our repo. The community there is actively shaping the roadmap.</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="questions-from-the-audience">Questions from the audience<a href="https://docs.litellm.ai/blog/august-townhall-updates#questions-from-the-audience" class="hash-link" aria-label="Direct link to Questions from the audience" title="Direct link to Questions from the audience">​</a></h2>
<p><strong>How are model prices updated, and where does the data come from?</strong>
<code>model_prices_and_context_window.json</code> is the definitive source. We have automations that alert the team when a provider changes pricing. Where we pull each entry from varies, because providers publish this information in different places. When a provider like OpenAI announces a change, we update that provider, then check the other providers' own pages before propagating, so we don't show a discount on Azure that Azure hasn't actually applied.</p>
<p><strong>Is there a fair-share system if one user sends far more traffic than another?</strong>
Yes. Dynamic request limiting supports thresholds and quotas per user today.</p>
<p><strong>SSO is free up to five users. Is that users sending requests, or users logging in?</strong>
It's the number of user accounts created, counted as rows in the internal users table. One key making a large volume of requests doesn't count against it.</p>
<p><strong>Do you need an Auto-Router configured before running a shadow eval?</strong>
Today, yes. Creating a router first is one extra step, and the model-family template makes it quick. Going straight from shadow eval to picking a family, skipping router creation, is a reasonable flow we haven't built yet. If you want to try it and give feedback, we'll pick it up.</p>
<p><strong>How is the cost reduction figure calculated?</strong>
You pick a target model to benchmark against when you create the router. By default we use the most expensive model in your tier.</p>
<p><strong>Are you clearing the GitHub issue and PR backlog?</strong>
The honest answer is that we need to resource open source better. We're hiring engineers dedicated to maintaining the repo, and expect to have more to share in the next two to three weeks.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="whats-next">What's next<a href="https://docs.litellm.ai/blog/august-townhall-updates#whats-next" class="hash-link" aria-label="Direct link to What's next" title="Direct link to What's next">​</a></h2>
<p>Thanks again for all the questions and feedback. We'll keep sharing concrete progress as this work ships, especially on the September coverage target.</p>
<p>We're also considering bringing customers onto future town halls to talk about their own setups. If that would be useful to you, let us know.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="were-hiring">We're hiring<a href="https://docs.litellm.ai/blog/august-townhall-updates#were-hiring" class="hash-link" aria-label="Direct link to We're hiring" title="Direct link to We're hiring">​</a></h2>
<p>LiteLLM is the open-source gateway thousands of teams use to run every model behind one API, from startups to the Fortune 500. We move fast: 142 features and 375 fixes shipped this month alone.</p>
<p>We're hiring across the core gateway, including on the security team Oliver is building out and on a dedicated open-source maintenance team. Small team, huge surface area, real ownership from day one. Want in, or know someone great? Reach us at <a href="mailto:recruiting@berri.ai" target="_blank" rel="noopener noreferrer">recruiting@berri.ai</a>.</p>
<p>Reach us at <a href="mailto:support@berri.ai" target="_blank" rel="noopener noreferrer">support@berri.ai</a>, or <a href="mailto:product@berri.ai" target="_blank" rel="noopener noreferrer">product@berri.ai</a> for product feedback.</p>
<p>Thank you for using LiteLLM. <strong>Krrish &amp; Ishaan</strong></p>]]></content>
        <author>
            <name>Krrish Dholakia</name>
            <uri>https://www.linkedin.com/in/krish-d/</uri>
        </author>
        <author>
            <name>Ishaan Jaffer</name>
            <uri>https://www.linkedin.com/in/reffajnaahsi/</uri>
        </author>
        <category label="townhall" term="townhall"/>
        <category label="security" term="security"/>
        <category label="reliability" term="reliability"/>
        <category label="product" term="product"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Shadow Evaluations: Test the Auto-Router on Your Own Production Traffic]]></title>
        <id>https://docs.litellm.ai/blog/auto-router-shadow-evaluations</id>
        <link href="https://docs.litellm.ai/blog/auto-router-shadow-evaluations"/>
        <updated>2026-08-18T10:00:00.000Z</updated>
        <summary type="html"><![CDATA[Shadow evaluations duplicate a sampled slice of one key's live traffic through an auto-router and have an LLM judge blindly compare the answers. On our own traffic the router matched or beat the current model on 88.1% of judged responses, measured before a single user-facing response changed.]]></summary>
        <content type="html"><![CDATA[<p>We have shown the Auto-Router <a href="https://docs.litellm.ai/blog/auto-router-production-savings">saving 51% in production</a> and <a href="https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark">69% stacked on prompt caching</a>. The question we hear next is always the same: <strong>"would it hold quality on my traffic?"</strong></p>
<p><img decoding="async" loading="lazy" alt="Shadow Evaluations: test the Auto-Router on your own production traffic" src="https://docs.litellm.ai/assets/images/hero-222e2672cd20efc8bb9ebd061cdf0794.png" width="3200" height="1676" class="img_ev3q"></p>
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>🚀 Help shape the Auto-Router</div><div class="admonitionContent_BuS1"><p>Get early access, work directly with the LiteLLM team, and influence the roadmap with your production traffic.</p><a class="button button--primary button--lg" style="background:#2e8555;border-color:#2e8555;color:#fff" href="https://calendar.app.google/i2e7qVEJphHi5S8UA">Apply to Become a Design Partner</a></div></div>
<p>Shadow evaluations answer that on your own production traffic, and boil it down to one number. On our own traffic below: <strong>the router matched or beat the current model on 88.1% of judged responses</strong>. Nothing your users see changes while it runs.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-a-shadow-eval-does">What a shadow eval does<a href="https://docs.litellm.ai/blog/auto-router-shadow-evaluations#what-a-shadow-eval-does" class="hash-link" aria-label="Direct link to What a shadow eval does" title="Direct link to What a shadow eval does">​</a></h2>
<ul>
<li><strong>Samples a slice of one key's live traffic</strong>; you pick the percentage</li>
<li><strong>Duplicates each sampled request through the auto-router.</strong> The caller still gets the real response; the shadow response is never served to anyone</li>
<li><strong>A blind LLM judge compares the two answers.</strong> It sees answer A and answer B, never which arm produced them</li>
<li><strong>You get a win rate</strong>: real vs. router, overall and per complexity tier</li>
</ul>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="two-questions-it-answers">Two questions it answers<a href="https://docs.litellm.ai/blog/auto-router-shadow-evaluations#two-questions-it-answers" class="hash-link" aria-label="Direct link to Two questions it answers" title="Direct link to Two questions it answers">​</a></h2>
<table><thead><tr><th>Direction</th><th>Question</th><th>Real arm</th><th>Shadow arm</th></tr></thead><tbody><tr><td><code>forward</code></td><td>Should this key adopt the router?</td><td>The model the key calls today</td><td>The router's pick</td></tr><tr><td><code>reverse</code></td><td>Is the router still worth it?</td><td>The router's pick, already serving the key</td><td>A fixed baseline model, e.g. the flagship</td></tr></tbody></table>
<p>In forward mode, a shadow arm at rough parity means the router matches your current model's quality at a fraction of the cost. In reverse mode, the real arm holding its own means the router keeps earning its place.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="safe-on-production-traffic-by-construction">Safe on production traffic by construction<a href="https://docs.litellm.ai/blog/auto-router-shadow-evaluations#safe-on-production-traffic-by-construction" class="hash-link" aria-label="Direct link to Safe on production traffic by construction" title="Direct link to Safe on production traffic by construction">​</a></h2>
<ul>
<li>The user-facing response is untouched; the shadow arm is a duplicate nobody receives</li>
<li>Only the one key you pick is sampled, at the percentage you set</li>
<li><code>max_turns</code> is a hard sample budget (default 200, max 2,000); the job judges at most that many turns, then completes. Judge spend is bounded at roughly one judge call per turn</li>
<li><code>duration_days</code> auto-stops the job (default 7, max 30); you can stop it earlier at any time</li>
<li>Requests with logging redaction on are never sampled</li>
<li>Works across <code>/chat/completions</code>, <code>/v1/messages</code>, and <code>/v1/responses</code> traffic</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="reading-the-results">Reading the results<a href="https://docs.litellm.ai/blog/auto-router-shadow-evaluations#reading-the-results" class="hash-link" aria-label="Direct link to Reading the results" title="Direct link to Reading the results">​</a></h2>
<p>One glance answers the question. A completed job on our own traffic, 143 judged turns for $1.55 of judge spend:</p>
<p><img decoding="async" loading="lazy" alt="Shadow eval results: router matched or beat the current model on 88.1% of 143 judged responses" src="https://docs.litellm.ai/assets/images/results_card-f4b797c46551b139f2c73aed2aff0e73.png" width="2000" height="538" class="img_ev3q"></p>
<p>Ties are the point. The router mostly picks a cheaper model, so every tie is the same quality at a lower price; here only 11.9% of turns preferred the current model, and per-tier slices show exactly where those live.</p>
<p>The job also reports:</p>
<ul>
<li><strong>Win rates</strong>: real wins, shadow wins, and ties, as shares of judged turns</li>
<li><strong>Per complexity tier</strong>, so you can see exactly which tier a quality gap lives in and fix that one tier's model instead of abandoning the router</li>
<li><strong>Average judge confidence</strong> per slice</li>
<li><strong>Judge spend so far</strong>, tracked on the job</li>
</ul>
<p>At 88.1% matched-or-beat, the remaining question is not quality; it is why you are still paying flagship prices for every request.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="start-a-shadow-evaluation-on-your-own-production-traffic">Start a shadow evaluation on your own production traffic<a href="https://docs.litellm.ai/blog/auto-router-shadow-evaluations#start-a-shadow-evaluation-on-your-own-production-traffic" class="hash-link" aria-label="Direct link to Start a shadow evaluation on your own production traffic" title="Direct link to Start a shadow evaluation on your own production traffic">​</a></h2>
<p>In the UI: <strong>Cost Optimization → Auto Router → Shadow Evals</strong>, pick a key and a router, start. Or over the API:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">curl -X POST 'http://localhost:4000/auto_router/shadow_eval/start' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -H 'Authorization: Bearer sk-admin' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -H 'Content-Type: application/json' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -d '{</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    "api_key_id": "88dc28..",</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    "router_name": "claude-auto-latest",</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    "shadow_percentage": 10</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  }'</span><br></span></code></pre></div></div>
<p>The judge defaults to <code>anthropic/claude-sonnet-5</code>; a mid-tier judge is the sweet spot, since it only has to compare two answers. Poll <code>GET /auto_router/shadow_eval/{job_id}</code> for live results while the job runs.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="try-it">Try it<a href="https://docs.litellm.ai/blog/auto-router-shadow-evaluations#try-it" class="hash-link" aria-label="Direct link to Try it" title="Direct link to Try it">​</a></h2>
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_BuS1"><p>Start a shadow eval against a key you already run in production and let it judge a week of real traffic. Share numbers or questions in <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>. To work on this with us directly, <a href="https://calendar.app.google/i2e7qVEJphHi5S8UA" target="_blank" rel="noopener noreferrer">apply to be a design partner</a>.</p></div></div>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockTitle_OeMC">config.yaml</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">auto</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">latest</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> auto_router/complexity_router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">tiers</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">SIMPLE</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">MEDIUM</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">COMPLEX</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">   claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">REASONING</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_default_model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><br></span></code></pre></div></div>
<p>Full reference, including every shadow eval knob, on the <a href="https://docs.litellm.ai/docs/proxy/auto_routing">Auto Routing docs page</a>.</p>]]></content>
        <author>
            <name>Tin Lo</name>
        </author>
        <category label="routing" term="routing"/>
        <category label="complexity-router" term="complexity-router"/>
        <category label="evals" term="evals"/>
        <category label="quality" term="quality"/>
        <category label="engineering" term="engineering"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Day 0 support: Gemini 3.7 Flash]]></title>
        <id>https://docs.litellm.ai/blog/gemini_3_7_flash</id>
        <link href="https://docs.litellm.ai/blog/gemini_3_7_flash"/>
        <updated>2026-08-13T10:00:00.000Z</updated>
        <summary type="html"><![CDATA[day 0 support for Gemini 3.7 Flash on LiteLLM, with launch pricing tracked across Google AI Studio and Vertex AI.]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="LiteLLM x Gemini 3.7 Flash" src="https://docs.litellm.ai/assets/images/hero-e8c5fa48706299f3be1e0eea539f5246.png" width="4800" height="2508" class="img_ev3q"></p>
<p>LiteLLM now supports <code>gemini-3.7-flash</code> on day 0, on both Google AI Studio (<code>gemini/</code>) and Vertex AI (<code>vertex_ai/</code>). Google's newest Flash model delivers faster responses with meaningfully better quality than 3.6 Flash and scores higher on complex multi-step agentic, coding, and reasoning benchmarks.</p>
<!-- -->
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p><strong>No Docker image upgrade needed.</strong> Gemini 3.7 Flash routes through the existing Gemini configs, so any recent LiteLLM version works out of the box for inference. For cost tracking, hit the <strong>Reload Model Cost Map</strong> button in the Admin UI (or <code>POST /reload/model_cost_map</code>) to pull the latest pricing from GitHub. This is available on <code>v1.76.0</code> and above. The <code>gemini-3.7-flash</code> pricing and metadata are also bundled starting in <code>v1.98.0-dev.2</code> for anyone running with <code>LITELLM_LOCAL_MODEL_COST_MAP=true</code>.</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="launch-pricing">Launch pricing<a href="https://docs.litellm.ai/blog/gemini_3_7_flash#launch-pricing" class="hash-link" aria-label="Direct link to Launch pricing" title="Direct link to Launch pricing">​</a></h2>
<p>Gemini 3.7 Flash launches at a 50% discount that runs through December 31, 2027. LiteLLM tracks cost at the promotional rate.</p>
<table><thead><tr><th></th><th>Promotional</th><th>Standard</th></tr></thead><tbody><tr><td>Input</td><td>$0.75 / 1M tokens</td><td>$1.50 / 1M tokens</td></tr><tr><td>Output</td><td>$3.75 / 1M tokens</td><td>$7.50 / 1M tokens</td></tr></tbody></table>
<p>Cache reads, batch, flex, and priority tiers are discounted proportionally.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="quick-start">Quick Start<a href="https://docs.litellm.ai/blog/gemini_3_7_flash#quick-start" class="hash-link" aria-label="Direct link to Quick Start" title="Direct link to Quick Start">​</a></h2>
<div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">SDK</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">PROXY</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token keyword" style="color:rgb(0, 0, 255)">from</span><span class="token plain"> litellm </span><span class="token keyword" style="color:rgb(0, 0, 255)">import</span><span class="token plain"> completion</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">response </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> completion</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    model</span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token string" style="color:rgb(163, 21, 21)">"gemini/gemini-3.7-flash"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    messages</span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token string" style="color:rgb(163, 21, 21)">"role"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"user"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"content"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"Summarize this article in 3 bullet points."</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain"></span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain"></span><span class="token keyword" style="color:rgb(0, 0, 255)">print</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">response</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">choices</span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token number" style="color:rgb(9, 134, 88)">0</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">message</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">content</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p><strong>1. Setup config.yaml</strong></p><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gemini</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">3.7</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">flash</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gemini/gemini</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">3.7</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">flash</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/GEMINI_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token comment" style="color:rgb(0, 128, 0)"># Or use Vertex AI</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> vertex</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">gemini</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">3.7</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">flash</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> vertex_ai/gemini</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">3.7</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">flash</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">vertex_project</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> your</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">project</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">id</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">vertex_location</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> us</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">central1</span><br></span></code></pre></div></div><p><strong>2. Start proxy</strong></p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">litellm --config /path/to/config.yaml</span><br></span></code></pre></div></div><p><strong>3. Make requests</strong></p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">curl -X POST http://localhost:4000/v1/chat/completions \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -H "Content-Type: application/json" \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -H "Authorization: Bearer &lt;YOUR-LITELLM-KEY&gt;" \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -d '{</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    "model": "gemini-3.7-flash",</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    "messages": [{"role": "user", "content": "Hello!"}]</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  }'</span><br></span></code></pre></div></div></div></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="thinking-levels">Thinking levels<a href="https://docs.litellm.ai/blog/gemini_3_7_flash#thinking-levels" class="hash-link" aria-label="Direct link to Thinking levels" title="Direct link to Thinking levels">​</a></h2>
<p>Gemini 3.7 Flash is a reasoning model. LiteLLM maps OpenAI <code>reasoning_effort</code> to Gemini's <code>thinkingLevel</code>, so the same request shape you use for other reasoning models works here.</p>
<div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token keyword" style="color:rgb(0, 0, 255)">from</span><span class="token plain"> litellm </span><span class="token keyword" style="color:rgb(0, 0, 255)">import</span><span class="token plain"> completion</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">response </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> completion</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    model</span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token string" style="color:rgb(163, 21, 21)">"gemini/gemini-3.7-flash"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    messages</span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token string" style="color:rgb(163, 21, 21)">"role"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"user"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"content"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"What's 2+2?"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    reasoning_effort</span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token string" style="color:rgb(163, 21, 21)">"low"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain"></span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain"></span><span class="token keyword" style="color:rgb(0, 0, 255)">print</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">response</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">choices</span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token number" style="color:rgb(9, 134, 88)">0</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">message</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">content</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><br></span></code></pre></div></div>
<div class="theme-admonition theme-admonition-warning admonition_xJq3 alert alert--warning"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Known limitation at launch</div><div class="admonitionContent_BuS1"><p>The <code>minimal</code> thinking level is not yet supported on <code>gemini-3.7-flash</code>. The Gemini API returns a 400 (<code>Thinking level MINIMAL is not supported for this model</code>). Google plans minimal thinking support as a fast follow. All other thinking levels work as expected.</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="supported-endpoints">Supported Endpoints<a href="https://docs.litellm.ai/blog/gemini_3_7_flash#supported-endpoints" class="hash-link" aria-label="Direct link to Supported Endpoints" title="Direct link to Supported Endpoints">​</a></h2>
<p>LiteLLM provides full end-to-end support for Gemini 3.7 Flash on:</p>
<ul>
<li><code>/v1/chat/completions</code> - OpenAI-compatible chat completions endpoint</li>
<li><code>/v1/responses</code> - OpenAI Responses API endpoint (streaming and non-streaming)</li>
<li><a href="https://docs.litellm.ai/docs/anthropic_unified"><code>/v1/messages</code></a> - Anthropic-compatible messages endpoint</li>
<li><code>/v1/generateContent</code> - <a href="https://docs.litellm.ai/docs/generateContent">Google Gemini API</a> compatible endpoint</li>
</ul>
<p>All endpoints support streaming and non-streaming responses, function calling with thought signatures, multi-turn conversations, and full multimodal input (text, image, audio, video).</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="feedback">Feedback<a href="https://docs.litellm.ai/blog/gemini_3_7_flash#feedback" class="hash-link" aria-label="Direct link to Feedback" title="Direct link to Feedback">​</a></h2>
<p>Running Gemini 3.7 Flash through LiteLLM and hitting something unexpected? Share it on <a href="https://github.com/BerriAI/litellm/discussions/36799" target="_blank" rel="noopener noreferrer">GitHub discussion #36799</a>.</p>]]></content>
        <author>
            <name>Mateo Wang</name>
            <uri>https://www.linkedin.com/in/mateo-wang</uri>
        </author>
        <author>
            <name>Krrish Dholakia</name>
            <uri>https://www.linkedin.com/in/krish-d/</uri>
        </author>
        <author>
            <name>Ishaan Jaffer</name>
            <uri>https://www.linkedin.com/in/reffajnaahsi/</uri>
        </author>
        <category label="gemini" term="gemini"/>
        <category label="gemini-3.7-flash" term="gemini-3.7-flash"/>
        <category label="day 0 support" term="day 0 support"/>
        <category label="llms" term="llms"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[August Townhall: Product + Roadmap Updates]]></title>
        <id>https://docs.litellm.ai/blog/august-townhall-announcement</id>
        <link href="https://docs.litellm.ai/blog/august-townhall-announcement"/>
        <updated>2026-08-10T12:00:00.000Z</updated>
        <summary type="html"><![CDATA[Join the LiteLLM August townhall on Thursday, 27 August at 7:30 AM PT to learn about LiteLLM's product updates and roadmap.]]></summary>
        <content type="html"><![CDATA[<p>We are hosting our August townhall on <strong>Thursday, 27 August at 7:30 AM PT</strong>.</p>
<div style="background-size:cover;background-repeat:no-repeat;position:relative;background-image:url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAADCAIAAAAlXwkiAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAZUlEQVR4nGPgUnHkVrTlVHUT0nRUN7f1iguOrCkJLCx0Scy0C09ikNR31rBy908rjCooSW9siS1vCMso9k8pNnANUrTxY9DU1tI2MLKwsdZSVtGVVdCRkNWXlteWkDUWFDERlQYAaHoWfDiAvK8AAAAASUVORK5CYII=&quot;)"><svg style="width:100%;height:auto;max-width:100%;margin-bottom:-4px" width="640" height="160"></svg><noscript><img style=width:100%;height:auto;max-width:100%;margin-bottom:-4px;position:absolute;top:0;left:0 src=/assets/ideal-img/august_townhall_banner.bf052e7.640.png srcset="/assets/ideal-img/august_townhall_banner.bf052e7.640.png 640w,/assets/ideal-img/august_townhall_banner.73eee77.800.png 800w" width=640 height=160></noscript></div>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="agenda">Agenda<a href="https://docs.litellm.ai/blog/august-townhall-announcement#agenda" class="hash-link" aria-label="Direct link to Agenda" title="Direct link to Agenda">​</a></h2>
<ul>
<li>Product updates and roadmap progress</li>
<li>Reliability and security updates</li>
<li>Open Q&amp;A with the team</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="stability">Stability<a href="https://docs.litellm.ai/blog/august-townhall-announcement#stability" class="hash-link" aria-label="Direct link to Stability" title="Direct link to Stability">​</a></h2>
<p>Our team is focused on stability: improving reliability and reducing regressions across releases. Follow the roadmap here: <a href="https://github.com/BerriAI/litellm/issues/30484" target="_blank" rel="noopener noreferrer">Stability roadmap</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-contribute">How to contribute<a href="https://docs.litellm.ai/blog/august-townhall-announcement#how-to-contribute" class="hash-link" aria-label="Direct link to How to contribute" title="Direct link to How to contribute">​</a></h2>
<p>Add the topics and questions you'd like us to cover when you register below. We use your responses to set the agenda.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="register">Register<a href="https://docs.litellm.ai/blog/august-townhall-announcement#register" class="hash-link" aria-label="Direct link to Register" title="Direct link to Register">​</a></h2>
<p>Register here: <a href="https://forms.gle/ti1BATLWmYQNb7bcA" target="_blank" rel="noopener noreferrer">LiteLLM August Townhall Form</a></p>
<p>We will hold the townhall from <strong>7:30 AM to 8:30 AM PT on Zoom</strong>.</p>
<p>For security, attendance is restricted to corporate emails. If you register with a non-corporate email, we will share the townhall slides and accompanying blog post after the event.</p>]]></content>
        <author>
            <name>Krrish Dholakia</name>
            <uri>https://www.linkedin.com/in/krish-d/</uri>
        </author>
        <author>
            <name>Ishaan Jaffer</name>
            <uri>https://www.linkedin.com/in/reffajnaahsi/</uri>
        </author>
        <category label="announcement" term="announcement"/>
        <category label="townhall" term="townhall"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[51% Cost Savings Reported From a Live Production Deployment]]></title>
        <id>https://docs.litellm.ai/blog/auto-router-production-savings</id>
        <link href="https://docs.litellm.ai/blog/auto-router-production-savings"/>
        <updated>2026-08-10T10:00:00.000Z</updated>
        <summary type="html"><![CDATA[A LiteLLM customer rolled the Auto Router out to 450+ users in production and shared four months of numbers: 272,876 requests, 7.08 billion tokens, and $12,249 saved against an all-flagship baseline.]]></summary>
        <content type="html"><![CDATA[<p>You can expect roughly 40% cost reductions from day one with the Auto Router, and more as the tier maps are tuned. One of our production users shared their statistics to show what that looks like at scale.</p>
<p>They rolled out the Auto-Router to 450+ users across dev, staging, and prod instances and saved <strong>$12,249 over 270k+ requests</strong>.</p>
<p><img decoding="async" loading="lazy" alt="Production traffic recorded 51% cost-savings with the Auto-Router" src="https://docs.litellm.ai/assets/images/hero-5a5c7b9f2640e96f1ae0cc7929966f32.png" width="3200" height="1676" class="img_ev3q"></p>
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>🚀 Help shape the Auto-Router</div><div class="admonitionContent_BuS1"><p>Get early access, work directly with the LiteLLM team, and influence the roadmap with your production traffic.</p><a class="button button--primary button--lg" style="background:#2e8555;border-color:#2e8555;color:#fff" href="https://calendar.app.google/i2e7qVEJphHi5S8UA">Apply to Become a Design Partner</a></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="key-findings">Key findings<a href="https://docs.litellm.ai/blog/auto-router-production-savings#key-findings" class="hash-link" aria-label="Direct link to Key findings" title="Direct link to Key findings">​</a></h2>
<ul>
<li><strong>Half the bill.</strong> $12,249 saved on $23,985 of would-be flagship spend, a 51.1% reduction</li>
<li><strong>95% of requests never needed the flagship tier.</strong> Blended cost landed at $1.66 per 1M tokens against $3.39 per 1M at the flagship</li>
<li><strong>The savings rate kept climbing</strong>, from 42.9% in the first full month to 60.7% by August, as the team tuned the tier maps</li>
<li><strong>Nothing changed in their applications.</strong> Users kept calling one model name and the router picked the tier</li>
</ul>
<table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>Requests through the auto-routers</td><td>272,876</td></tr><tr><td>Tokens</td><td>7.08 B</td></tr><tr><td>Distinct end users</td><td>450+</td></tr><tr><td>Window</td><td>2026-04-15 to 2026-08-09</td></tr><tr><td><strong>Actual spend</strong></td><td><strong>$11,736</strong></td></tr><tr><td>Cost if every request had gone to the top tier</td><td>$23,985</td></tr><tr><td><strong>Saved</strong></td><td><strong>$12,249 (51.1%)</strong></td></tr></tbody></table>
<p>That 95% number is the whole thesis. Nineteen out of twenty requests did not need the biggest model, and nobody had to decide that by hand.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="three-routers-three-model-families">Three routers, three model families<a href="https://docs.litellm.ai/blog/auto-router-production-savings#three-routers-three-model-families" class="hash-link" aria-label="Direct link to Three routers, three model families" title="Direct link to Three routers, three model families">​</a></h2>
<p>The Auto-Router works across Anthropic, Gemini, and GPT, so they ran one complexity router per model family and let their users pick a family rather than a model.</p>
<p>Key findings:</p>
<ul>
<li>Largest absolute savings came from the busiest and most expensive router</li>
<li>GPT family (<code>gpt-auto-latest</code>) recorded the largest relative savings between its flagship and cheap tier</li>
</ul>
<table><thead><tr><th>Router</th><th>Requests</th><th>Spent</th><th>Saved</th><th>Savings</th></tr></thead><tbody><tr><td><code>claude-auto-latest</code></td><td>109,675</td><td>$8,997</td><td>$7,951</td><td><strong>46.9%</strong></td></tr><tr><td><code>gemini-auto-latest</code></td><td>90,294</td><td>$1,327</td><td>$1,280</td><td><strong>49.1%</strong></td></tr><tr><td><code>gpt-auto-latest</code></td><td>72,906</td><td>$1,412</td><td>$3,019</td><td><strong>68.1%</strong></td></tr></tbody></table>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="it-got-better-every-month">It got better every month<a href="https://docs.litellm.ai/blog/auto-router-production-savings#it-got-better-every-month" class="hash-link" aria-label="Direct link to It got better every month" title="Direct link to It got better every month">​</a></h2>
<p>The savings rate is still climbing as the tier maps mature.</p>
<table><thead><tr><th>Month</th><th>Saved</th><th>Savings rate</th></tr></thead><tbody><tr><td>2026-05</td><td>$2,282</td><td>42.9%</td></tr><tr><td>2026-06</td><td>$3,274</td><td>50.0%</td></tr><tr><td>2026-07</td><td>$4,917</td><td>53.7%</td></tr><tr><td>2026-08 (to the 9th)</td><td>$1,769</td><td><strong>60.7%</strong></td></tr></tbody></table>
<ul>
<li>Month one already returned 43%, which is the install-it-and-walk-away number</li>
<li>Four months in they are at <strong>60.7%</strong></li>
<li>The difference is tuning. As the team learned which prompts belonged in which tier, they adjusted the maps</li>
</ul>
<p>Day-one value is real, and it compounds.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-it-was-measured">How it was measured<a href="https://docs.litellm.ai/blog/auto-router-production-savings#how-it-was-measured" class="hash-link" aria-label="Direct link to How it was measured" title="Direct link to How it was measured">​</a></h2>
<p>This is production traffic rather than a curated benchmark. 450+ real people, every environment including dev and staging with all the messy traffic that implies, four months rather than a single afternoon, and no prompt curation at all; whatever users typed is what got routed.</p>
<p>The method matters as much as the number, so here it is in full.</p>
<ul>
<li>Numbers come straight from <strong><code>LiteLLM_SpendLogs</code></strong>, with no sampling and no estimation</li>
<li>Every row records the requested <code>model_group</code>, the model the router <strong>actually</strong> served, and the full token split: fresh input, cache read, cache write, output</li>
<li>For each request, the <strong>exact same tokens</strong>, with the same cache read and write split, are re-priced at that router's <strong>REASONING-tier model</strong></li>
<li>That re-price is the counterfactual, meaning "what if we had always called the flagship"</li>
<li>Prices come from <strong>the same loaded LiteLLM cost map</strong> that produced the recorded spend, so both sides are like-for-like USD list price</li>
<li>Flagship prices did not change over the window (opus $5/$25, gemini pro $2/$12, gpt flagship $5/$30 per 1M), so the baseline needs no time-varying assumption</li>
</ul>
<p>Two caveats belong with the number:</p>
<ol>
<li><strong>This is a model, not an A/B test.</strong> It assumes the flagship would have emitted the same number of output tokens. Flagships usually emit more, because of reasoning tokens, so 51% is a conservative floor rather than a ceiling</li>
<li><strong>Prices are USD list prices</strong> from the cost map, not the customer's invoiced amounts</li>
</ol>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="the-config">The config<a href="https://docs.litellm.ai/blog/auto-router-production-savings#the-config" class="hash-link" aria-label="Direct link to The config" title="Direct link to The config">​</a></h2>
<p>This is the shape they deployed, one router per model family:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockTitle_OeMC">config.yaml</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain">           </span><span class="token comment" style="color:rgb(0, 128, 0)"># $1 / $5 per 1M tokens</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain">            </span><span class="token comment" style="color:rgb(0, 128, 0)"># $3 / $15</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain">              </span><span class="token comment" style="color:rgb(0, 128, 0)"># $5 / $25</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">auto</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">latest</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> auto_router/complexity_router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">tiers</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">SIMPLE</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">MEDIUM</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">COMPLEX</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">   claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">REASONING</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_default_model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><br></span></code></pre></div></div>
<p>Note that SIMPLE and MEDIUM both point at the cheapest model rather than doubling up on the flagship, which is where most of the 95% below-flagship share comes from. The flagship stays reserved for the REASONING tier, which is also the tier the counterfactual prices against.</p>
<p>Point a client at <code>claude-auto-latest</code> and every response carries <code>x-litellm-model-name</code> and <code>x-litellm-response-cost</code>, which is the same instrumentation this study was built on. Full reference, including the classifier and tier-boundary knobs, on the <a href="https://docs.litellm.ai/docs/proxy/auto_routing">Auto Routing docs page</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="try-it">Try it<a href="https://docs.litellm.ai/blog/auto-router-production-savings#try-it" class="hash-link" aria-label="Direct link to Try it" title="Direct link to Try it">​</a></h2>
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_BuS1"><p>Point an agent at an auto router and compare it against your current single model on your own workload. Share numbers or questions in <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>. To work on this with us directly, <a href="https://calendar.app.google/i2e7qVEJphHi5S8UA" target="_blank" rel="noopener noreferrer">apply to be a design partner</a>.</p></div></div>]]></content>
        <author>
            <name>Tin Lo</name>
        </author>
        <category label="routing" term="routing"/>
        <category label="complexity-router" term="complexity-router"/>
        <category label="cost" term="cost"/>
        <category label="case-study" term="case-study"/>
        <category label="engineering" term="engineering"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Auto Router: Opus level quality at up to 27% lower cost]]></title>
        <id>https://docs.litellm.ai/blog/auto-router-terminal-bench-benchmark</id>
        <link href="https://docs.litellm.ai/blog/auto-router-terminal-bench-benchmark"/>
        <updated>2026-08-08T10:00:00.000Z</updated>
        <summary type="html"><![CDATA[On a 21 task subset of Terminal-Bench 2.0, an auto router matched Claude Opus-5 solve rate at 27% lower cost. Adding the last 3 user messages as classifier context raised relative quality 14% but cost 44% more; adding assistant replies made both worse.]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="Auto Router: Opus level quality at 27% less cost, on a 21 task subset of Terminal-Bench 2.0" src="https://docs.litellm.ai/assets/images/hero-ae82a5735050b96c082cf035e2878b50.png" width="2400" height="1260" class="img_ev3q"></p>
<p><strong>An auto router matched Claude Opus-5 solve rate on a 21 task subset of Terminal-Bench 2.0 at 27% lower cost.</strong> Every arm ran the same 21 tasks, so the comparisons are like for like.</p>
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>🚀 Help shape the Auto-Router</div><div class="admonitionContent_BuS1"><p>Get early access, work directly with the LiteLLM team, and influence the roadmap with your production traffic.</p><a class="button button--primary button--lg" style="background:#2e8555;border-color:#2e8555;color:#fff" href="https://calendar.app.google/i2e7qVEJphHi5S8UA">Apply to Become a Design Partner</a><br><br><p>Already testing it? Share your results in <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>.</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="key-findings">Key findings<a href="https://docs.litellm.ai/blog/auto-router-terminal-bench-benchmark#key-findings" class="hash-link" aria-label="Direct link to Key findings" title="Direct link to Key findings">​</a></h2>
<ul>
<li><strong>Opus level quality at 27% lower cost.</strong> The 5.4-mini classifier (single message context) router solved 16/21 tasks, the same as Opus-5, for $14.34 against $19.74</li>
<li><strong>Instead of increasing context-window, consider a better model</strong> Going from 1-message context to the last 3 user messages took the 4o-mini router from 66.7% to 76.2%, and cost from $12.86 to $18.58: +14% relative quality, +44% cost. GPT 5.4-mini classifier with 1-message context beats these results at lower cost.</li>
<li><strong>Context slows tasks down.</strong> Median wall clock per task went from 6.8 min to 8.3 min when adding 3-6 messages as context</li>
<li><strong>Adding assistant replies isn't worth it.</strong> A window of 6 messages including LLM replies <em>dropped</em> relative quality 7% (66.7% to 61.9%) and raised cost 34%</li>
<li><strong>The heuristic router is a good value option.</strong> 87% of Opus quality at 56% of the cost, with no classifier call and the lowest median wall clock of any arm</li>
</ul>
<p><img decoding="async" loading="lazy" alt="Routers vs single models: quality against total cost on Terminal-Bench 2.0" src="https://docs.litellm.ai/assets/images/routers-vs-single-models-00537efb2b208a462fed6b6fdc4243bd.png" width="2248" height="1192" class="img_ev3q"></p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="results">Results<a href="https://docs.litellm.ai/blog/auto-router-terminal-bench-benchmark#results" class="hash-link" aria-label="Direct link to Results" title="Direct link to Results">​</a></h2>
<table><thead><tr><th>Configuration</th><th style="text-align:right">Solve rate</th><th style="text-align:right">Solved/n</th><th style="text-align:right">Total cost</th><th style="text-align:right">$/solved</th><th style="text-align:right">Median task wall clock</th><th style="text-align:right">p95 turn</th><th>Haiku/Sonnet/Opus</th><th style="text-align:right">Switch rate</th><th style="text-align:right">Cache hit</th></tr></thead><tbody><tr><td>Router: 5.4-mini</td><td style="text-align:right">76.2%</td><td style="text-align:right">16/21</td><td style="text-align:right"><strong>$14.34</strong></td><td style="text-align:right">$0.90</td><td style="text-align:right">6.7 min</td><td style="text-align:right">62.8s</td><td>20%/39%/40%</td><td style="text-align:right">54%</td><td style="text-align:right">78%</td></tr><tr><td>Router: 4o-mini (3 user)</td><td style="text-align:right">76.2%</td><td style="text-align:right">16/21</td><td style="text-align:right">$18.58</td><td style="text-align:right">$1.16</td><td style="text-align:right">8.3 min</td><td style="text-align:right">67.9s</td><td>18%/36%/45%</td><td style="text-align:right">55%</td><td style="text-align:right">78%</td></tr><tr><td>Opus-5 only</td><td style="text-align:right">76.2%</td><td style="text-align:right">16/21</td><td style="text-align:right">$19.74</td><td style="text-align:right">$1.23</td><td style="text-align:right">6.4 min</td><td style="text-align:right">94.6s</td><td>0%/0%/99%</td><td style="text-align:right">4%</td><td style="text-align:right">89%</td></tr><tr><td>Router: heuristic</td><td style="text-align:right">66.7%</td><td style="text-align:right">14/21</td><td style="text-align:right">$11.11</td><td style="text-align:right">$0.79</td><td style="text-align:right">5.6 min</td><td style="text-align:right">43.3s</td><td>32%/53%/14%</td><td style="text-align:right">48%</td><td style="text-align:right">83%</td></tr><tr><td>Router: 4o-mini (1-message)</td><td style="text-align:right">66.7%</td><td style="text-align:right">14/21</td><td style="text-align:right">$12.86</td><td style="text-align:right">$0.92</td><td style="text-align:right">6.8 min</td><td style="text-align:right">53.1s</td><td>33%/34%/34%</td><td style="text-align:right">58%</td><td style="text-align:right">79%</td></tr><tr><td>Router: 4o-mini (6 both)</td><td style="text-align:right">61.9%</td><td style="text-align:right">13/21</td><td style="text-align:right">$17.23</td><td style="text-align:right">$1.33</td><td style="text-align:right">6.3 min</td><td style="text-align:right">112.3s</td><td>5%/50%/44%</td><td style="text-align:right">46%</td><td style="text-align:right">80%</td></tr><tr><td>Sonnet-5 only</td><td style="text-align:right">57.1%</td><td style="text-align:right">12/21</td><td style="text-align:right">$9.76</td><td style="text-align:right">$0.81</td><td style="text-align:right">8.5 min</td><td style="text-align:right">60.5s</td><td>0%/99%/0%</td><td style="text-align:right">1%</td><td style="text-align:right">93%</td></tr><tr><td>Haiku-4.5 only</td><td style="text-align:right">33.3%</td><td style="text-align:right">7/21</td><td style="text-align:right">$4.24</td><td style="text-align:right">$0.61</td><td style="text-align:right">4.9 min</td><td style="text-align:right">12.6s</td><td>100%/0%/0%</td><td style="text-align:right">0%</td><td style="text-align:right">93%</td></tr></tbody></table>
<p>Cost is the total for all 21 tasks and includes the classifier call, which ran between $0.05 and $0.34 depending on the classifier.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="breakdown-of-context-window-results">Breakdown of Context Window Results<a href="https://docs.litellm.ai/blog/auto-router-terminal-bench-benchmark#breakdown-of-context-window-results" class="hash-link" aria-label="Direct link to Breakdown of Context Window Results" title="Direct link to Breakdown of Context Window Results">​</a></h2>
<p><code>1-message</code> sends only the current user message to the classifier. <code>3 user</code> sends the last 3 user messages. <code>6 both</code> sends the last 6 messages including assistant replies. All three use the same 4o-mini classifier and the same tier mapping, so the only variable is what the classifier reads. 5.4-mini with no context beat all, overall.</p>
<table><thead><tr><th>Context window</th><th style="text-align:right">Solve rate</th><th style="text-align:right">Relative to 1-message</th><th style="text-align:right">Total cost</th><th style="text-align:right">Relative to 1-message</th><th style="text-align:right">Median task wall clock</th></tr></thead><tbody><tr><td>1-message</td><td style="text-align:right">66.7%</td><td style="text-align:right">reference</td><td style="text-align:right">$12.86</td><td style="text-align:right">reference</td><td style="text-align:right">6.8 min</td></tr><tr><td>Last 3 user messages</td><td style="text-align:right">76.2%</td><td style="text-align:right">+14%</td><td style="text-align:right">$18.58</td><td style="text-align:right">+44%</td><td style="text-align:right">8.3 min</td></tr><tr><td>Last 6 messages, user and assistant</td><td style="text-align:right">61.9%</td><td style="text-align:right">-7%</td><td style="text-align:right">$17.23</td><td style="text-align:right">+34%</td><td style="text-align:right">6.3 min</td></tr></tbody></table>
<p>Prior user turns tell the classifier what the task actually is, so it escalates to Opus on the turns that need it: the Opus share goes from 34% to 45%, which is where most of the extra cost comes from. Assistant replies pull in tool output and long generated text that read as complexity signal without adding task intent; that arm routed almost nothing to Haiku (5%) yet still scored worst of the three.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-it-was-measured">How it was measured<a href="https://docs.litellm.ai/blog/auto-router-terminal-bench-benchmark#how-it-was-measured" class="hash-link" aria-label="Direct link to How it was measured" title="Direct link to How it was measured">​</a></h2>
<ul>
<li><strong>Benchmark:</strong> a 21 task subset of Terminal-Bench 2.0, completed by all 8 arms: adaptive-rejection-sampler, build-pmars, chess-best-move, cobol-modernization, crack-7z-hash, filter-js-from-html, gcode-to-text, install-windows-3.11, largest-eigenval, llm-inference-batching-scheduler, merge-diff-arc-agi-task, multi-source-data-merger, overfull-hbox, password-recovery, polyglot-c-py, prove-plus-comm, pypi-server, sparql-university, train-fasttext, winning-avg-corewars, write-compressor</li>
<li><strong>Router arms:</strong> one model group, four tiers. SIMPLE to <code>claude-haiku-4-5</code>, MEDIUM to <code>claude-sonnet-5</code>, COMPLEX and REASONING to <code>claude-opus-5</code>. Classifier is either the heuristic or an LLM (<code>gpt-4o-mini</code>, <code>gpt-5.4-mini</code>)</li>
<li><strong>Baseline arms:</strong> every request to one fixed model, with prompt caching on in all arms</li>
<li><strong>Cost:</strong> total USD across all 21 tasks from gateway spend logs, classifier calls included</li>
<li><strong>Errors:</strong> 0 to 4 per arm, from harness and provider failures, excluded from solve rate denominators only where the task did not complete for that arm</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="config">Config<a href="https://docs.litellm.ai/blog/auto-router-terminal-bench-benchmark#config" class="hash-link" aria-label="Direct link to Config" title="Direct link to Config">​</a></h2>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockTitle_OeMC">config.yaml</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> smart</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> auto_router/complexity_router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">tiers</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">SIMPLE</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">MEDIUM</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">COMPLEX</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">   claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">REASONING</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_type</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> llm</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_llm_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5.4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_context_window_size</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(9, 134, 88)">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_default_model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><br></span></code></pre></div></div>
<p>Every response carries <code>x-litellm-model-name</code> and <code>x-litellm-response-cost</code>, and per router cost and usage land in the Auto-Router Benchmarks tab. Full reference on the <a href="https://docs.litellm.ai/docs/proxy/auto_routing">Auto Routing docs page</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="try-it">Try it<a href="https://docs.litellm.ai/blog/auto-router-terminal-bench-benchmark#try-it" class="hash-link" aria-label="Direct link to Try it" title="Direct link to Try it">​</a></h2>
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_BuS1"><p>Point an agent at an auto router and compare it against your current single model on your own workload. Share numbers or questions in <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>. To work on this with us directly, <a href="https://calendar.app.google/i2e7qVEJphHi5S8UA" target="_blank" rel="noopener noreferrer">apply to be a design partner</a>.</p></div></div>]]></content>
        <author>
            <name>Tin Lo</name>
        </author>
        <category label="routing" term="routing"/>
        <category label="complexity-router" term="complexity-router"/>
        <category label="cost" term="cost"/>
        <category label="benchmarks" term="benchmarks"/>
        <category label="engineering" term="engineering"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[AutoRouter: Easy Visibility to Your Savings]]></title>
        <id>https://docs.litellm.ai/blog/auto-router-spend-visibility</id>
        <link href="https://docs.litellm.ai/blog/auto-router-spend-visibility"/>
        <updated>2026-08-06T10:00:00.000Z</updated>
        <summary type="html"><![CDATA[A new Auto-Router Usage tab in Cost Optimization, per-request classifier cost reporting, preset matching against your own deployments, and two routing fixes.]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="Your savings, in one tab" src="https://docs.litellm.ai/assets/images/auto-router-v2-hero-df07fbab3e9c36de67cdb1cbff00ba24.png" width="2400" height="1260" class="img_ev3q"></p>
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>🚀 Help shape the Auto-Router</div><div class="admonitionContent_BuS1"><p>Get early access, work directly with the LiteLLM team, and influence the roadmap with your production traffic.</p><a class="button button--primary button--lg" style="background:#2e8555;border-color:#2e8555;color:#fff" href="https://calendar.app.google/i2e7qVEJphHi5S8UA">Apply to Become a Design Partner</a><br><br><p>Already testing it? Share your results in <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>.</p></div></div>
<p>Everything below ships in <strong>v1.97.x</strong>.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="see-auto-router-savings--usage-benchmarked-against-a-relevant-model">See Auto-Router savings + usage benchmarked against a relevant model<a href="https://docs.litellm.ai/blog/auto-router-spend-visibility#see-auto-router-savings--usage-benchmarked-against-a-relevant-model" class="hash-link" aria-label="Direct link to See Auto-Router savings + usage benchmarked against a relevant model" title="Direct link to See Auto-Router savings + usage benchmarked against a relevant model">​</a></h2>
<p>The most common question from teams piloting the Auto-Router is "how much is this actually saving me". There is now a tab that answers it.</p>
<p>Cost Optimization has a new <strong>Auto-Router Usage</strong> tab. It covers the last 24 hours, 7 days, or 30 days, for a single router or all routers combined, and shows:</p>
<ul>
<li><strong>Total estimated savings:</strong> in $ and %, with your actual routed spend next to what the same traffic would have cost if every request went to the most expensive model in the router. It prices the router against the "just always use the best model" setup it replaces, and the estimate accounts for caching in both directions</li>
<li><strong>Usage:</strong> total sessions and turns on the Auto-Router, plus per-session averages for spend, turns, duration, and tokens</li>
<li><strong>Prompt caching:</strong> the overall cache hit rate, broken down by what the router did on each turn (stayed on the same model, first visit to a tier, or returned to a tier used earlier), so you can tell whether a longer cache TTL or a background cache warmer would pay for itself</li>
</ul>
<p>The numbers come from a new per-session rollup table so the tab stays fast at scale; in our load tests, a 30-day window over 400k sessions reads in 38 ms.</p>
<p><img decoding="async" loading="lazy" alt="The Auto-Router Usage tab in Cost Optimization" src="https://docs.litellm.ai/assets/images/auto-router-usage-tab-983d5e3ebc66cc60dd2870cd1620a8a2.png" width="2176" height="1934" class="img_ev3q"></p>
<p>Next up: benchmarking the Auto-Router quality and # of turns against equivalent usage for your org.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="per-request-logging-of-the-llm-classifier-cost">Per-request logging of the LLM classifier cost<a href="https://docs.litellm.ai/blog/auto-router-spend-visibility#per-request-logging-of-the-llm-classifier-cost" class="hash-link" aria-label="Direct link to Per-request logging of the LLM classifier cost" title="Direct link to Per-request logging of the LLM classifier cost">​</a></h2>
<p>When the complexity router uses an LLM classifier, that classifier call is billed, but until now it was invisible on the request that triggered it. You can now quantify routing overhead per request.</p>
<ul>
<li>The classifier call's cost is recorded on the <code>routing_decision</code> record as <code>classifier_cost</code>, so it reaches spend-log metadata and every <code>StandardLoggingPayload</code> consumer (Langfuse, OTel, S3, and the rest)</li>
<li>A new <code>x-litellm-classifier-cost</code> response header reports it per request on <code>/v1/chat/completions</code>, <code>/v1/messages</code> and <code>/v1/responses</code>, streaming included</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="presets-now-match-your-actual-deployments">Presets now match your actual deployments<a href="https://docs.litellm.ai/blog/auto-router-spend-visibility#presets-now-match-your-actual-deployments" class="hash-link" aria-label="Direct link to Presets now match your actual deployments" title="Direct link to Presets now match your actual deployments">​</a></h2>
<p>The 1-click Anthropic and OpenAI presets no longer depend on your deployment names lining up with what the preset expects.</p>
<ul>
<li>Presets now resolve against your deployment's underlying provider model ID (<code>litellm_params.model</code>, plus <code>model_info.base_model</code> where set) instead of a direct string match on the name</li>
<li>Presets that resolve this way show a "Matches your deployments" hint, sort ahead of unavailable ones, and keep the config open so you see what got mapped</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="long-prompts-no-longer-fail-at-the-routing-step">Long prompts no longer fail at the routing step<a href="https://docs.litellm.ai/blog/auto-router-spend-visibility#long-prompts-no-longer-fail-at-the-routing-step" class="hash-link" aria-label="Direct link to Long prompts no longer fail at the routing step" title="Direct link to Long prompts no longer fail at the routing step">​</a></h2>
<p>Previously, when using semantic routing long prompts could fail due to an embedding-model's short context window.</p>
<ul>
<li>The prompt is now truncated before embedding, at 2000 characters by default, tunable per deployment with <code>auto_router_max_input_chars</code>.</li>
<li>The truncation applies to the routing step only; guardrails and filters still see the whole prompt</li>
<li>Every no-match and route-failure path now resolves to <code>default_model</code> instead of erroring</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="keyword-based-routing-now-supports-chinese-japanese-and-korean-characters">Keyword-based routing now supports Chinese, Japanese and Korean characters<a href="https://docs.litellm.ai/blog/auto-router-spend-visibility#keyword-based-routing-now-supports-chinese-japanese-and-korean-characters" class="hash-link" aria-label="Direct link to Keyword-based routing now supports Chinese, Japanese and Korean characters" title="Direct link to Keyword-based routing now supports Chinese, Japanese and Korean characters">​</a></h2>
<p><code>keyword_tier_rules</code> matched on regex word boundaries, which do not exist between CJK characters, so a rule on <code>发票</code> never fired inside <code>我需要开发票</code>. That traffic silently fell through to complexity scoring.</p>
<ul>
<li>Keywords containing CJK characters now match as substrings</li>
<li>Latin keywords keep word-boundary matching unchanged</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="try-it">Try it<a href="https://docs.litellm.ai/blog/auto-router-spend-visibility#try-it" class="hash-link" aria-label="Direct link to Try it" title="Direct link to Try it">​</a></h2>
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_BuS1"><p>Open Cost Optimization in the dashboard and pick the Auto-Router Usage tab. Questions and results in <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>, or <a href="https://calendar.app.google/i2e7qVEJphHi5S8UA" target="_blank" rel="noopener noreferrer">apply to be a design partner</a> to work on the Auto-Router with us directly.</p></div></div>
<p>Full reference on the <a href="https://docs.litellm.ai/docs/proxy/auto_routing">Auto Routing docs page</a>.</p>]]></content>
        <author>
            <name>Tin Lo</name>
        </author>
        <category label="routing" term="routing"/>
        <category label="complexity-router" term="complexity-router"/>
        <category label="cost-optimization" term="cost-optimization"/>
        <category label="ui" term="ui"/>
        <category label="engineering" term="engineering"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[AutoRouter: 1 Click Deploy]]></title>
        <id>https://docs.litellm.ai/blog/auto-router-setup-and-testing</id>
        <link href="https://docs.litellm.ai/blog/auto-router-setup-and-testing"/>
        <updated>2026-08-05T10:00:00.000Z</updated>
        <summary type="html"><![CDATA[Six changes to the Auto-Router: 1-click Anthropic and OpenAI presets, a one-line agent setup skill, Test Routing in the UI, a replaceable classifier prompt, customizable tiers, and configurable reminder markers.]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="LiteLLM Autorouter V2: always use the latest models" src="https://docs.litellm.ai/assets/images/hero-5b0c02502e1bcdd7fc7aa7eccdf60370.png" width="1200" height="630" class="img_ev3q"></p>
<p>We've made it easier than ever to setup and test your Auto-Router, and with customizable tier names + classifier system prompts you can go beyond complexity routing.</p>
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Availability</div><div class="admonitionContent_BuS1"><p>Everything below ships in <strong>v1.97.x</strong>.</p></div></div>
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>🚀 Help shape the Auto-Router</div><div class="admonitionContent_BuS1"><p>Get early access, work directly with the LiteLLM team, and influence the roadmap with your production traffic.</p><a class="button button--primary button--lg" style="background:#2e8555;border-color:#2e8555;color:#fff" href="https://calendar.app.google/i2e7qVEJphHi5S8UA">Apply to Become a Design Partner</a><br><br><p>Already testing it? Share your results in <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>.</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="1-click-presets-for-anthropic-and-openai-families">1-Click Presets for Anthropic and OpenAI Families<a href="https://docs.litellm.ai/blog/auto-router-setup-and-testing#1-click-presets-for-anthropic-and-openai-families" class="hash-link" aria-label="Direct link to 1-Click Presets for Anthropic and OpenAI Families" title="Direct link to 1-Click Presets for Anthropic and OpenAI Families">​</a></h2>
<p><img decoding="async" loading="lazy" alt="Add Auto Router form with the Anthropic Family template applied and the detailed configuration collapsed to a tier summary" src="https://docs.litellm.ai/assets/images/presets-0af17ba42e45c336d7872000165bf936.png" width="714" height="408" class="img_ev3q"></p>
<ul>
<li>Add Auto Router now opens on a name field and a <strong>Template</strong> dropdown: Anthropic family, OpenAI family, or Custom</li>
<li>Picking a family builds the whole config for you with the <strong>latest models</strong> in that family, so every tier is on current models without writing any YAML</li>
<li>The detail collapses behind a one-line tier summary; presets that reference a model your proxy doesn't serve grey out and tell you which one is missing</li>
<li>More families are coming; today Anthropic and OpenAI are covered, and Custom is there for everything else</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="let-your-agent-set-up-the-router">Let your agent set up the router<a href="https://docs.litellm.ai/blog/auto-router-setup-and-testing#let-your-agent-set-up-the-router" class="hash-link" aria-label="Direct link to Let your agent set up the router" title="Direct link to Let your agent set up the router">​</a></h2>
<p>Paste this into Claude Code, Codex, Cursor, or any agent with shell access:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">run curl -fsSL https://docs.litellm.ai/skills/auto-router and follow the instructions</span><br></span></code></pre></div></div>
<ul>
<li>It reads the models your proxy already serves, then interviews you for the router name and the model behind each tier</li>
<li>It writes the config for you, whether your proxy is file-based or DB-managed</li>
<li>Before finishing it lists the defaults it left in place, with what changing each one buys, and asks whether you want any changed</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="test-routing-in-the-ui-during-setup">Test Routing in the UI during setup<a href="https://docs.litellm.ai/blog/auto-router-setup-and-testing#test-routing-in-the-ui-during-setup" class="hash-link" aria-label="Direct link to Test Routing in the UI during setup" title="Direct link to Test Routing in the UI during setup">​</a></h2>
<ul>
<li><strong>Test Routing</strong> now sits beside Test Connection on the Add Auto Router form</li>
<li>Send a prompt, see the tier it lands in and why, against the config currently on screen</li>
<li>Nothing is created and nothing is sent to the routed model, so it costs nothing beyond your LLM classifier (if enabled)</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="replace-the-classifiers-system-prompt">Replace the classifier's system prompt<a href="https://docs.litellm.ai/blog/auto-router-setup-and-testing#replace-the-classifiers-system-prompt" class="hash-link" aria-label="Direct link to Replace the classifier's system prompt" title="Direct link to Replace the classifier's system prompt">​</a></h2>
<p>The LLM classifier shipped with one built-in rubric, so the router could only grade complexity. <code>classifier_llm_config.system_prompt</code> now allows you to define your own routing criteria, whether you want a more in-depth prompt for complexity or routing based on another criterion such as data sensitivity or model capability (vision, audio, image).</p>
<ul>
<li><code>classifier_fallback</code> decides what happens when classification fails: the heuristic scorer, or straight to <code>default_model</code></li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="customize-your-tiers">Customize your tiers<a href="https://docs.litellm.ai/blog/auto-router-setup-and-testing#customize-your-tiers" class="hash-link" aria-label="Direct link to Customize your tiers" title="Direct link to Customize your tiers">​</a></h2>
<p>Along with the above change, you can now change the tier names from the default: SIMPLE / MEDIUM / COMPLEX / REASONING. If your team prefers Fast / Standard / Premium / Deep or Image / Video / Audio / Text, an optional <code>tier_labels</code> map renames them.</p>
<ul>
<li>Names change in the dashboard, the spend logs, and the LLM classifier's rubric, so the classifier reasons in your vocabulary</li>
<li>Display-only. Config keys stay canonical, routing behavior doesn't move, and API callers never see these names</li>
<li>Partial maps are fine; unlisted tiers keep the default name</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="configurable-reminder-markers-easy-openclaw-integration">Configurable reminder markers, easy OpenClaw integration<a href="https://docs.litellm.ai/blog/auto-router-setup-and-testing#configurable-reminder-markers-easy-openclaw-integration" class="hash-link" aria-label="Direct link to Configurable reminder markers, easy OpenClaw integration" title="Direct link to Configurable reminder markers, easy OpenClaw integration">​</a></h2>
<p>The router strips harness-injected context before classifying, so a token-budget note doesn't get graded as the user's actual question. That marker pair was hardcoded to <code>&lt;system-reminder&gt;</code>; a new <code>reminder_markers</code> field lets harnesses like OpenClaw use their own markers.</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">complexity_router_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token key atrule">reminder_markers</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"&lt;&lt;&lt;begin_ctx&gt;&gt;&gt;"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"&lt;&lt;&lt;end_ctx&gt;&gt;&gt;"</span><br></span></code></pre></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="try-it">Try it<a href="https://docs.litellm.ai/blog/auto-router-setup-and-testing#try-it" class="hash-link" aria-label="Direct link to Try it" title="Direct link to Try it">​</a></h2>
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_BuS1"><p>Start with the one-line agent command, or open Add Model → Auto Router in the dashboard and pick a family preset. Questions and results in <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>, or <a href="https://calendar.app.google/i2e7qVEJphHi5S8UA" target="_blank" rel="noopener noreferrer">apply to be a design partner</a> to work on this with us directly.</p></div></div>
<p>Full reference on the <a href="https://docs.litellm.ai/docs/proxy/auto_routing">Auto Routing docs page</a>.</p>]]></content>
        <author>
            <name>Tin Lo</name>
        </author>
        <category label="routing" term="routing"/>
        <category label="complexity-router" term="complexity-router"/>
        <category label="ui" term="ui"/>
        <category label="engineering" term="engineering"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Auto Router v1.97: usage benchmarks and better quality for lower cost]]></title>
        <id>https://docs.litellm.ai/blog/auto-router-context-and-benchmarks</id>
        <link href="https://docs.litellm.ai/blog/auto-router-context-and-benchmarks"/>
        <updated>2026-08-04T10:00:00.000Z</updated>
        <summary type="html"><![CDATA[v1.97 adds cost and usage benchmarks for the auto router, gives the LLM classifier a window of prior turns, and turns session affinity off by default. Across 5,600 live classifier calls, prior turns raised tier agreement on referential follow-ups from 14% to 78% at under a tenth of a cent per request, with no measurable latency change.]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="LiteLLM Autorouter V2: routing accuracy on complex scenarios, 5.6x more accurate by reading the last N turns of the conversation before picking a model" src="https://docs.litellm.ai/assets/images/autorouter-v2-hero-540bd44400e62fda0fffb63cb41bc631.png" width="2400" height="1254" class="img_ev3q"></p>
<br>
<br>
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>🚀 Help shape the Auto-Router</div><div class="admonitionContent_BuS1"><p>Get early access, work directly with the LiteLLM team, and influence the roadmap with your production traffic.</p><a class="button button--primary button--lg" style="background:#2e8555;border-color:#2e8555;color:#fff" href="https://calendar.app.google/i2e7qVEJphHi5S8UA">Apply to Become a Design Partner</a><br><br><p>Already testing it? Share your results in <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>.</p></div></div>
<p>v1.97 makes three changes to the auto router.</p>
<ul>
<li>The LLM classifier now receives a window of prior conversation turns, defaulting to three. This improves accuracy of follow-up classifications from 14% to 78%, costs at most $0.61 per 1,000 requests, and no additional latency.</li>
<li>A new Benchmarks view prices routed traffic against an all-frontier baseline and reports the difference, and those savings now also appear in the Cost Optimization totals.</li>
<li>Session affinity is now off by default, following our <a href="https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark">previous post</a> showing this was leading to worse quality without cost improvements.</li>
</ul>
<div class="theme-admonition theme-admonition-warning admonition_xJq3 alert alert--warning"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Two defaults changed</div><div class="admonitionContent_BuS1"><p><code>classifier_context_window_size</code> now defaults to <code>3</code> (LLM classifier only), and <code>session_affinity</code> now defaults to <code>false</code> (all routers). Config files are not modified, but the new defaults apply to any key left unset, so a config that never mentioned <code>session_affinity</code> will reclassify every turn after upgrading. Configs that set either key explicitly are unaffected.</p></div></div>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="cost-and-usage-benchmarks">Cost and usage benchmarks<a href="https://docs.litellm.ai/blog/auto-router-context-and-benchmarks#cost-and-usage-benchmarks" class="hash-link" aria-label="Direct link to Cost and usage benchmarks" title="Direct link to Cost and usage benchmarks">​</a></h2>
<p>The Benchmarks view shows your savings using your router against a fixed model (Opus, for example) on your actual usage.</p>
<p><img decoding="async" loading="lazy" alt="Auto-Router Benchmarks tab showing total estimated savings against an all-frontier baseline, session counts, and prompt cache behaviour by bucket" src="https://docs.litellm.ai/assets/images/benchmarks-overview-50ed479481128ffa71a2873e359bf524.png" width="1505" height="1014" class="img_ev3q"></p>
<p>Per router and per time range, it prices routed traffic against the same traffic sent to one frontier model at list prices and reports the difference in dollars and percent, alongside: sessions on the router, turns per session, tokens per session, and savings per session. The baseline is priced with a warm single-model cache rather than a cold one.</p>
<p>The view also estimates the value of a background cache warmer on your traffic, netting rescued cache writes against the cost of the replays. The Benchmarks numbers are queryable directly:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">GET /auto_router/benchmarks?start_date=2026-07-01&amp;end_date=2026-07-31</span><br></span></code></pre></div></div>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="savings-roll-up-into-cost-optimization">Savings roll up into Cost Optimization<a href="https://docs.litellm.ai/blog/auto-router-context-and-benchmarks#savings-roll-up-into-cost-optimization" class="hash-link" aria-label="Direct link to Savings roll up into Cost Optimization" title="Direct link to Savings roll up into Cost Optimization">​</a></h3>
<p>Router savings now feed into the Cost Optimization section alongside prompt compression and prompt caching, with their own card, savings line, and slice of the by-driver breakdown.</p>
<p><img decoding="async" loading="lazy" alt="Cost Optimization usage tab showing total saved split across compression, prompt caching, and auto-router savings" src="https://docs.litellm.ai/assets/images/cost-optimization-acd9a53165c7c5d7ad9bcd487b4e53ce.png" width="4688" height="3064" class="img_ev3q"></p>
<p>The two views answer different questions and their savings figures will not match. Benchmarks prices traffic against one frontier model end to end; the Cost Optimization card counts the difference between the tier the router picked and the priciest tier it could have picked.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="the-llm-classifier-can-see-prior-turns">The LLM classifier can see prior turns<a href="https://docs.litellm.ai/blog/auto-router-context-and-benchmarks#the-llm-classifier-can-see-prior-turns" class="hash-link" aria-label="Direct link to The LLM classifier can see prior turns" title="Direct link to The LLM classifier can see prior turns">​</a></h2>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>Everything in this section requires <code>classifier_type: llm</code>. The heuristic scorer does not call a model and has nowhere to put the context, so it is unchanged; the three fields below are read only on the LLM path.</p></div></div>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="the-problem">The problem<a href="https://docs.litellm.ai/blog/auto-router-context-and-benchmarks#the-problem" class="hash-link" aria-label="Direct link to The problem" title="Direct link to The problem">​</a></h3>
<p>The LLM classifier previously only saw the current turn, which does not work well for multi-turn queries:</p>
<ul>
<li>Turn 1: "Make a plan to redesign this component"</li>
<li>Turn 2: "Yes, go ahead"</li>
</ul>
<p>Turn 2 may be classified as simple while the work it authorises is substantial.</p>
<p>Three new fields on <code>complexity_router_config</code> address this:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> auto_router/complexity_router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_type</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> llm</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_llm_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5.4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_context_window_size</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(9, 134, 88)">3</span><span class="token plain">                  </span><span class="token comment" style="color:rgb(0, 128, 0)"># default 3; 0 = old behavior</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_context_per_turn_chars</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(9, 134, 88)">200</span><span class="token plain">             </span><span class="token comment" style="color:rgb(0, 128, 0)"># default 200</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_context_include_assistant_turns</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token boolean important">false</span><span class="token plain">  </span><span class="token comment" style="color:rgb(0, 128, 0)"># default false</span><br></span></code></pre></div></div>
<p>Prior turns are inserted oldest-first, numbered <code>[1]</code>, <code>[2]</code>, <code>[3]</code>, each clipped to <code>classifier_context_per_turn_chars</code> with a trailing ellipsis marking the cut.</p>
<p>Turns without human-written text do not consume a slot. Tool output is excluded, <code>&lt;system-reminder&gt;</code> blocks are stripped, turns left empty after stripping are skipped, and a turn identical to the ask being classified is dropped.</p>
<p>With <code>classifier_context_include_assistant_turns</code> enabled, assistant messages join the window with role labels, and that text reaches the classifier payload only; keyword rules, escalation, the heuristic scorer, and semantic matching continue to read the human message alone.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="what-we-measured">What we measured<a href="https://docs.litellm.ai/blog/auto-router-context-and-benchmarks#what-we-measured" class="hash-link" aria-label="Direct link to What we measured" title="Direct link to What we measured">​</a></h3>
<p>5,600 live classifier calls against real providers: two sweeps of seven configurations each (<code>classifier_context_window_size</code> of 0, 1, 2, 3, 5, 8, 10), one with assistant turns in the window and one without, across three multi-turn datasets, with two repeats per conversation. Everything else was identical between configurations, including the conversations, the rubric, the classifier model (<code>gpt-5.4-mini</code>), and the per-turn cap.</p>
<p><strong>Quality.</strong> Agreement between the tier the router picked and the reference tier:</p>
<table><thead><tr><th>Window</th><th>Short-reply follow-ups</th><th>MT-Bench 2nd turns</th><th>ShareGPT multi-turn</th></tr></thead><tbody><tr><td>0</td><td>50.0%</td><td>49.4%</td><td>83.8%</td></tr><tr><td>1</td><td>71.2%</td><td>53.1%</td><td>84.4%</td></tr><tr><td>2</td><td>87.5%</td><td>53.1%</td><td>90.6%</td></tr><tr><td><strong>3</strong> <em>(default)</em></td><td><strong>85.0%</strong></td><td><strong>55.0%</strong></td><td><strong>91.9%</strong></td></tr><tr><td>5</td><td>86.2%</td><td>53.8%</td><td>91.9%</td></tr><tr><td>8</td><td>87.5%</td><td>55.6%</td><td>91.2%</td></tr><tr><td>10</td><td>90.0%</td><td>55.6%</td><td>88.8%</td></tr></tbody></table>
<p>The largest effect is on the 36 follow-ups whose final turn only resolves against the history. Agreement there is <strong>14% at N=0, 47% at N=1, and 78% at N=2</strong>, and flat from there out to N=10. Self-describing controls in the same set sit at 80% with no window and 91 to 95% with one, so the window is not raising every number uniformly.</p>
<p>N=1 recovers less than half the gap. One prior turn tells the classifier that a conversation exists without establishing its subject, and roughly a third of referential cases remain misrouted at that setting.</p>
<p>MT-Bench's ceiling reflects its reference labels rather than router behaviour. Its category-to-tier mapping assigns MEDIUM to every "writing" second turn, so that column is usable as a trend and not as an accuracy score.</p>
<p><img decoding="async" loading="lazy" alt="Agreement against window size across three datasets" src="https://docs.litellm.ai/assets/images/agreement-vs-window-ba57aca31e3c9e8f5c8c7622d64d6ddb.png" width="1360" height="748" class="img_ev3q"></p>
<p><strong>Latency.</strong> Paired per conversation against N=0, every 95% bootstrap CI contains <strong>zero</strong> in both sweeps:</p>
<table><thead><tr><th>Window</th><th>Assistant turns on</th><th>Assistant turns off</th></tr></thead><tbody><tr><td>1</td><td>+21.5 ms [-19.6, +63.9]</td><td>-17.8 ms [-68.9, +29.6]</td></tr><tr><td>2</td><td>+10.5 ms [-31.2, +55.2]</td><td>-14.3 ms [-67.2, +34.4]</td></tr><tr><td>3</td><td>+6.2 ms [-30.0, +43.0]</td><td>-10.8 ms [-61.1, +37.1]</td></tr><tr><td>5</td><td>+6.0 ms [-37.5, +52.6]</td><td>+11.7 ms [-40.6, +61.9]</td></tr><tr><td>8</td><td>-10.5 ms [-45.0, +23.9]</td><td>+10.2 ms [-43.6, +63.9]</td></tr><tr><td>10</td><td>+9.0 ms [-25.9, +43.1]</td><td>-15.3 ms [-65.6, +30.0]</td></tr></tbody></table>
<p>Prompt tokens and latency correlate at r = 0.007 with assistant turns on and r = 0.018 with them off, across a 318 to 1,043 token range. The window adds prefill only; output remains a small fixed structured tier. p50 sits near 600 ms in every configuration.</p>
<p><strong>Cost.</strong> The classifier costs at most $0.61 per 1,000 requests:</p>
<table><thead><tr><th>Window</th><th>Classifier $/1k req (follow-ups / MT-Bench / ShareGPT)</th><th>Modelled routed $/1k req</th></tr></thead><tbody><tr><td>0</td><td>$0.31 / $0.32 / $0.34</td><td>$2.87 / $5.41 / $5.48</td></tr><tr><td>2</td><td>$0.38 / $0.42 / $0.44</td><td>$6.79 / $4.65 / $5.31</td></tr><tr><td>3</td><td>$0.38 / $0.42 / $0.47</td><td>$6.49 / $5.13 / $5.14</td></tr><tr><td>10</td><td>$0.38 / $0.42 / $0.61</td><td>$6.42 / $4.87 / $5.22</td></tr></tbody></table>
<p>Tier selection dominates the cost effect, and it moves in both directions depending on the traffic.</p>
<p>On the short-reply set, routed cost rises from $2.87 to about $6.50 per 1k. At N=0 those requests went to the cheap tier while authorising substantial work, with a tier mix of 66% SIMPLE at N=0 against 30% at N=2, so the increase reflects requests being priced at the tier they required. On MT-Bench and ShareGPT routed cost drifts down instead, as context resolves ambiguous follow-ups to MEDIUM rather than REASONING.</p>
<p>Which direction applies to a given deployment depends on its traffic, which is what the Benchmarks view is for: compare routed spend against the baseline after a day of traffic.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="what-to-run">What to run<a href="https://docs.litellm.ai/blog/auto-router-context-and-benchmarks#what-to-run" class="hash-link" aria-label="Direct link to What to run" title="Direct link to What to run">​</a></h3>
<p>The default of 3 sits past the point where every curve flattens, and additional classifier tokens beyond it produce no measurable gain. The tables above come from the assistant-turns-on sweep; the user-only sweep, which is the default, plateaus one slot earlier because an assistant turn otherwise consumes a slot, so 3 is sufficient in both modes.</p>
<p><code>classifier_context_include_assistant_turns</code> ships off because enabling it shifts tier decisions, and therefore spend, on routers already in production.</p>
<p><code>classifier_context_per_turn_chars</code> is best left at 200. The plateau arrives well before the cap takes effect, and the truncation marker is sufficient signal that a turn was cut.</p>
<details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Caveats</summary><div><div class="collapsibleContent_i85q"><p>Reference tiers are judgement calls. The hand labels and the ShareGPT judge pass both encode the rule that a short reply inherits the difficulty of the work it approves, which is the behaviour the window produces, making the follow-up set both the sharpest instrument here and the most favourable one.</p><p>Routed completion cost is modelled rather than billed: the chosen tier's price applied to the conversation's prompt tokens plus 600 output tokens. No tier model was called, which isolates the effect of the tier choice from the effect of any particular answer.</p><p>One classifier model was swept. A reasoning-heavier model carries more absolute latency, though the marginal cost of roughly 200 extra prefill tokens should remain negligible.</p><p>Latency was measured on a single VM at concurrency 10. The paired differences carry the finding; the absolute numbers reflect that setup.</p></div></div></details>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="session-affinity-now-off-by-default">Session affinity now off by default<a href="https://docs.litellm.ai/blog/auto-router-context-and-benchmarks#session-affinity-now-off-by-default" class="hash-link" aria-label="Direct link to Session affinity now off by default" title="Direct link to Session affinity now off by default">​</a></h2>
<p>Session affinity pins a session to the model that handled its first turn and skips reclassification thereafter, with the goal of keeping provider prompt caches warm. Two things motivated the change of default.</p>
<p>Our <a href="https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark">prompt caching benchmark</a> examined 4,684 switch-backs and found 97.4% still warm at the 5-minute TTL and 99.3% at an hour. Provider caches survive routing changes well enough that pinning was trading routing quality for cache hits that would have occurred anyway.</p>
<p>Additionally, pinning served in part as a substitute for a classifier without access to conversation history, which is no longer needed.</p>
<p>Configs that do not mention <code>session_affinity</code> will classify every turn after upgrading. To retain the previous behaviour, for strict per-session model consistency or for prefixes long enough that a miss is expensive, set it explicitly:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">session_affinity</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">session_affinity_ttl_seconds</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(9, 134, 88)">3600</span><br></span></code></pre></div></div>
<p>Affinity requires a resolvable <code>session_id</code> in metadata and is ignored when <code>plugins</code> are set.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="try-it">Try it<a href="https://docs.litellm.ai/blog/auto-router-context-and-benchmarks#try-it" class="hash-link" aria-label="Direct link to Try it" title="Direct link to Try it">​</a></h2>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5.4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">nano</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> openai/gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5.4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">nano</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5.4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> openai/gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5.4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5.5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> openai/gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5.5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> smart</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> auto_router/complexity_router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_default_model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_type</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> llm</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_llm_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5.4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">timeout_ms</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(9, 134, 88)">2000</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_context_window_size</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(9, 134, 88)">3</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_context_per_turn_chars</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(9, 134, 88)">200</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">tiers</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">SIMPLE</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5.4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">nano</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">MEDIUM</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5.4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">COMPLEX</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">REASONING</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5.5</span><br></span></code></pre></div></div>
<p>Every response carries <code>x-litellm-model-name</code> and <code>x-litellm-response-cost</code>, so the tier for a given request can be checked before relying on any aggregate. After a day of production traffic, the routed-versus-baseline figure in Benchmarks describes a specific workload more accurately than any of the datasets used here.</p>
<p>Full docs: <a href="https://docs.litellm.ai/docs/proxy/auto_routing" target="_blank" rel="noopener noreferrer">Auto Routing</a>.</p>]]></content>
        <author>
            <name>Tin Lo</name>
        </author>
        <category label="routing" term="routing"/>
        <category label="complexity-router" term="complexity-router"/>
        <category label="cost" term="cost"/>
        <category label="benchmarks" term="benchmarks"/>
        <category label="observability" term="observability"/>
        <category label="product" term="product"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Cut 69% Costs Stacking Auto-Routing on Prompt Caching]]></title>
        <id>https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark</id>
        <link href="https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark"/>
        <updated>2026-07-31T10:00:00.000Z</updated>
        <summary type="html"><![CDATA[The most common objection to auto-routing is that switching models throws away your prompt cache. We measured it across five datasets, including real gateway traffic with the provider's own cache accounting, and the answer is no.]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="Auto-Router x Prompt Caching: measured across five datasets" src="https://docs.litellm.ai/assets/images/hero-71dfbc8e920f13551e2f05f2916245de.png" width="3200" height="1676" class="img_ev3q"></p>
<p><strong>Yes, you can use prompt caching with Auto-Routing.</strong> The two compound rather than cancel out. We measured it across five datasets, two of which report what the provider's cache actually did.</p>
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>🚀 Help shape the Auto-Router</div><div class="admonitionContent_BuS1"><p>Get early access, work directly with the LiteLLM team, and influence the roadmap with your production traffic.</p><a class="button button--primary button--lg" style="background:#2e8555;border-color:#2e8555;color:#fff" href="https://calendar.app.google/i2e7qVEJphHi5S8UA">Apply to Become a Design Partner</a><br><br><p>Already testing it? Share your results in <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>.</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="the-results">The results<a href="https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark#the-results" class="hash-link" aria-label="Direct link to The results" title="Direct link to The results">​</a></h2>
<ul>
<li><strong>Auto-routing does not break prompt caching.</strong> The two compound on every dataset we measured</li>
<li><strong>37% to 69% cheaper</strong> than caching alone on a single model</li>
<li><strong>The real failure mode is the opposite one.</strong> Running a router with caching switched off is about <strong>4x more expensive</strong> than caching one fixed model</li>
</ul>
<table><thead><tr><th>Evaluation</th><th>Sample</th><th>Router + caching, vs caching alone</th></tr></thead><tbody><tr><td>Simulation, general chat (<a href="https://huggingface.co/datasets/allenai/WildChat-1M" target="_blank" rel="noopener noreferrer">WildChat-1M</a>)</td><td>30,769 multi-turn conversations</td><td><strong>68.7% cheaper</strong></td></tr><tr><td>Simulation, developer chat (<a href="https://github.com/NAIST-SE/DevGPT" target="_blank" rel="noopener noreferrer">DevGPT</a>)</td><td>1,011 conversations</td><td><strong>46% cheaper</strong></td></tr><tr><td>Real agent traces, provider cache accounting</td><td>95 sessions, 8,174 API calls</td><td><strong>37.4% cheaper</strong></td></tr><tr><td><a href="https://github.com/CommonstackAI/TwinRouterBench" target="_blank" rel="noopener noreferrer">TwinRouterBench</a> static track</td><td>81 multi-step instances</td><td><strong>44 to 50% cheaper</strong></td></tr></tbody></table>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-it-was-measured">How it was measured<a href="https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark#how-it-was-measured" class="hash-link" aria-label="Direct link to How it was measured" title="Direct link to How it was measured">​</a></h2>
<ul>
<li><strong>Router arm:</strong> one model group, four tiers. SIMPLE to <code>claude-haiku-4-5</code>, MEDIUM to <code>claude-sonnet-5</code>, COMPLEX and REASONING to <code>claude-opus-5</code></li>
<li><strong>Baseline arm:</strong> every request to one frontier model with prompt caching on, the strongest realistic baseline rather than a cold-priced strawman</li>
<li><strong>Cache behaviour:</strong> read from <code>usage.cache_read_input_tokens</code> and <code>cache_creation_input_tokens</code> on the gateway spend logs and agent traces; modelled on the other three legs</li>
<li><strong>Turn classification:</strong> one window function partitioned by session and model, labelling each turn as staying on a model, first visiting a tier, or returning to one already used</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="why-auto-routing-doesnt-break-prompt-caching">Why auto-routing doesn't break prompt caching<a href="https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark#why-auto-routing-doesnt-break-prompt-caching" class="hash-link" aria-label="Direct link to Why auto-routing doesn't break prompt caching" title="Direct link to Why auto-routing doesn't break prompt caching">​</a></h2>
<p><strong>99.3% of the time a session switches back to a model it used earlier, that model's cache is still warm.</strong> The router comes back long before the cache expires, so a switch is not an eviction.</p>
<p>We measured this on <strong>4,684 real switch-backs</strong> from live LiteLLM gateway traffic.</p>
<table><thead><tr><th>Provider cache state</th><th>% of Model Returns with Warm Cache</th></tr></thead><tbody><tr><td>Still warm at 5m TTL</td><td><strong>97.4%</strong></td></tr><tr><td>Still warm at 1h TTL</td><td><strong>99.3%</strong></td></tr><tr><td>Past TTL, the only ones a switch could have hurt</td><td><strong>2.6% / 0.7%</strong></td></tr></tbody></table>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="we-tried-a-background-cache-warmer-it-wasnt-worth-it">We tried a background cache warmer. It wasn't worth it<a href="https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark#we-tried-a-background-cache-warmer-it-wasnt-worth-it" class="hash-link" aria-label="Direct link to We tried a background cache warmer. It wasn't worth it" title="Direct link to We tried a background cache warmer. It wasn't worth it">​</a></h2>
<p>If switching really did strand the cache, a background refresher that replays a session's prefix would be the fix. We built the measurement for it first.</p>
<p><strong>Only 4% of cache misses are preventable by a background cache warmer.</strong> The rest either happened while the cache was still alive, or after the model had been idle so long that keeping it warm costs more than the write it avoids.</p>
<table><thead><tr><th>Traffic</th><th>Typical prefix</th><th>What warming does to total cost</th></tr></thead><tbody><tr><td>General chat</td><td>~1,700 tokens</td><td><strong>0.10% more expensive</strong></td></tr><tr><td>Agent traces, multi-hour gaps</td><td>large</td><td><strong>0.63% more expensive</strong></td></tr><tr><td>Our gateway, agentic</td><td>~190,000 tokens</td><td><strong>0.9% cheaper</strong></td></tr></tbody></table>
<p>Warming is worth roughly plus or minus two percent: a narrow optimization for long sessions with large stable prefixes, not the thing standing between a deployment and its savings.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="see-it-on-your-own-traffic">See it on your own traffic<a href="https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark#see-it-on-your-own-traffic" class="hash-link" aria-label="Direct link to See it on your own traffic" title="Direct link to See it on your own traffic">​</a></h2>
<p>The Auto-Router Benchmarks tab now reports prompt cache behaviour per router, from the provider's own usage payload:</p>
<ul>
<li><strong>Hit rate</strong>, split by whether the turn stayed on a model, first visited a tier, or returned to one</li>
<li><strong>Expired-miss share</strong>, narrowing return misses to those whose tier went idle past the TTL</li>
<li><strong>Savable by warming</strong>, the share of all misses a refresher could prevent</li>
<li><strong>Warming cost and net estimate</strong>, in dollars</li>
<li><strong>Coverage</strong>, so a low hit rate caused by response logging being off does not read as a cold cache</li>
</ul>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">GET /auto_router/benchmarks?start_date=2026-07-01&amp;end_date=2026-07-31</span><br></span></code></pre></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="try-it">Try it<a href="https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark#try-it" class="hash-link" aria-label="Direct link to Try it" title="Direct link to Try it">​</a></h2>
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_BuS1"><p>Point a client at an auto-router with prompt caching on, then check the Auto-Router Benchmarks tab against your own traffic. Share numbers or questions on <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>. To work on this with us directly, <a href="https://calendar.app.google/i2e7qVEJphHi5S8UA" target="_blank" rel="noopener noreferrer">apply to be a design partner</a>.</p></div></div>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockTitle_OeMC">config.yaml</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> smart</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> auto_router/complexity_router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">tiers</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">SIMPLE</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">MEDIUM</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">COMPLEX</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">   claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">REASONING</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_type</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> heuristic</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_default_model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><br></span></code></pre></div></div>
<p>Every response carries <code>x-litellm-model-name</code> and <code>x-litellm-response-cost</code>, and the provider's cache token counts land in the spend logs. Full reference on the <a href="https://docs.litellm.ai/docs/proxy/auto_routing">Auto Routing docs page</a>.</p>]]></content>
        <author>
            <name>Tin Lo</name>
        </author>
        <category label="routing" term="routing"/>
        <category label="complexity-router" term="complexity-router"/>
        <category label="caching" term="caching"/>
        <category label="cost" term="cost"/>
        <category label="benchmarks" term="benchmarks"/>
        <category label="engineering" term="engineering"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Cut 75% Claude Code cost with near frontier model quality]]></title>
        <id>https://docs.litellm.ai/blog/auto-router-cost-quality-benchmark</id>
        <link href="https://docs.litellm.ai/blog/auto-router-cost-quality-benchmark"/>
        <updated>2026-07-27T10:00:00.000Z</updated>
        <summary type="html"><![CDATA[Two independent evaluations of a four-tier Auto Router config against an all-frontier baseline: 8,619 graded prompts, 14,000 simulated real conversations, and what the cost and quality numbers actually depend on.]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="Introducing LiteLLM Autorouter: 75% cost savings with near frontier model quality" src="https://docs.litellm.ai/assets/images/hero-a45559e4634d7d106b05e63327f543c8.png" width="1600" height="838" class="img_ev3q"></p>
<p>Auto routing promises a smaller bill without a worse answer. We measured both halves against a baseline that sends every request to <code>claude-opus-5</code>: 8,619 graded prompts and cost simulations over 14,000 real conversations.</p>
<!-- -->
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>🚀 Help shape the Auto-Router</div><div class="admonitionContent_BuS1"><p>Get early access, work directly with the LiteLLM team, and influence the roadmap with your production traffic.</p><a class="button button--primary button--lg" style="background:#2e8555;border-color:#2e8555;color:#fff" href="https://calendar.app.google/i2e7qVEJphHi5S8UA">Apply to Become a Design Partner</a><br><br><p>Already testing it? Share your results in <a href="https://github.com/BerriAI/litellm/discussions/32172" target="_blank" rel="noopener noreferrer">discussion #32172</a>.</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="the-results">The results<a href="https://docs.litellm.ai/blog/auto-router-cost-quality-benchmark#the-results" class="hash-link" aria-label="Direct link to The results" title="Direct link to The results">​</a></h2>
<ul>
<li><strong>40.4% cheaper at 97.1% of frontier quality</strong>, on 220 prompts from six public benchmarks replayed through a live proxy</li>
<li><strong>74.5% cheaper at 87.3% of frontier quality</strong>, on RouterArena's full 8,399-query set</li>
<li><strong>Around 65% cheaper</strong> on simulated real chat and developer traffic, where most requests are short</li>
</ul>
<table><thead><tr><th>Evaluation</th><th>Sample</th><th>Quality retained vs Opus-5</th><th>Cost savings vs Opus-5</th><th>Routing mix (haiku/sonnet/opus)</th></tr></thead><tbody><tr><td>Live proxy, six public benchmarks</td><td>220 prompts</td><td><strong>97.1%</strong> (Auto Router 91.8% pass, Opus-5 94.5%)</td><td><strong>40.4%</strong> (Auto Router $10.47 / 1k, Opus-5 $17.57)</td><td>27% / 70% / 3%</td></tr><tr><td><a href="https://github.com/RouteWorks/RouterArena" target="_blank" rel="noopener noreferrer">RouterArena</a> full set, paired</td><td>8,399 prompts</td><td><strong>87.3%</strong> (Auto Router 68.6% accuracy, Opus-5 78.5%)</td><td><strong>74.5%</strong> (Auto Router $2.15 / 1k, Opus-5 $8.45)</td><td>79% / 17% / 4%</td></tr><tr><td>Simulation, general consumer chat (<a href="https://huggingface.co/datasets/allenai/WildChat-1M" target="_blank" rel="noopener noreferrer">WildChat-1M</a>)</td><td>12,000 conversations</td><td>not measured</td><td><strong>64.9%</strong></td><td>76% / 14% / 10%</td></tr><tr><td>Simulation, developer chat (<a href="https://github.com/NAIST-SE/DevGPT" target="_blank" rel="noopener noreferrer">DevGPT</a>)</td><td>2,056 conversations</td><td>not measured</td><td><strong>65.4%</strong></td><td>48% / 27% / 25%</td></tr><tr><td>Simulation, code-in-prompt heavy (<a href="https://huggingface.co/datasets/allenai/WildChat-1M" target="_blank" rel="noopener noreferrer">WildChat</a> code-filtered)</td><td>993 conversations</td><td>not measured</td><td><strong>20.0%</strong></td><td>13% / 34% / 53%</td></tr></tbody></table>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-it-was-measured">How it was measured<a href="https://docs.litellm.ai/blog/auto-router-cost-quality-benchmark#how-it-was-measured" class="hash-link" aria-label="Direct link to How it was measured" title="Direct link to How it was measured">​</a></h2>
<ul>
<li><strong>Router arm:</strong> one model group, four tiers. SIMPLE to <code>claude-haiku-4-5</code>, MEDIUM to <code>claude-sonnet-5</code>, COMPLEX and REASONING both to <code>claude-opus-5</code>, since Opus 5 already thinks by default. Heuristic classifier, no keyword rules, no adaptive sampling</li>
<li><strong>Baseline arm:</strong> the same prompts sent straight to <code>claude-opus-5</code>, which is what most teams do today when they point a workload at one frontier model</li>
<li><strong>Cost savings:</strong> what the router spent against what the baseline spent. On the live proxy, LiteLLM reports the cost of every request back in a response header; on the other legs we price the tokens each request actually used</li>
<li><strong>Quality retained:</strong> the router's pass rate against the baseline's, evaluating identical prompts with the same grader on both arms</li>
</ul>
<p>What counts as a pass:</p>
<table><thead><tr><th>Dataset</th><th>How a pass is decided</th></tr></thead><tbody><tr><td><a href="https://huggingface.co/datasets/openai/openai_humaneval" target="_blank" rel="noopener noreferrer">HumanEval</a>, <a href="https://huggingface.co/datasets/google-research-datasets/mbpp" target="_blank" rel="noopener noreferrer">MBPP</a></td><td>the datasets' own unit tests run in a subprocess; pass only if every official assert passes</td></tr><tr><td><a href="https://huggingface.co/datasets/openai/gsm8k" target="_blank" rel="noopener noreferrer">GSM8K</a>, <a href="https://huggingface.co/datasets/HuggingFaceH4/MATH-500" target="_blank" rel="noopener noreferrer">MATH-500</a>, <a href="https://huggingface.co/datasets/TIGER-Lab/MMLU-Pro" target="_blank" rel="noopener noreferrer">MMLU-Pro</a></td><td>answer-key match: the extracted final number, LaTeX normalisation with a SymPy equivalence fallback, and the final answer letter</td></tr><tr><td><a href="https://huggingface.co/datasets/princeton-nlp/SWE-bench_Lite" target="_blank" rel="noopener noreferrer">SWE-bench Lite</a></td><td>LLM as judge, comparing the named files, functions, and diff sketch against the patch upstream actually merged</td></tr><tr><td><a href="https://github.com/RouteWorks/RouterArena" target="_blank" rel="noopener noreferrer">RouterArena</a></td><td>RouterArena's own evaluator; about 74% of queries are multiple choice matched on a <code>\boxed{X}</code> letter, the rest use per-dataset scorers</td></tr></tbody></table>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>SWE-bench Lite is the only slice scored by LLM as judge; everything else is checked against the dataset's own answer key or test suite. Every SWE-bench answer was judged twice, by <code>claude-opus-5</code> and by <code>gemini-3.6-flash</code>, and retention holds at 96.6% under the stricter judge.</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="where-the-savings-come-from-and-what-they-cost">Where the savings come from, and what they cost<a href="https://docs.litellm.ai/blog/auto-router-cost-quality-benchmark#where-the-savings-come-from-and-what-they-cost" class="hash-link" aria-label="Direct link to Where the savings come from, and what they cost" title="Direct link to Where the savings come from, and what they cost">​</a></h2>
<table><thead><tr><th>Dataset</th><th>Auto Router pass</th><th>Opus-5 pass</th><th>Auto Router $/1k</th><th>Opus-5 $/1k</th><th>Savings</th></tr></thead><tbody><tr><td><a href="https://huggingface.co/datasets/openai/gsm8k" target="_blank" rel="noopener noreferrer">GSM8K</a></td><td>98% (39/40)</td><td>98% (39/40)</td><td>1.08</td><td>5.68</td><td>81%</td></tr><tr><td><a href="https://huggingface.co/datasets/openai/openai_humaneval" target="_blank" rel="noopener noreferrer">HumanEval</a></td><td>100% (40/40)</td><td>98% (39/40)</td><td>2.85</td><td>8.16</td><td>65%</td></tr><tr><td><a href="https://huggingface.co/datasets/TIGER-Lab/MMLU-Pro" target="_blank" rel="noopener noreferrer">MMLU-Pro</a></td><td>85% (34/40)</td><td>88% (35/40)</td><td>4.21</td><td>11.70</td><td>64%</td></tr><tr><td><a href="https://huggingface.co/datasets/HuggingFaceH4/MATH-500" target="_blank" rel="noopener noreferrer">MATH-500</a></td><td>90% (36/40)</td><td>98% (39/40)</td><td>5.70</td><td>13.16</td><td>57%</td></tr><tr><td><a href="https://huggingface.co/datasets/google-research-datasets/mbpp" target="_blank" rel="noopener noreferrer">MBPP</a></td><td>95% (38/40)</td><td>98% (39/40)</td><td>2.20</td><td>5.01</td><td>56%</td></tr><tr><td><a href="https://huggingface.co/datasets/princeton-nlp/SWE-bench_Lite" target="_blank" rel="noopener noreferrer">SWE-bench Lite</a></td><td>75% (15/20)</td><td>85% (17/20)</td><td>83.08</td><td>105.83</td><td>21%</td></tr><tr><td><strong>Blended</strong></td><td><strong>91.8%</strong></td><td><strong>94.5%</strong></td><td><strong>10.47</strong></td><td><strong>17.57</strong></td><td><strong>40%</strong></td></tr></tbody></table>
<p>The split runs opposite to intuition:</p>
<ul>
<li><strong>Short, cheap traffic saves the most at no quality cost.</strong> GSM8K is identical at a fifth of the price, and HumanEval came out one prompt ahead of the frontier baseline</li>
<li><strong>Repo-level work saves the least.</strong> Those prompts are long enough to dominate absolute spend, and the classifier correctly declines to send them to Haiku</li>
<li><strong>Quality is given up in two places.</strong> MATH-500, where Haiku took 19 of the 40 prompts and the arm finished three behind, and SWE-bench Lite</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="auto-routing-and-prompt-caching">Auto-routing and prompt caching<a href="https://docs.litellm.ai/blog/auto-router-cost-quality-benchmark#auto-routing-and-prompt-caching" class="hash-link" aria-label="Direct link to Auto-routing and prompt caching" title="Direct link to Auto-routing and prompt caching">​</a></h2>
<p>A question we keep hearing: do I have to choose between auto-routing and prompt caching?</p>
<p>No. Session affinity already lets you keep a conversation on the model its first turn picked, so the cache holds for the rest of that conversation. What it costs you is the routing decision on every turn after the first: once a session is pinned, a one-line follow-up stays on whatever model the opening turn earned. Closing that gap is the first item below.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="whats-next">What's next<a href="https://docs.litellm.ai/blog/auto-router-cost-quality-benchmark#whats-next" class="hash-link" aria-label="Direct link to What's next" title="Direct link to What's next">​</a></h2>
<ul>
<li><strong>Prompt caching that survives a tier change.</strong> Affinity pins a conversation today because switching models means a cold cache. We are testing a background refresher that keeps the prefix warm on every tier, so a session can move without paying the write cost twice</li>
<li><strong>Routing decisions you can inspect.</strong> Surfacing why a request landed on the tier it did, not just which model served it. That same signal feeds back into the classifier, so it improves against real traffic rather than benchmarks</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="try-it">Try it<a href="https://docs.litellm.ai/blog/auto-router-cost-quality-benchmark#try-it" class="hash-link" aria-label="Direct link to Try it" title="Direct link to Try it">​</a></h2>
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_BuS1"><p>Try it yourself with the configuration below, and post any feedback, questions, or numbers from your own traffic on <a href="https://github.com/BerriAI/litellm/discussions/32172" target="_blank" rel="noopener noreferrer">discussion #32172</a>. If you want to work on this with us directly, <a href="https://calendar.app.google/i2e7qVEJphHi5S8UA" target="_blank" rel="noopener noreferrer">apply to be a design partner</a>.</p></div></div>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockTitle_OeMC">config.yaml</div><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain">           </span><span class="token comment" style="color:rgb(0, 128, 0)"># $1 / $5 per 1M tokens</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain">            </span><span class="token comment" style="color:rgb(0, 128, 0)"># $3 / $15</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain">              </span><span class="token comment" style="color:rgb(0, 128, 0)"># $5 / $25</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> smart</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> auto_router/complexity_router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">tiers</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">SIMPLE</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">MEDIUM</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">COMPLEX</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">   claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">REASONING</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_type</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> heuristic         </span><span class="token comment" style="color:rgb(0, 128, 0)"># local scoring, sub-millisecond, no API call</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_default_model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><br></span></code></pre></div></div>
<p>Point a client at <code>smart-router</code> and every response carries <code>x-litellm-model-name</code> and <code>x-litellm-response-cost</code>, which is all the instrumentation this study needed. Full reference, including the classifier and tier-boundary knobs, on the <a href="https://docs.litellm.ai/docs/proxy/auto_routing">Auto Routing docs page</a>.</p>]]></content>
        <author>
            <name>Tin Lo</name>
        </author>
        <category label="routing" term="routing"/>
        <category label="complexity-router" term="complexity-router"/>
        <category label="cost" term="cost"/>
        <category label="benchmarks" term="benchmarks"/>
        <category label="engineering" term="engineering"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[July Townhall Updates: 38 Security Fixes, 317 Bug Fixes, and Autorouter V2]]></title>
        <id>https://docs.litellm.ai/blog/july-townhall-updates</id>
        <link href="https://docs.litellm.ai/blog/july-townhall-updates"/>
        <updated>2026-07-24T12:00:00.000Z</updated>
        <summary type="html"><![CDATA[A recap of the July LiteLLM town hall: 38 security fixes, 317 bug fixes, 140 feature commits, new Rust gateway benchmarks, and the launch of Autorouter V2.]]></summary>
        <content type="html"><![CDATA[<p>Thank you to everyone who joined our July town hall. We used it to share this month's security and stability work and our latest product updates: <strong>38 security fixes</strong>, <strong>317 bug fixes</strong>, and <strong>140 feature commits</strong>, headlined by new Rust benchmarks and the launch of Autorouter V2.</p>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="security">Security<a href="https://docs.litellm.ai/blog/july-townhall-updates#security" class="hash-link" aria-label="Direct link to Security" title="Direct link to Security">​</a></h2>
<p><strong>38 security fixes shipped this month</strong>, including two critical vulnerabilities closed for good. Here is where they landed:</p>
<table><thead><tr><th>Category</th><th>Fixes</th><th>Share</th></tr></thead><tbody><tr><td>Secret / credential exposure prevention</td><td>12</td><td>32%</td></tr><tr><td>Access-control / privilege-escalation</td><td>11</td><td>29%</td></tr><tr><td>Guardrail-bypass</td><td>6</td><td>16%</td></tr><tr><td>SSRF / secret exfiltration</td><td>5</td><td>13%</td></tr><tr><td>CVE / dependency / supply-chain</td><td>4</td><td>11%</td></tr></tbody></table>
<p>We backport security fixes across the last four minor release lines, so staying current is the whole defense. Upgrade to stay covered.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="how-we-review-every-pr">How we review every PR<a href="https://docs.litellm.ai/blog/july-townhall-updates#how-we-review-every-pr" class="hash-link" aria-label="Direct link to How we review every PR" title="Direct link to How we review every PR">​</a></h3>
<p>Every pull request runs a security pass before it can merge, and every release runs a full scan before it ships.</p>
<ul>
<li><strong>Veria scan.</strong> A required check on every PR, built on Veria AI, zizmor, and semgrep. False positives get flagged, never blocking.</li>
<li><strong>Dependency scan.</strong> osv-scanner gates every lockfile change and runs nightly, so a known-CVE dependency can't ship.</li>
<li><strong>Image scan.</strong> Grype checks the runtime image for OS and library CVEs and fails the build on fixable High/Critical findings.</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="we-pay-for-security-reports">We pay for security reports<a href="https://docs.litellm.ai/blog/july-townhall-updates#we-pay-for-security-reports" class="hash-link" aria-label="Direct link to We pay for security reports" title="Direct link to We pay for security reports">​</a></h3>
<p>The bug bounty is live.</p>
<ul>
<li><strong>Scope:</strong> the LiteLLM gateway and SDK.</li>
<li><strong>Submit</strong> through a private vulnerability report on GitHub.</li>
<li><strong>Triaged</strong> by maintainers and the Veria Labs security team.</li>
<li><a href="https://github.com/BerriAI/litellm/security" target="_blank" rel="noopener noreferrer">github.com/BerriAI/litellm/security</a></li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="whats-next-for-security">What's next for security<a href="https://docs.litellm.ai/blog/july-townhall-updates#whats-next-for-security" class="hash-link" aria-label="Direct link to What's next for security" title="Direct link to What's next for security">​</a></h3>
<p>We're expanding the bug bounty program, hardening the recurring code patterns we keep finding through the stability sprint, and hiring to match. This is a structural investment, not a one-month sprint.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="stability">Stability<a href="https://docs.litellm.ai/blog/july-townhall-updates#stability" class="hash-link" aria-label="Direct link to Stability" title="Direct link to Stability">​</a></h2>
<p>We've grown fast, and want to prioritize staying on top of bugs so they don't accumulate. In July we shipped <strong>317 bug fixes</strong>.</p>
<table><thead><tr><th>Area</th><th>Fixes</th></tr></thead><tbody><tr><td>UI + Auth / SSO</td><td>76</td></tr><tr><td>MCP Gateway</td><td>50</td></tr><tr><td>Providers &amp; Model Transforms</td><td>48</td></tr><tr><td>Cost, Budgets &amp; Observability</td><td>44</td></tr><tr><td>Proxy Core &amp; Resilience</td><td>43</td></tr><tr><td>Streaming / Realtime APIs</td><td>36</td></tr><tr><td>Other / SDK</td><td>20</td></tr></tbody></table>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="the-target-95-e2e-coverage-by-end-of-month">The target: 95% E2E coverage by end of month<a href="https://docs.litellm.ai/blog/july-townhall-updates#the-target-95-e2e-coverage-by-end-of-month" class="hash-link" aria-label="Direct link to The target: 95% E2E coverage by end of month" title="Direct link to The target: 95% E2E coverage by end of month">​</a></h3>
<p>We're treating end-to-end testing as a first-class citizen. Every new customer journey now ships with its own E2E test, tracked live on the dashboard. The goal is to cover roughly 97 more customer journeys this month, taking us from 309 to 406 of 427 identified journeys, about 95% coverage.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="what-kinds-of-fixes-shipped">What kinds of fixes shipped<a href="https://docs.litellm.ai/blog/july-townhall-updates#what-kinds-of-fixes-shipped" class="hash-link" aria-label="Direct link to What kinds of fixes shipped" title="Direct link to What kinds of fixes shipped">​</a></h3>
<p>The headline categories were billing, identity, and MCP.</p>
<ul>
<li><strong>Billing accuracy.</strong> We closed the gaps where spend used to slip through. Cached and tiered usage on Anthropic and Bedrock is priced correctly now, budgets reset on the right schedule, and partial spend gets captured when a stream drops mid-request.</li>
<li><strong>Identity and access.</strong> Caller identity now resolves once into a single record, so team IDs and spend attribution stay correct, and auth no longer fails open on DB errors.</li>
<li><strong>MCP reliability.</strong> Tools list and call consistently across every auth method now, with per-user credentials and proper OAuth token refresh.</li>
<li><strong>Resource leaks.</strong> Guardrails no longer re-initialize on every request, which kills the runner leaks, latency spikes, and OOMs they used to cause.</li>
<li><strong>Resilience.</strong> Streaming requests recover cost on interruption, the proxy self-heals on dropped DB connections, and OTEL metrics no longer overload Splunk.</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="watch-our-progress-live">Watch our progress live<a href="https://docs.litellm.ai/blog/july-townhall-updates#watch-our-progress-live" class="hash-link" aria-label="Direct link to Watch our progress live" title="Direct link to Watch our progress live">​</a></h3>
<p>Progress is tracked in public on <a href="https://github.com/BerriAI/litellm/issues/30484" target="_blank" rel="noopener noreferrer">GitHub issue #30484</a>, with the bar set at zero reported regressions by the August 29 release.</p>
<ul>
<li><strong>June.</strong> 13 bugs triaged and the stability sprint opens. Root-cause analysis begins.</li>
<li><strong>July.</strong> MCP improvements complete, with 80+ fixes shipped, and E2E coverage climbing toward the 95% target.</li>
<li><strong>August.</strong> Fireworks, Cloudflare, and Baseten providers join the E2E suite. Load-testing gates get added to stable releases, with progress reported alongside the August 29 release.</li>
</ul>
<p>Find our latest stable release <a href="https://docs.litellm.ai/release_notes/v1.93.0/v1-93-0" target="_blank" rel="noopener noreferrer">here</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="product">Product<a href="https://docs.litellm.ai/blog/july-townhall-updates#product" class="hash-link" aria-label="Direct link to Product" title="Direct link to Product">​</a></h2>
<p>Alongside the security and stability work, we shipped <strong>140 feature commits in July.</strong></p>
<ul>
<li><strong>Rust:</strong> pyo3 0.29, Python 3.14 support, a Mistral OCR bridge, and /v1/messages on Azure.</li>
<li><strong>Tokens and budgets:</strong> Headroom cuts 60-95% of tokens; budget fallbacks reroute at the cap.</li>
<li><strong>New models:</strong> Claude Sonnet 5 on Day 0, Gemini 3.5 Flash, and Muse Spark 1.1.</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="performance">Performance<a href="https://docs.litellm.ai/blog/july-townhall-updates#performance" class="hash-link" aria-label="Direct link to Performance" title="Direct link to Performance">​</a></h3>
<p>We've been testing LiteLLM, benchmarked with <a href="https://github.com/BerriAI/ai-gateway-bench" target="_blank" rel="noopener noreferrer">AIGatewayBench</a>. This is gateway overhead against a local deterministic mock, n=5000 per endpoint on one host.</p>
<table><thead><tr><th>Metric</th><th>LiteLLM Rust</th><th>Bifrost</th><th>Portkey</th><th>LiteLLM Python v1</th></tr></thead><tbody><tr><td>Gateway overhead (p99 added latency)</td><td>0.7 ms</td><td>4.5 ms</td><td>2.3 ms</td><td>257.7 ms</td></tr><tr><td>Peak memory footprint</td><td>21.8 MB</td><td>199.1 MB</td><td>90.4 MB</td><td>329.5 MB</td></tr><tr><td>Estimated cost per 1M requests</td><td>$0.000175</td><td>$0.001008</td><td>$0.001042</td><td>$0.015354</td></tr></tbody></table>
<p><em>*Overhead is gateway p99 minus direct-to-mock p99 on the same endpoint. Cost is a footprint estimate from measured CPU and peak RSS at 4 vCPU / 16 GB, and excludes token cost.</em></p>
<p>Beta v0 is live now for testing. It supports /v1/messages for Azure and all /ocr providers today. See the <a href="https://docs.litellm.ai/docs/proxy/rust_gateway" target="_blank" rel="noopener noreferrer">docs</a>. Next up is /v1/messages for Bedrock Invoke, with support for all known Bedrock auth methods: STS, keys, and IAM.</p>
<p>This is a gradual rollout, one route at a time, each proven in production before the next begins. We're targeting full rollout by December 1st. Same config, same database, same API. There's nothing for you to change.</p>
<p><a href="https://docs.litellm.ai/docs/proxy/rust_gateway" target="_blank" rel="noopener noreferrer">Get started.</a></p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="announcing-autorouter-v2">Announcing Autorouter V2<a href="https://docs.litellm.ai/blog/july-townhall-updates#announcing-autorouter-v2" class="hash-link" aria-label="Direct link to Announcing Autorouter V2" title="Direct link to Announcing Autorouter V2">​</a></h2>
<p>Autorouter V2 routes each request to the right model by how hard it is. Four complexity tiers, classified by default with rule-based scoring that needs no training data, no API calls, and under 1 ms of latency.</p>
<ul>
<li><strong>Simple.</strong> "Hello", "What is Python?", "Thanks."</li>
<li><strong>Medium.</strong> "Explain how REST APIs work", "Debug this error."</li>
<li><strong>Complex.</strong> "Design a microservices architecture", "Implement a rate limiter."</li>
<li><strong>Reasoning.</strong> "Think step by step...", "Analyze the pros and cons..."</li>
</ul>
<p>That default is a heuristic scorer weighing seven signals: token count, code presence, reasoning markers, technical terms, simple indicators, multi-step patterns, and question complexity. The combined score sets the tier (Simple &lt; 0.15, Medium 0.15-0.35, Complex 0.35-0.60, Reasoning &gt; 0.60 or 2+ reasoning markers). V2 adds four ways to make that routing smarter:</p>
<ol>
<li><strong>An LLM classifier.</strong> Swap the heuristic for a model call (say anthropic/claude-haiku-4-5, with a configurable timeout) to pick the tier. If the classifier errors, times out, or returns something unparseable, it falls back to the heuristic scorer automatically.</li>
<li><strong>Routing that learns.</strong> An adaptive bandit mode watches how each conversation actually goes: does the user have to rephrase or correct the model, does it get stuck repeating itself or run out of tool calls, does the user seem satisfied. That live feedback shifts future routing toward the models that are actually working. Quality-vs-cost weighting (we recommend 30/70), the eligible model pool, and a tier-distance penalty are all configurable.</li>
<li><strong>Tier escalation.</strong> A configured keyword bumps a request one tier higher when it appears in the user's message. Matching is case-sensitive, so a phrase like LITELLM ESCALATE only fires on the exact, shouted form.</li>
<li><strong>Semantic keyword matching.</strong> Keyword overrides already route requests containing specific terms straight to a tier (for example, "invoice, refund, billing" goes to Medium). Semantic matching extends this with an embedding model and a minimum similarity score, trading a little latency for matches that don't need an exact keyword hit.</li>
</ol>
<p>We shipped Autorouter V2 to get your feedback on it. Try it today:</p>
<ul>
<li><a href="https://docs.litellm.ai/docs/learn/autorouter_cli" target="_blank" rel="noopener noreferrer">Local CLI</a></li>
<li><a href="https://docs.litellm.ai/docs/proxy/auto_routing" target="_blank" rel="noopener noreferrer">On Proxy</a></li>
<li>Tell us what breaks: <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">GitHub Discussion #32168</a>, or #litellm-autorouter on Discord.</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="whats-next">What's next<a href="https://docs.litellm.ai/blog/july-townhall-updates#whats-next" class="hash-link" aria-label="Direct link to What's next" title="Direct link to What's next">​</a></h2>
<p>Thanks again for all the questions and feedback. We'll keep sharing concrete progress as this work ships, especially as we get closer to the August 29 release.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="were-hiring">We're hiring<a href="https://docs.litellm.ai/blog/july-townhall-updates#were-hiring" class="hash-link" aria-label="Direct link to We're hiring" title="Direct link to We're hiring">​</a></h2>
<p>LiteLLM is the open-source gateway thousands of teams use to run every model behind one API, from startups to the Fortune 500. We move fast: 140 features and 300+ fixes shipped this month alone.</p>
<p>We're hiring a Security Engineer for the core gateway. Small team, huge surface area, real ownership from day one. Want in, or know someone great? Reach us at <a href="mailto:recruiting@berri.ai" target="_blank" rel="noopener noreferrer">recruiting@berri.ai</a>.</p>
<p>Thank you for using LiteLLM. <strong>Krrish &amp; Ishaan</strong></p>
<p><strong>Questions? Join the conversation</strong> <a href="https://github.com/BerriAI/litellm/discussions/34595" target="_blank" rel="noopener noreferrer">GitHub Discussion #34595</a></p>]]></content>
        <author>
            <name>Krrish Dholakia</name>
            <uri>https://www.linkedin.com/in/krish-d/</uri>
        </author>
        <author>
            <name>Ishaan Jaffer</name>
            <uri>https://www.linkedin.com/in/reffajnaahsi/</uri>
        </author>
        <category label="townhall" term="townhall"/>
        <category label="security" term="security"/>
        <category label="reliability" term="reliability"/>
        <category label="product" term="product"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Day 0 Support: Claude Opus 5]]></title>
        <id>https://docs.litellm.ai/blog/claude_opus_5</id>
        <link href="https://docs.litellm.ai/blog/claude_opus_5"/>
        <updated>2026-07-24T10:00:00.000Z</updated>
        <summary type="html"><![CDATA[Day 0 support for Claude Opus 5 on the LiteLLM AI Gateway. Use it across Anthropic, Azure, Vertex AI, and Bedrock.]]></summary>
        <content type="html"><![CDATA[<p><img decoding="async" loading="lazy" alt="LiteLLM x Claude Opus 5" src="https://docs.litellm.ai/assets/images/litellm_claude_opus_5_announcement-1d34c01c812a0646ecc86bd93912c9e4.png" width="4800" height="2508" class="img_ev3q"></p>
<p>LiteLLM now supports <a href="https://www.anthropic.com/news/claude-opus-5" target="_blank" rel="noopener noreferrer">Claude Opus 5</a> on Day 0. Use it across Anthropic, Azure, Vertex AI, and Bedrock through the LiteLLM AI Gateway. Call it with the same OpenAI-compatible request you already use, and track spend, rate limits, and logging in one place.</p>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="whats-new-in-opus-5">What's new in Opus 5<a href="https://docs.litellm.ai/blog/claude_opus_5#whats-new-in-opus-5" class="hash-link" aria-label="Direct link to What's new in Opus 5" title="Direct link to What's new in Opus 5">​</a></h2>
<p>Key changes (<a href="https://www.anthropic.com/news/claude-opus-5" target="_blank" rel="noopener noreferrer">details from Anthropic</a>):</p>
<ul>
<li><strong>Much better coding agents:</strong> stronger at large refactors, debugging, multi-file features, and finishing end-to-end work without leaving stubs</li>
<li><strong>Better self-verification:</strong> it checks and iterates on its own work more proactively</li>
<li><strong>Better vision and artifacts:</strong> improved screenshots → website, charts and documents, spreadsheets, and slide decks</li>
<li><strong>Same base API price as Opus 4.8:</strong> $5 / MTok input and $25 / MTok output</li>
<li><strong>Thinking is on by default</strong></li>
<li><strong>Fast mode:</strong> about 2.5x faster, but costs 2x</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-switch-from-opus-48">Before you switch from Opus 4.8<a href="https://docs.litellm.ai/blog/claude_opus_5#before-you-switch-from-opus-48" class="hash-link" aria-label="Direct link to Before you switch from Opus 4.8" title="Direct link to Before you switch from Opus 4.8">​</a></h2>
<p>The swap is not free. Priority Tier and web fetch are both gone on Opus 5, so plan that capacity and that tooling separately. Opus 5's cybersecurity classifiers can also decline a request outright with <code>stop_reason: "refusal"</code> and a category in <code>stop_details</code>, which is worth handling explicitly or routing around with LiteLLM <a href="https://docs.litellm.ai/docs/proxy/reliability">fallbacks</a>.</p>
<p>Sampling parameters (<code>temperature</code>, <code>top_p</code>, <code>top_k</code>), fixed thinking budgets, and assistant message prefill remain unsupported, same as Opus 4.8. Anthropic's <a href="https://platform.claude.com/docs/en/about-claude/models/migration-guide" target="_blank" rel="noopener noreferrer">Opus 5 migration guide</a> has the full compatibility checklist.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="enabling-opus-5">Enabling Opus 5<a href="https://docs.litellm.ai/blog/claude_opus_5#enabling-opus-5" class="hash-link" aria-label="Direct link to Enabling Opus 5" title="Direct link to Enabling Opus 5">​</a></h2>
<p>Opus 5 ships in the <strong><code>v1.95.0-dev.3</code></strong> image, cutting later today, but most proxies do not need to upgrade at all. On the default remote cost map, open the <strong>Price Data</strong> tab under <strong>Models + Endpoints</strong> in the UI and click <strong>Reload Price Data</strong> (or <code>POST /reload/model_cost_map</code> as a proxy admin). That refetches pricing and re-registers provider routing in one step, so <code>claude-opus-5</code> becomes available across Anthropic, Azure, Vertex AI, and Bedrock even on an older version.</p>
<p>The exception is <code>LITELLM_LOCAL_MODEL_COST_MAP=true</code>, which bakes the cost map into the image and puts it out of the Reload button's reach. Pull <code>v1.95.0-dev.3</code> or later for the bundled Opus 5 metadata:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">docker pull ghcr.io/berriai/litellm:v1.95.0-dev.3</span><br></span></code></pre></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="usage">Usage<a href="https://docs.litellm.ai/blog/claude_opus_5#usage" class="hash-link" aria-label="Direct link to Usage" title="Direct link to Usage">​</a></h2>
<p>Pick your provider below. Each tab wires up <code>claude-opus-5</code> for that provider; the request you send afterward is identical everywhere.</p>
<div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Anthropic</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Azure</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Vertex AI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Bedrock</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p><strong>1. Setup config.yaml</strong></p><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> anthropic/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/ANTHROPIC_API_KEY</span><br></span></code></pre></div></div><p><strong>2. Start the proxy</strong></p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">docker run -d \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -p 4000:4000 \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -v $(pwd)/config.yaml:/app/config.yaml \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  ghcr.io/berriai/litellm:v1.95.0-dev.3 \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  --config /app/config.yaml</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p><strong>1. Setup config.yaml</strong></p><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> azure_ai/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/AZURE_AI_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_base</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/AZURE_AI_API_BASE  </span><span class="token comment" style="color:rgb(0, 128, 0)"># https://&lt;resource&gt;.services.ai.azure.com</span><br></span></code></pre></div></div><p><strong>2. Start the proxy</strong></p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">docker run -d \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -p 4000:4000 \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -e AZURE_AI_API_KEY=$AZURE_AI_API_KEY \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -e AZURE_AI_API_BASE=$AZURE_AI_API_BASE \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -v $(pwd)/config.yaml:/app/config.yaml \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  ghcr.io/berriai/litellm:v1.95.0-dev.3 \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  --config /app/config.yaml</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p><strong>1. Setup config.yaml</strong></p><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> vertex_ai/claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">vertex_project</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/VERTEX_PROJECT</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">vertex_location</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> global</span><br></span></code></pre></div></div><p><strong>2. Start the proxy</strong></p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">docker run -d \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -p 4000:4000 \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -e VERTEX_PROJECT=$VERTEX_PROJECT \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -e GOOGLE_APPLICATION_CREDENTIALS=/app/credentials.json \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -v $(pwd)/config.yaml:/app/config.yaml \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -v $(pwd)/credentials.json:/app/credentials.json \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  ghcr.io/berriai/litellm:v1.95.0-dev.3 \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  --config /app/config.yaml</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p><strong>1. Setup config.yaml</strong></p><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> bedrock/anthropic.claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opus</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">aws_access_key_id</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/AWS_ACCESS_KEY_ID</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">aws_secret_access_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/AWS_SECRET_ACCESS_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">aws_region_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> us</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">east</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">1</span><br></span></code></pre></div></div><div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>For cross-region routing, swap the model ID for a regional inference profile (<code>us.</code>, <code>eu.</code>, <code>au.</code>, or <code>jp.</code> prefix), e.g. <code>bedrock/converse/us.anthropic.claude-opus-5</code>. These carry a 10% regional premium; the <code>global.</code> profile stays at base price. LiteLLM tracks the cost of each variant automatically.</p></div></div><p><strong>2. Start the proxy</strong></p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">docker run -d \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -p 4000:4000 \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -v $(pwd)/config.yaml:/app/config.yaml \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  ghcr.io/berriai/litellm:v1.95.0-dev.3 \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  --config /app/config.yaml</span><br></span></code></pre></div></div></div></div></div>
<p><strong>3. Test it!</strong></p>
<p>The request is the same regardless of which provider you configured above:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">curl --location 'http://0.0.0.0:4000/chat/completions' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">--header 'Content-Type: application/json' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">--header 'Authorization: Bearer $LITELLM_KEY' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">--data '{</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  "model": "claude-opus-5",</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  "messages": [</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    {</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      "role": "user",</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      "content": "what llm are you"</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    }</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  ]</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">}'</span><br></span></code></pre></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="fast-mode">Fast Mode<a href="https://docs.litellm.ai/blog/claude_opus_5#fast-mode" class="hash-link" aria-label="Direct link to Fast Mode" title="Direct link to Fast Mode">​</a></h2>
<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_BuS1"><p>Fast mode is <strong>only supported on the Anthropic provider</strong> (<code>anthropic/claude-opus-5</code>). It is not available on Azure AI, Vertex AI, or Bedrock, and it cannot be combined with the Batch API.</p></div></div>
<p>Opus 5 runs roughly 2.5x faster with <code>speed: "fast"</code>, billed at $10 / MTok input and $50 / MTok output (2x the standard rate, down from the 6x premium on Opus 4.6). LiteLLM adds the <code>fast-mode-2026-02-01</code> beta header and tracks the premium in cost calculations automatically.</p>
<div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">/v1/chat/completions</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">/v1/messages</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">/v1/responses</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">curl --location 'http://0.0.0.0:4000/v1/chat/completions' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">--header 'Content-Type: application/json' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">--header 'Authorization: Bearer $LITELLM_KEY' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">--data '{</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  "model": "claude-opus-5",</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  "messages": [</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    {</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      "role": "user",</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      "content": "Refactor this module..."</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    }</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  ],</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  "max_tokens": 4096,</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  "speed": "fast"</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">}'</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">curl --location 'http://0.0.0.0:4000/v1/messages' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">--header 'x-api-key: sk-12345' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">--header 'content-type: application/json' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">--data '{</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    "model": "claude-opus-5",</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    "max_tokens": 4096,</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    "speed": "fast",</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    "messages": [</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        {</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">            "role": "user",</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">            "content": "Refactor this module..."</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        }</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    ]</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">}'</span><br></span></code></pre></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>Fast mode on the Responses API is coming soon. The <code>speed</code> parameter is not yet forwarded on <code>/v1/responses</code>, so requests there run at standard speed and price until support lands.</p></div></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="feedback">Feedback<a href="https://docs.litellm.ai/blog/claude_opus_5#feedback" class="hash-link" aria-label="Direct link to Feedback" title="Direct link to Feedback">​</a></h2>
<p>Running Opus 5 through LiteLLM and hitting something unexpected? Share it on <a href="https://github.com/BerriAI/litellm/discussions/34517" target="_blank" rel="noopener noreferrer">GitHub discussion #34517</a>.</p>]]></content>
        <author>
            <name>Mateo Wang</name>
            <uri>https://www.linkedin.com/in/mateo-wang</uri>
        </author>
        <author>
            <name>Krrish Dholakia</name>
            <uri>https://www.linkedin.com/in/krish-d/</uri>
        </author>
        <author>
            <name>Ishaan Jaffer</name>
            <uri>https://www.linkedin.com/in/reffajnaahsi/</uri>
        </author>
        <category label="anthropic" term="anthropic"/>
        <category label="claude" term="claude"/>
        <category label="opus 5" term="opus 5"/>
        <category label="day 0 support" term="day 0 support"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Benchmarking the LiteLLM Rust AI Gateway: Overhead, Memory, and Cost]]></title>
        <id>https://docs.litellm.ai/blog/rust-ai-gateway-benchmarks</id>
        <link href="https://docs.litellm.ai/blog/rust-ai-gateway-benchmarks"/>
        <updated>2026-07-22T09:00:00.000Z</updated>
        <summary type="html"><![CDATA[AIGatewayBench measures the overhead an AI gateway adds on top of the upstream model, isolated against a deterministic mock, across LiteLLM (Rust), LiteLLM (Python v1), Portkey, and Bifrost. The LiteLLM Rust gateway has the lowest overhead and memory footprint of the four.]]></summary>
        <content type="html"><![CDATA[<p><em>Last Updated: July 2026</em></p>
<p>We are launching an early beta of the LiteLLM AI Gateway in Rust, and we built <a href="https://github.com/BerriAI/ai-gateway-bench" target="_blank" rel="noopener noreferrer">AIGatewayBench</a> to measure it against Portkey, Bifrost, and the current LiteLLM Python proxy. Across all four, the LiteLLM Rust gateway has the <strong>lowest p99 added latency and the smallest memory footprint by a wide margin</strong>: roughly <code>7x</code> lower overhead and <code>9x</code> less memory than the next-closest gateway (Bifrost), the lowest cost footprint, and the fastest whole-session times for coding agents. It holds its own on raw sustained throughput and pulls decisively ahead on overhead, memory, and cost.</p>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="the-results">The results<a href="https://docs.litellm.ai/blog/rust-ai-gateway-benchmarks#the-results" class="hash-link" aria-label="Direct link to The results" title="Direct link to The results">​</a></h2>
<p><strong>Gateway overhead and memory.</strong> p99 added latency (log scale) and peak memory. Rust adds about <code>0.7ms</code> at p99 against <code>2.3ms</code> (Portkey), <code>4.5ms</code> (Bifrost), and <code>257.7ms</code> (Python v1), at <code>21.8MB</code> peak memory against <code>90.4MB</code>, <code>199.1MB</code>, and <code>329.5MB</code>.</p>
<p><img decoding="async" loading="lazy" alt="Gateway overhead (p99 added latency) and peak memory across LiteLLM Rust, Portkey, Bifrost, and LiteLLM Python" src="https://docs.litellm.ai/assets/images/overhead_comparison-84558a112417d8ae89a19ce5b0cd59fb.png" width="2046" height="878" class="img_ev3q"></p>
<p><strong>Cost footprint.</strong> Estimated USD per one million requests from measured CPU, peak RSS, and sustained throughput on a 4 vCPU / 16 GB instance. Rust lands at about <code>$0.000175</code>, roughly <code>6x</code> below Bifrost (<code>$0.001008</code>) and Portkey (<code>$0.001042</code>), and far below Python (<code>$0.015354</code>). This is a footprint estimate and excludes token cost, which dominates any real bill.</p>
<p><img decoding="async" loading="lazy" alt="Estimated request cost in dollars per one million requests" src="https://docs.litellm.ai/assets/images/cost_per_million-f034ff785ab87dcf4b1099ba5fc33eb9.png" width="1512" height="902" class="img_ev3q"></p>
<p><strong>Throughput efficiency.</strong> Sustained requests per second per dollar per hour. Rust reaches about <code>283,833</code> against <code>63,246</code> (Bifrost) because it holds a similar request rate at a fraction of the CPU and memory. On raw sustained RPS, Rust (<code>~2,814</code> req/s) edges out Bifrost (<code>~2,744</code>); this chart is efficiency per dollar, not peak throughput.</p>
<p><img decoding="async" loading="lazy" alt="Estimated sustained RPS per dollar across the four gateways" src="https://docs.litellm.ai/assets/images/rps_per_dollar-93d4eb8e9a51bc21acecf5d48356221c.png" width="1512" height="902" class="img_ev3q"></p>
<p><strong>Agentic coding sessions.</strong> Added wall time across a 30-turn Claude Code and Codex-style loop. Rust adds about <code>0.03s</code> and <code>0.016s</code>, against <code>0.13s</code> / <code>0.047s</code> (Bifrost), <code>0.12s</code> / <code>0.09s</code> (Portkey), and <code>0.97s</code> / <code>0.24s</code> (Python).</p>
<p><img decoding="async" loading="lazy" alt="Whole-session gateway overhead for Claude Code and Codex-style loops" src="https://docs.litellm.ai/assets/images/session_overhead-db3bb4e0a102c21c6262c16142bcb4cd.png" width="1592" height="902" class="img_ev3q"></p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-reproduce-this-with-aigatewaybench">How to reproduce this with AIGatewayBench<a href="https://docs.litellm.ai/blog/rust-ai-gateway-benchmarks#how-to-reproduce-this-with-aigatewaybench" class="hash-link" aria-label="Direct link to How to reproduce this with AIGatewayBench" title="Direct link to How to reproduce this with AIGatewayBench">​</a></h2>
<p>Every gateway points at the same local deterministic Rust mock, so provider latency and network jitter drop out and what remains is the gateway's own cost:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">overhead = latency(client -&gt; gateway -&gt; mock) - latency(client -&gt; mock directly)</span><br></span></code></pre></div></div>
<!-- -->
<p>The gateway's overhead is path A minus path B. Everything except the gateway under test, the mock, the load driver, and the host, is held identical, so the difference is the gateway's own cost. The full harness, per-gateway setup, and raw run data are in <a href="https://github.com/BerriAI/ai-gateway-bench" target="_blank" rel="noopener noreferrer">AIGatewayBench</a>. Start the mock, start a gateway pointed at it, run a scenario, and regenerate the charts:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">python -m venv .venv &amp;&amp; . .venv/bin/activate &amp;&amp; pip install -r requirements.txt</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">cargo run --release -p mock-upstream                 # deterministic upstream</span><br></span><span class="token-line" style="color:#000000"><span class="token plain"># start a gateway from gateways/&lt;name&gt;/README.md, pointed at the mock</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">python analyze/make_chart.py                          # charts from results/</span><br></span></code></pre></div></div>
<p>A few things to keep honest when reading these numbers:</p>
<ul>
<li>Because the upstream is a local mock, the absolute latencies are the gateway's isolated slice, not real-world request latencies. Read them as comparisons under identical conditions.</li>
<li>Versions: LiteLLM Rust beta, LiteLLM Python v1 (<code>litellm[proxy]</code>), Bifrost <code>v1.6.4</code>, current Portkey OSS. Same mock and load driver on one host.</li>
<li>Every gateway forwards the Anthropic Messages body with no logging callbacks, spend tracking, or persistence enabled. This isolates forwarding overhead; it is not a full-feature comparison, and enabling those would add cost to every gateway, including ours.</li>
<li>Single-host, per-scenario runs (for example n=5000 on the overhead panel) without repeated-trial error bars, so treat them as order-of-magnitude differences.</li>
<li>It is a vendor-run benchmark, so the guardrail is reproducibility: every plotted value is a committed CSV in <a href="https://github.com/BerriAI/ai-gateway-bench/tree/main/results" target="_blank" rel="noopener noreferrer"><code>results/</code></a>, and the mock and driver are identical across all four gateways.</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="conclusions">Conclusions<a href="https://docs.litellm.ai/blog/rust-ai-gateway-benchmarks#conclusions" class="hash-link" aria-label="Direct link to Conclusions" title="Direct link to Conclusions">​</a></h2>
<p>For a single chat turn, gateway overhead is noise next to model latency and none of this should change your decision. Where it matters is high request rate against fast responses (embeddings, classification, guardrails) and agentic loops that issue many turns per task, and in the memory and CPU footprint that decides how many pods you run and how close each sits to an out-of-memory kill.</p>
<p>On those axes the LiteLLM Rust gateway is the strongest of the four we tested: the lowest overhead, the smallest footprint, and the lowest cost per unit of throughput, and a raw sustained RPS that edges out the next-best gateway. It is an early beta, streaming and the full feature surface are still landing, and the fastest way to check any claim here is to run AIGatewayBench against your own build. If you want to run the LiteLLM Rust gateway in your stack, <a href="https://docs.google.com/forms/d/e/1FAIpQLSecWdOjkzjEson2UiZpDftOoZPs8RQbtlAM40KSvDXZqEgYaA/viewform?usp=dialog" target="_blank" rel="noopener noreferrer">sign up for the early beta</a>, and for the architecture behind the migration see <a href="https://docs.litellm.ai/blog/litellm-rust-launch">Migrating LiteLLM to Rust</a>.</p>]]></content>
        <author>
            <name>Ishaan Jaffer</name>
            <uri>https://www.linkedin.com/in/reffajnaahsi/</uri>
        </author>
        <category label="rust" term="rust"/>
        <category label="ai-gateway" term="ai-gateway"/>
        <category label="performance" term="performance"/>
        <category label="benchmarks" term="benchmarks"/>
        <category label="engineering" term="engineering"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Announcing Router Plugins: Customize Routing Signals]]></title>
        <id>https://docs.litellm.ai/blog/router-plugins-on-the-proxy</id>
        <link href="https://docs.litellm.ai/blog/router-plugins-on-the-proxy"/>
        <updated>2026-07-17T12:00:00.000Z</updated>
        <summary type="html"><![CDATA[Router plugins are now live on LiteLLM. Configure a plugin pipeline to determine which models to pick for a given input. Plugins can be chained as well]]></summary>
        <content type="html"><![CDATA[<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Availability</div><div class="admonitionContent_BuS1"><p>Router plugins run on the proxy from <strong>v1.94.x</strong>. The design is still evolving; tell us how you'd use it and what you'd want next in the <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">autorouter discussion on GitHub (#32168)</a>.</p></div></div>
<p>Router plugins are now available on LiteLLM. Each plugin receives the routing context, enriches it, and hands it to the next before the router makes the final decision.</p>
<p>The push came from the <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">autorouter discussion (#32168)</a>: teams wanted to layer their own signals (language detection, domain classification, tenant policy, budget caps) onto routing without waiting for each one to land in core. This plugin extension lets teams make these changes while keeping LiteLLM's routing core stable.</p>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="get-started">Get Started<a href="https://docs.litellm.ai/blog/router-plugins-on-the-proxy#get-started" class="hash-link" aria-label="Direct link to Get Started" title="Direct link to Get Started">​</a></h2>
<p>A plugin is any object with an <code>async run</code> method that takes the routing context and returns it. Narrow <code>candidate_models</code> to restrict what the router can pick, and write to <code>signals</code> to pass information downstream.</p>
<p>Write one next to your <code>config.yaml</code> in <code>plugins/cheap_first.py</code>:</p>
<div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token keyword" style="color:rgb(0, 0, 255)">from</span><span class="token plain"> litellm</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">types</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">router </span><span class="token keyword" style="color:rgb(0, 0, 255)">import</span><span class="token plain"> RoutingContext</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain"></span><span class="token keyword" style="color:rgb(0, 0, 255)">class</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(38, 127, 153)">CheapFirst</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token keyword" style="color:rgb(0, 0, 255)">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(0, 0, 255)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(0, 0, 255)">run</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> context</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> RoutingContext</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"> </span><span class="token operator" style="color:rgb(0, 0, 0)">-</span><span class="token operator" style="color:rgb(0, 0, 0)">&gt;</span><span class="token plain"> RoutingContext</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        cheaper </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token plain">m </span><span class="token keyword" style="color:rgb(0, 0, 255)">for</span><span class="token plain"> m </span><span class="token keyword" style="color:rgb(0, 0, 255)">in</span><span class="token plain"> context</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">candidate_models </span><span class="token keyword" style="color:rgb(0, 0, 255)">if</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"mini"</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(0, 0, 255)">in</span><span class="token plain"> m</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        context</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">candidate_models </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> cheaper </span><span class="token keyword" style="color:rgb(0, 0, 255)">or</span><span class="token plain"> context</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">candidate_models</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        context</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">signals</span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token string" style="color:rgb(163, 21, 21)">"cheap-first"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token plain"> </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token string" style="color:rgb(163, 21, 21)">"applied"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(0, 112, 193)">bool</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">cheaper</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token keyword" style="color:rgb(0, 0, 255)">return</span><span class="token plain"> context</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">cheap_first_plugin </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> CheapFirst</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><br></span></code></pre></div></div>
<p>Reference it from <code>router_settings.plugins</code> by its dotted path. The proxy loads it from the local file next to <code>config.yaml</code>, or from an installed pip package using the same syntax:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> openai/gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/OPENAI_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> openai/gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/OPENAI_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain"></span><span class="token key atrule">router_settings</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token key atrule">plugins</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> plugins.cheap_first.cheap_first_plugin</span><br></span></code></pre></div></div>
<p>Start the proxy, and every routing decision now runs through your plugin:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">litellm --config config.yaml</span><br></span></code></pre></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="chaining-plugins">Chaining plugins<a href="https://docs.litellm.ai/blog/router-plugins-on-the-proxy#chaining-plugins" class="hash-link" aria-label="Direct link to Chaining plugins" title="Direct link to Chaining plugins">​</a></h2>
<p>Plugins run as a pipeline in list order, and each one sees the mutations and signals the previous plugin left behind. Add a second plugin in <code>plugins/enterprise_only.py</code> that reads the tenant off <code>context.metadata</code> and, for enterprise callers, restricts the pool to the models it left; it can also read the <code>cheap-first</code> signal published upstream:</p>
<div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token keyword" style="color:rgb(0, 0, 255)">from</span><span class="token plain"> litellm</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">types</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">router </span><span class="token keyword" style="color:rgb(0, 0, 255)">import</span><span class="token plain"> RoutingContext</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain"></span><span class="token keyword" style="color:rgb(0, 0, 255)">class</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(38, 127, 153)">EnterpriseOnly</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    ENTERPRISE </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token string" style="color:rgb(163, 21, 21)">"acme-corp"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"globex"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token keyword" style="color:rgb(0, 0, 255)">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(0, 0, 255)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(0, 0, 255)">run</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">self</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> context</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> RoutingContext</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"> </span><span class="token operator" style="color:rgb(0, 0, 0)">-</span><span class="token operator" style="color:rgb(0, 0, 0)">&gt;</span><span class="token plain"> RoutingContext</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        tenant </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> context</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">metadata</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token string" style="color:rgb(163, 21, 21)">"tenant"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"default"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token keyword" style="color:rgb(0, 0, 255)">if</span><span class="token plain"> tenant </span><span class="token keyword" style="color:rgb(0, 0, 255)">in</span><span class="token plain"> self</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">ENTERPRISE</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">            context</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">candidate_models </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">                m </span><span class="token keyword" style="color:rgb(0, 0, 255)">for</span><span class="token plain"> m </span><span class="token keyword" style="color:rgb(0, 0, 255)">in</span><span class="token plain"> context</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">candidate_models </span><span class="token keyword" style="color:rgb(0, 0, 255)">if</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"gpt-4o"</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(0, 0, 255)">in</span><span class="token plain"> m</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">            </span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token comment" style="color:rgb(0, 128, 0)"># signals from earlier plugins are available here</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        cheap </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> context</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">signals</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token string" style="color:rgb(163, 21, 21)">"cheap-first"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token string" style="color:rgb(163, 21, 21)">"applied"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        context</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">signals</span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token string" style="color:rgb(163, 21, 21)">"enterprise-only"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token plain"> </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token string" style="color:rgb(163, 21, 21)">"tenant"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> tenant</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"after_cheap"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> cheap</span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token keyword" style="color:rgb(0, 0, 255)">return</span><span class="token plain"> context</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">enterprise_only_plugin </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> EnterpriseOnly</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><br></span></code></pre></div></div>
<p>List both under <code>router_settings.plugins</code>. <code>cheap_first</code> runs first and narrows the pool, then <code>enterprise_only</code> receives that narrowed pool and applies its own policy on top:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">router_settings</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token key atrule">plugins</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> plugins.cheap_first.cheap_first_plugin</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> plugins.enterprise_only.enterprise_only_plugin</span><br></span></code></pre></div></div>
<p>Each plugin only narrows; if any plugin removes every remaining candidate, the request raises rather than silently falling back to the full pool, so a policy in the chain can't be bypassed by an earlier one.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="plugins-inside-the-autorouter">Plugins inside the autorouter<a href="https://docs.litellm.ai/blog/router-plugins-on-the-proxy#plugins-inside-the-autorouter" class="hash-link" aria-label="Direct link to Plugins inside the autorouter" title="Direct link to Plugins inside the autorouter">​</a></h2>
<p><code>router_settings.plugins</code> runs the pipeline globally, on every routing decision. You can also scope plugins to the <a href="https://docs.litellm.ai/docs/proxy/auto_routing">complexity autorouter</a>, where they run inside the tier pick against that tier's actual candidate pool. Put them under <code>complexity_router_config.plugins</code> on the auto-router model:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> smart</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> auto_router/complexity_router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">tiers</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">SIMPLE</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token string" style="color:rgb(163, 21, 21)">"gpt-4o-mini"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">COMPLEX</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token string" style="color:rgb(163, 21, 21)">"gpt-4o"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"gpt-4o-mini"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">default_model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">plugins</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> plugins.cheap_first.cheap_first_plugin</span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> openai/gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/OPENAI_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> openai/gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_key</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/OPENAI_API_KEY</span><br></span></code></pre></div></div>
<p>Here the autorouter first classifies the request into a tier, then the plugin filters that tier's pool before a deployment is picked. So a <code>COMPLEX</code> request that classifies into <code>["gpt-4o", "gpt-4o-mini"]</code> still passes through <code>cheap_first</code>, which keeps only <code>gpt-4o-mini</code>. As with the global pipeline, <code>default_model</code> is not an escape hatch: if a plugin drops every candidate in the tier, the request raises rather than falling back to it.</p>
<p>Two things to know when combining plugins with the complexity router: <code>session_affinity</code> is disabled when plugins are configured, so a mid-session policy change still applies on later turns instead of being skipped by a cached model pin, and <code>adaptive: true</code> alongside <code>plugins</code> raises at config validation, since the bandit selector doesn't consume plugin-narrowed pools yet.</p>
<p>For the full contract, the request lifecycle, and more on scoping plugins to the autorouter's tiers, see the <a href="https://docs.litellm.ai/docs/routing_plugins">routing plugins docs</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="register-your-plugin">Register your plugin<a href="https://docs.litellm.ai/blog/router-plugins-on-the-proxy#register-your-plugin" class="hash-link" aria-label="Direct link to Register your plugin" title="Direct link to Register your plugin">​</a></h2>
<p>We are also making plugins discoverable with a <code>router_plugins.json</code> at the root of the LiteLLM repo.</p>
<p>Here's a sample entry:</p>
<div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token property">"name"</span><span class="token operator" style="color:rgb(0, 0, 0)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"language-detector"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token property">"description"</span><span class="token operator" style="color:rgb(0, 0, 0)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"Detects the user's language and publishes a routing signal."</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token property">"author"</span><span class="token operator" style="color:rgb(0, 0, 0)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"Jean Nuñez"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token property">"repo"</span><span class="token operator" style="color:rgb(0, 0, 0)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"https://github.com/jeann2013/language-detector"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token property">"commit"</span><span class="token operator" style="color:rgb(0, 0, 0)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"9e712819269173fc25a16f59ca3e9890f7864ac1"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token property">"version"</span><span class="token operator" style="color:rgb(0, 0, 0)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"1.0.0"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token property">"pypi"</span><span class="token operator" style="color:rgb(0, 0, 0)">:</span><span class="token plain"> </span><span class="token null keyword" style="color:rgb(0, 0, 255)">null</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token property">"litellm_version"</span><span class="token operator" style="color:rgb(0, 0, 0)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"&gt;=1.94.0"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token property">"entrypoint"</span><span class="token operator" style="color:rgb(0, 0, 0)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"litellm_plugin_language_detector.plugin.language_detector_plugin"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token property">"license"</span><span class="token operator" style="color:rgb(0, 0, 0)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"MIT"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token property">"tags"</span><span class="token operator" style="color:rgb(0, 0, 0)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token string" style="color:rgb(163, 21, 21)">"language"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"classification"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"routing"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">}</span><br></span></code></pre></div></div>
<p>The first community entry is language-detector by <a href="https://github.com/jeann2013" target="_blank" rel="noopener noreferrer">Jean Nuñez</a>, which detects the user's language and publishes a routing signal. It pins to a reviewed commit, targets litellm&gt;=1.94.0, and its entrypoint is litellm_plugin_language_detector.plugin.language_detector_plugin; drop that string under router_settings.plugins and it runs. If you've written a plugin, add it to the catalog so others can find it.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="feedback">Feedback<a href="https://docs.litellm.ai/blog/router-plugins-on-the-proxy#feedback" class="hash-link" aria-label="Direct link to Feedback" title="Direct link to Feedback">​</a></h2>
<p>If you have any feedback, we'd love to hear it!</p>
<p>Please share your thoughts on the <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">autorouter discussion on GitHub (#32168)</a> or just reach out to me (<a href="mailto:krrish@berri.ai" target="_blank" rel="noopener noreferrer">krrish@berri.ai</a>) with your thoughts on how this can be improved!</p>]]></content>
        <author>
            <name>Krrish Dholakia</name>
            <uri>https://www.linkedin.com/in/krish-d/</uri>
        </author>
        <category label="routing" term="routing"/>
        <category label="complexity-router" term="complexity-router"/>
        <category label="plugins" term="plugins"/>
        <category label="proxy" term="proxy"/>
        <category label="product" term="product"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Auto Router v2: one router for complexity, semantic, and adaptive routing]]></title>
        <id>https://docs.litellm.ai/blog/autorouter-v2</id>
        <link href="https://docs.litellm.ai/blog/autorouter-v2"/>
        <updated>2026-07-13T12:00:00.000Z</updated>
        <summary type="html"><![CDATA[Auto Router v2 folds LiteLLM's complexity, semantic, and adaptive routers into a single router with an LLM classifier, keyword tiers, multi-model pools, and adaptive Thompson sampling.]]></summary>
        <content type="html"><![CDATA[<div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Availability</div><div class="admonitionContent_BuS1"><p>Auto Router v2 ships in <strong>v1.94.x</strong>. The earliest dev release cuts <strong>Tuesday, 2026-07-14</strong>. Suggestions and feedback: <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>.</p></div></div>
<p>Auto Router v2 collapses complexity, semantic, and adaptive routing into a single <code>auto_router/complexity_router</code>. One config now covers heuristic scoring, LLM classification, lexical or semantic keyword rules, and Thompson-sampled tier pools.</p>
<p>The push came from the community. On <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>, users pointed out that all three routing strategies should converge into a single Auto Router. One router with configurable signals and weights keeps the API simple while letting the routing engine evolve internally, instead of forcing you to pick a mode up front.</p>
<p>The operational half came from <a href="https://github.com/BerriAI/litellm/discussions/32172" target="_blank" rel="noopener noreferrer">discussion #32172</a>: predictable beats clever for debuggability. A fixed, versioned mapping from capability class to model is what makes "why did this response cost 4x today" answerable after the fact.</p>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-v2-adds">What v2 adds<a href="https://docs.litellm.ai/blog/autorouter-v2#what-v2-adds" class="hash-link" aria-label="Direct link to What v2 adds" title="Direct link to What v2 adds">​</a></h2>
<table><thead><tr><th>Capability</th><th>Before</th><th>After</th></tr></thead><tbody><tr><td>Classification</td><td>Heuristic scorer only</td><td>Heuristic, LLM classifier, lexical or semantic keyword rules (<a href="https://github.com/BerriAI/litellm/pull/32169" target="_blank" rel="noopener noreferrer">#32169</a>, <a href="https://github.com/BerriAI/litellm/pull/32859" target="_blank" rel="noopener noreferrer">#32859</a>)</td></tr><tr><td>Tier value</td><td>One model per tier</td><td>One model, random-pick pool, or Thompson-sampled pool (<a href="https://github.com/BerriAI/litellm/pull/32967" target="_blank" rel="noopener noreferrer">#32967</a>, <a href="https://github.com/BerriAI/litellm/pull/32947" target="_blank" rel="noopener noreferrer">#32947</a>)</td></tr><tr><td>Technical keywords</td><td>Fixed built-in list</td><td><code>custom_technical_keywords</code> appends without replacing (<a href="https://github.com/BerriAI/litellm/pull/32262" target="_blank" rel="noopener noreferrer">#32262</a>)</td></tr><tr><td>Decision log</td><td>"keyword rule fired"</td><td><code>cause=literal_keyword_match | semantic_keyword_match | complexity_scorer</code> (<a href="https://github.com/BerriAI/litellm/pull/32943" target="_blank" rel="noopener noreferrer">#32943</a>)</td></tr><tr><td>Alias <code>litellm_params</code></td><td>Silently dropped</td><td>Merged into outbound request (<a href="https://github.com/BerriAI/litellm/pull/32974" target="_blank" rel="noopener noreferrer">#32974</a>)</td></tr><tr><td>Session affinity</td><td>Reclassified every turn</td><td>Opt-in <code>session_affinity</code>: pin the first-turn model for the session, skip reclassification (<a href="https://github.com/BerriAI/litellm/pull/33126" target="_blank" rel="noopener noreferrer">#33126</a>)</td></tr></tbody></table>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="one-config-all-the-knobs">One config, all the knobs<a href="https://docs.litellm.ai/blog/autorouter-v2#one-config-all-the-knobs" class="hash-link" aria-label="Direct link to One config, all the knobs" title="Direct link to One config, all the knobs">​</a></h2>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">model_list</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">model_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> smart</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">litellm_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> auto_router/complexity_router</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">drop_params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">tiers</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">SIMPLE</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    </span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token string" style="color:rgb(163, 21, 21)">"gpt-4o-mini"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"claude-haiku-4-5"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token plain">   </span><span class="token comment" style="color:rgb(0, 128, 0)"># random-pick pool</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">MEDIUM</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">    gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4o                                 </span><span class="token comment" style="color:rgb(0, 128, 0)"># single pin</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">COMPLEX</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain">   claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">REASONING</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5.5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token comment" style="color:rgb(0, 128, 0)"># optional: LLM classifier instead of heuristic scorer</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_type</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> llm</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">classifier_llm_config</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">haiku</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">20251001</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">timeout_ms</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(9, 134, 88)">2000</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token comment" style="color:rgb(0, 128, 0)"># optional: keyword rules, escalate to highest matched tier</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">keyword_tier_rules</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">keywords</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token string" style="color:rgb(163, 21, 21)">"hi"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"hello"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"thanks"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">            </span><span class="token key atrule">tier</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> SIMPLE</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">keywords</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token string" style="color:rgb(163, 21, 21)">"kubernetes"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"k8s"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"istio"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">            </span><span class="token key atrule">tier</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> REASONING</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">semantic_keyword_matching</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">embedding_model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> voyage</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">3</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">match_threshold</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(9, 134, 88)">0.5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token comment" style="color:rgb(0, 128, 0)"># optional: append to the built-in technical keyword list</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">custom_technical_keywords</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token plain">kafka</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> redis</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> postgresql</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> udp</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> dns</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token comment" style="color:rgb(0, 128, 0)"># optional: Thompson-sample within the tier's pool</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">adaptive</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token comment" style="color:rgb(0, 128, 0)"># optional: pin a session to its first-turn model (preserves prompt cache)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">session_affinity</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">session_affinity_ttl_seconds</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(9, 134, 88)">3600</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">complexity_router_default_model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> claude</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">5</span><br></span></code></pre></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="notes-on-the-new-pieces">Notes on the new pieces<a href="https://docs.litellm.ai/blog/autorouter-v2#notes-on-the-new-pieces" class="hash-link" aria-label="Direct link to Notes on the new pieces" title="Direct link to Notes on the new pieces">​</a></h2>
<p><strong>LLM classifier</strong> goes through the same <code>Router</code> instance, so credentials, budgets, and fallbacks apply. Timeout, empty content, or schema mismatch falls back to the heuristic scorer.</p>
<p><strong>Keyword rules</strong> run before the scorer. Multiple matches escalate to the highest tier (SIMPLE &lt; MEDIUM &lt; COMPLEX &lt; REASONING), so rule order does not silently change behavior. Semantic matching uses MAX aggregation (was MEAN), so one strong keyword match is not diluted by other utterances on the tier.</p>
<p><strong>Adaptive</strong> turns tier pools into learning pools. Cold requests sample only inside the classified tier instead of collapsing on the cheapest model. Feedback attributes back to the model that actually served the previous turn, even when stateless routing picks a different one this turn.</p>
<p><strong>Session affinity</strong> (opt-in) pins the first-turn model for a session and skips reclassification on later turns, so provider-side prompt caches keyed to that model do not get invalidated when a follow-up ("thanks!") would otherwise classify into a different tier (<a href="https://github.com/BerriAI/litellm/pull/33126" target="_blank" rel="noopener noreferrer">#33126</a>). TTL defaults to 3600s. <code>session_id</code> comes from request metadata.</p>
<p><strong>Decision log</strong> emits one greppable line per request:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token plain">ComplexityRouter: routing decision cause=complexity_scorer,      tier=SIMPLE,     score=-0.150, signals=['short (7 tokens)', 'simple (what is)'], routed_model=gpt-4o-mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">ComplexityRouter: routing decision cause=literal_keyword_match,  tier=REASONING,                                                                    routed_model=gpt-5.5</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">ComplexityRouter: routing decision cause=semantic_keyword_match, tier=REASONING,                                                                    routed_model=gpt-5.5</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">ComplexityRouter: routing decision cause=session_affinity_pin,                                                                                      routed_model=gpt-5.5</span><br></span></code></pre></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="fixes-worth-calling-out">Fixes worth calling out<a href="https://docs.litellm.ai/blog/autorouter-v2#fixes-worth-calling-out" class="hash-link" aria-label="Direct link to Fixes worth calling out" title="Direct link to Fixes worth calling out">​</a></h2>
<p><code>drop_params</code>, <code>cache_control_injection_points</code>, and any other <code>litellm_params</code> set on the auto router alias itself used to vanish when the router picked a tier. They now merge into the outbound request, without overriding anything the caller passed explicitly (<a href="https://github.com/BerriAI/litellm/pull/32974" target="_blank" rel="noopener noreferrer">#32974</a>). Same PR fixes an Anthropic <code>/v1/messages</code> to Responses API <code>tool_choice</code> shape bug that broke Bedrock-backed complexity routers (reported in <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a> by @icsy7867).</p>
<p>UI got a working Test Connection per tier (<a href="https://github.com/BerriAI/litellm/pull/32950" target="_blank" rel="noopener noreferrer">#32950</a>) and required-tier inline validation (<a href="https://github.com/BerriAI/litellm/pull/32978" target="_blank" rel="noopener noreferrer">#32978</a>).</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="try-it">Try it<a href="https://docs.litellm.ai/blog/autorouter-v2#try-it" class="hash-link" aria-label="Direct link to Try it" title="Direct link to Try it">​</a></h2>
<p>Existing complexity router configs keep working. To try v2, add <code>keyword_tier_rules</code>, <code>classifier_type: llm</code>, <code>adaptive: true</code>, <code>session_affinity: true</code>, or a list value on a tier to your existing <code>complexity_router_config</code>. Full reference on the <a href="https://docs.litellm.ai/docs/proxy/auto_routing">Auto Routing docs page</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="whats-next">What's next<a href="https://docs.litellm.ai/blog/autorouter-v2#whats-next" class="hash-link" aria-label="Direct link to What's next" title="Direct link to What's next">​</a></h2>
<p><strong>Router plugins.</strong> From <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>: a pipeline where each plugin receives the routing context, enriches it, and passes it on before Auto Router makes the final call. Plugins do not replace the router; they contribute structured signals (classification, policies, candidate filters, scores) that Auto Router combines.</p>
<p>Concrete end-to-end:</p>
<ol>
<li>User sends a request.</li>
<li>Language plugin detects <code>en</code>.</li>
<li>Domain classifier labels it <code>coding</code> with 0.93 confidence.</li>
<li>Tenant policy limits allowed providers to OpenAI and Anthropic.</li>
<li>Budget plugin removes models exceeding the tenant's cost cap.</li>
<li>Auto Router picks the best remaining model from the enriched context.</li>
</ol>
<p>Config sketch:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#000000"><span class="token key atrule">router_settings</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token key atrule">plugins</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> language</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">detector</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> domain</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">classifier</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">provider</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> openai/gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">mini</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> budget</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">policy</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">params</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">daily_limit</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(9, 134, 88)">100</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> tenant</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">policy</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain"> </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> custom</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">python</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> ./plugins/my_router.py</span><br></span></code></pre></div></div>
<p>The initial work landed in <a href="https://github.com/BerriAI/litellm/pull/32972" target="_blank" rel="noopener noreferrer">#32972</a>; support for plugins on the proxy, and custom plugin files will be next.</p>
<p><strong>Also on the list:</strong></p>
<ul>
<li><strong>Escalation ceilings on fallback chains.</strong> Per-request cap on escalations plus a cooldown once a key walks the chain N times, so a bad upstream cannot cascade into a bill.</li>
<li><strong>Attributable decisions.</strong> Stamp the routed model and routing-table version on every response, and export structured decision traces (candidates, scores, fallbacks, latency) through the standard logging integrations.</li>
</ul>
<p>Running Auto Router in production and hitting these? Drop a note on <a href="https://github.com/BerriAI/litellm/discussions/32168" target="_blank" rel="noopener noreferrer">discussion #32168</a>.</p>]]></content>
        <author>
            <name>Krrish Dholakia</name>
            <uri>https://www.linkedin.com/in/krish-d/</uri>
        </author>
        <category label="routing" term="routing"/>
        <category label="complexity-router" term="complexity-router"/>
        <category label="semantic-router" term="semantic-router"/>
        <category label="adaptive" term="adaptive"/>
        <category label="product" term="product"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Incident Report: Prompt Cache Invalidation for Claude Code on Bedrock Invoke]]></title>
        <id>https://docs.litellm.ai/blog/bedrock-invoke-prompt-caching-incident</id>
        <link href="https://docs.litellm.ai/blog/bedrock-invoke-prompt-caching-incident"/>
        <updated>2026-07-13T10:00:00.000Z</updated>
        <summary type="html"><![CDATA[Date: July 4 to July 10, 2026]]></summary>
        <content type="html"><![CDATA[<p><strong>Date:</strong> July 4 to July 10, 2026<br>
<strong>Affected versions:</strong> <code>v1.91.0</code> and <code>v1.91.1</code><br>
<strong>Severity:</strong> Medium (silent cost regression; no correctness impact)<br>
<strong>Status:</strong> Resolved in <code>v1.91.2</code></p>
<blockquote>
<p><strong>Note:</strong> If you run Claude Code against Amazon Bedrock through LiteLLM on either <code>v1.91.0</code> or <code>v1.91.1</code>, upgrade to <code>v1.91.2</code> or higher.</p>
</blockquote>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="summary">Summary<a href="https://docs.litellm.ai/blog/bedrock-invoke-prompt-caching-incident#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary">​</a></h2>
<p>Between July 4 and July 10, proxies running <code>v1.91.0</code> or <code>v1.91.1</code> silently broke Anthropic prompt caching for Claude Code sessions routed through Amazon Bedrock's Invoke API. For the customers who reported it, warm-session cache hit rates dropped from roughly 90% to 25-45% and team daily spend rose 2-3x for the same usage. Requests kept returning 200s with correct completions; the only symptoms were the cache miss rate and the bill.</p>
<p>The cause: <a href="https://github.com/BerriAI/litellm/pull/31364" target="_blank" rel="noopener noreferrer">PR #31364</a> moved every <code>role: "system"</code> entry in <code>messages</code> into the top-level <code>system</code> field on the Invoke path, which invalidates every cache breakpoint past the tool definitions and system prompt. The fix shipped July 10 in <code>v1.91.2</code> (<a href="https://github.com/BerriAI/litellm/pull/32578" target="_blank" rel="noopener noreferrer">#32578</a>, <a href="https://github.com/BerriAI/litellm/pull/32831" target="_blank" rel="noopener noreferrer">#32831</a>, <a href="https://github.com/BerriAI/litellm/pull/32882" target="_blank" rel="noopener noreferrer">#32882</a>), with regression tests that fail on pre-fix code.</p>
<p>We own this outcome entirely. The trigger was a poorly documented change in how new Claude models and Claude Code use system messages, but customers run a gateway precisely so they do not have to track provider quirks. Translating requests faithfully, including their caching semantics, is our core job and here we fell short. This post explains exactly what happened, why our testing and review failed to catch it, and what we have changed so this class of regression does not ship again.</p>
<!-- -->
<hr>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="background">Background<a href="https://docs.litellm.ai/blog/bedrock-invoke-prompt-caching-incident#background" class="hash-link" aria-label="Direct link to Background" title="Direct link to Background">​</a></h2>
<p>Three facts set up the incident:</p>
<ol>
<li><strong>Claude prompt caching is prefix based:</strong>
<ol>
<li>the pricing of tokens in increasing cost is:<!-- -->
<ol>
<li>cache read (0.1x)</li>
<li>normal write (1x)</li>
<li>cache write (1.25x for 5m ttl, 2x for 1h ttl)</li>
</ol>
</li>
<li>when Claude Code makes a new request, the Bedrock provider checks if any previous request was a truncated prefix of the current request. If so, it reads from the cache only up to that point.</li>
</ol>
</li>
<li><strong>Mid-conversation system messages are new:</strong>
<ol>
<li>On May 28, 2026, Claude Opus 4.8 shipped as the first model accepting <code>role: "system"</code> entries inside <code>messages</code> (<a href="https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages" target="_blank" rel="noopener noreferrer">docs</a>). This was documented on the Claude API docs <a href="https://web.archive.org/web/20260528184320/https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages" target="_blank" rel="noopener noreferrer">on the same day</a>.</li>
<li>Claude Code (<code>v2.1.154</code>) began emitting them on May 28, 2026, with no mention in its changelog.</li>
<li>Bedrock documented the same support by <a href="https://web.archive.org/web/20260609182343/https://docs.aws.amazon.com/bedrock/latest/userguide/claude-messages-mid-conversation-system.html" target="_blank" rel="noopener noreferrer">June 9, 2026</a> at the latest (the first archive.org capture; the page may have appeared as early as May 28).</li>
</ol>
</li>
<li><strong>Bedrock has two Anthropic APIs with different rules:</strong>
<ol>
<li>Converse requires all system content in a top-level field; LiteLLM has hoisted it there since December 2024 (<a href="https://github.com/BerriAI/litellm/pull/7037" target="_blank" rel="noopener noreferrer">#7037</a>).</li>
<li>Invoke takes the native Anthropic Messages format, where models older than Opus 4.8 reject mid-conversation system entries with a 400 and newer models accept them.</li>
</ol>
</li>
</ol>
<hr>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-went-wrong">What went wrong<a href="https://docs.litellm.ai/blog/bedrock-invoke-prompt-caching-incident#what-went-wrong" class="hash-link" aria-label="Direct link to What went wrong" title="Direct link to What went wrong">​</a></h2>
<ol>
<li>After May 28, Claude Code sessions on Bedrock Invoke began failing with 400s mid-session when two things were true:<!-- -->
<ol>
<li>the model was older than Opus 4.8</li>
<li>the model is served under an alias<!-- -->
<ol>
<li>Claude Code detects capabilities by looking for version substrings like <code>opus-4-7</code> or <code>sonnet-4-6</code> in the model name.</li>
<li>For example, an alias like <code>bedrock-claude</code> contains none, so Claude Code assumes the newest feature set and always emits mid-conversation system messages.</li>
</ol>
</li>
</ol>
</li>
<li>An enterprise customer worked around the 400s with a local patch that hoisted every system entry from <code>messages</code> into top-level <code>system</code>, mirroring the Converse behavior, and asked us to upstream it. We shipped it as <a href="https://github.com/BerriAI/litellm/pull/31364" target="_blank" rel="noopener noreferrer">#31364</a> in <code>v1.91.0</code> on July 4.</li>
<li>The hoist fixed the 400s but by always hoisting the system entries in <code>messages</code>, that would invalidate the entire <code>messages</code> cache whenever a new mid-conversation system message was written by Claude Code, which we measured to happen every ~3 turns on average.</li>
<li>This greatly decreased the cache hit rate and increased the cache write rate, increasing spend.</li>
</ol>
<hr>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="detection-and-response">Detection and response<a href="https://docs.litellm.ai/blog/bedrock-invoke-prompt-caching-incident#detection-and-response" class="hash-link" aria-label="Direct link to Detection and response" title="Direct link to Detection and response">​</a></h2>
<p>On July 8, an affected customer gave a detailed bug report of this regression. We reproduced it ourselves the same day end-to-end.</p>
<p>Three PRs fixed it, all released July 10 in <code>v1.91.2</code> after extensive end-to-end testing, with regression tests that fail on pre-fix code:</p>
<ol>
<li><a href="https://github.com/BerriAI/litellm/pull/32578" target="_blank" rel="noopener noreferrer">#32578</a> disables mid-conversation system message hoisting on Invoke.</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32831" target="_blank" rel="noopener noreferrer">#32831</a> re-enables hoisting on models below Opus 4.8.</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32882" target="_blank" rel="noopener noreferrer">#32882</a> disables hoisting on Sonnet 5 and Fable 5, too.</li>
</ol>
<table><thead><tr><th>Date (2026)</th><th>Event</th></tr></thead><tbody><tr><td>May 28</td><td>Opus 4.8 ships; Claude Code starts emitting mid-conversation system messages</td></tr><tr><td>Jun 27</td><td>Customer workaround upstreamed as <a href="https://github.com/BerriAI/litellm/pull/31364" target="_blank" rel="noopener noreferrer">#31364</a></td></tr><tr><td>Jul 4</td><td><code>v1.91.0</code> ships with the regression</td></tr><tr><td>Jul 6</td><td>Customer observes 2-3x spend and collapsed cache hit rates</td></tr><tr><td>Jul 8</td><td>Regression reported; root cause identified; fix opened</td></tr><tr><td>Jul 10</td><td><code>v1.91.2</code> ships with all three fixes and regression tests</td></tr><tr><td>Jul 13</td><td>Customer confirms full recovery</td></tr></tbody></table>
<hr>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="why-our-process-did-not-catch-this">Why our process did not catch this<a href="https://docs.litellm.ai/blog/bedrock-invoke-prompt-caching-incident#why-our-process-did-not-catch-this" class="hash-link" aria-label="Direct link to Why our process did not catch this" title="Direct link to Why our process did not catch this">​</a></h2>
<ol>
<li><strong>Testing the original patch was not end-to-end.</strong> We validated it with single-turn <code>curl</code> requests showing a 400 become a 200 that we assumed was the shape that Claude Code would use. That was not the case. We did not trace the root cause (we did not yet know mid-conversation system messages existed) or its caching implications, and treated it as a harmless edge case fix.</li>
<li><strong>Review lacked the context to object.</strong> The human reviewer saw a small compatibility patch with passing tests and no explanation of why Claude Code started sending these kinds of mid-conversation system messages, and our AI review bots did not flag the caching implication either. Nobody in the loop had the info to connect the hoist to cache invalidation.</li>
<li><strong>Cost regressions are silent.</strong> Every response was a 200 with a correct completion. The only signal was cache-read token counts, which nothing in our CI or monitoring measured.</li>
<li><strong>The documentation was incomplete.</strong> The feature never appeared in the Claude Code changelog, and as of July 13 the Claude API docs still describe it as Opus 4.8 only (without mentioning Sonnet or Fable 5) and unavailable on Bedrock, which contradicts our empirical measurements.</li>
</ol>
<hr>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-we-are-changing">What we are changing<a href="https://docs.litellm.ai/blog/bedrock-invoke-prompt-caching-incident#what-we-are-changing" class="hash-link" aria-label="Direct link to What we are changing" title="Direct link to What we are changing">​</a></h2>
<ul>
<li>Our e2e suite will gain a scripted multi-turn Claude Code session growing to roughly 250k tokens of context against real Bedrock, asserting cache reads grow monotonically and never collapse (started in <a href="https://github.com/BerriAI/litellm/pull/32963" target="_blank" rel="noopener noreferrer">#32963</a>).<!-- -->
<ul>
<li><strong>Update (July 21):</strong> <a href="https://github.com/BerriAI/litellm/pull/32963" target="_blank" rel="noopener noreferrer">#32963</a> merged July 14 with live-Bedrock tests that fail whenever a mid-conversation system message costs a session its cached prefix; <a href="https://github.com/BerriAI/litellm/pull/33807" target="_blank" rel="noopener noreferrer">#33807</a> extends the same coverage to Vertex AI and Azure. The full 250k-token session is still in progress.</li>
</ul>
</li>
<li>We will set up a weekly automated load test that will flag anomalies in spend, cache reads and writes, turn latency, error rates, etc., so cost and performance regressions are detected and fixed before a release.<!-- -->
<ul>
<li><strong>Update (July 21):</strong> done in <a href="https://github.com/BerriAI/litellm/pull/34166" target="_blank" rel="noopener noreferrer">#34166</a>. CI now runs concurrent Claude Code-shaped sessions weekly against real Anthropic and Bedrock Invoke deployments and fails if error rate, warm-turn cache reads, cache write volume, p95 turn latency, or recorded spend leaves its baseline.</li>
</ul>
</li>
<li>Daily automated diffs of Anthropic's SDKs and docs alert us to new features that need translation support before customer traffic finds them.</li>
<li>We <a href="https://en.wikipedia.org/wiki/Eating_your_own_dog_food" target="_blank" rel="noopener noreferrer">dogfood</a> LiteLLM internally and will set up monitoring for new request shapes, such as unknown <code>anthropic-beta</code> headers, and the same anomoly detction, which will alert us ahead of a release.</li>
<li>Bug fixes now have a higher merge bar: validated means reproduced against the real client's traffic on their exact end-user application end-to-end and a complete understanding of the root cause; synthetic requests are not enough.</li>
</ul>
<hr>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="known-limitations">Known limitations<a href="https://docs.litellm.ai/blog/bedrock-invoke-prompt-caching-incident#known-limitations" class="hash-link" aria-label="Direct link to Known limitations" title="Direct link to Known limitations">​</a></h2>
<ol>
<li>Converse rejects system entries inside <code>messages</code> at any position, so on <code>bedrock_converse</code> we must still hoist, and Claude Code sessions routed through Converse still lose cached prefix on every mid-conversation system message. If you run Claude Code against Bedrock, route it through the Invoke path (<code>bedrock/invoke/&lt;model&gt;</code>). We are raising the API constraint with AWS.</li>
<li>We are testing whether the Vertex AI and Azure paths need equivalent hoisting and will update this post when we have more info.<!-- -->
<ul>
<li><strong>Update (July 21):</strong> they do, and <a href="https://github.com/BerriAI/litellm/pull/33807" target="_blank" rel="noopener noreferrer">#33807</a> (merged July 20, in the next stable release) closes the gap. We verified live that both providers enforce the same per-model contract as Bedrock Invoke, so both paths now reuse the model-aware hoisting logic: older models return completions instead of 400s and newer models keep the cached prefix byte-identical. Live e2e tests cover both providers.</li>
</ul>
</li>
</ol>
<p>To every team whose bill went up because of this: we are sorry. The value of a gateway is that this class of provider change gets absorbed by us instead of reaching you, and the tests, monitoring, and process improvements above are how we intend to keep it that way.</p>]]></content>
        <author>
            <name>Mateo Wang</name>
            <uri>https://www.linkedin.com/in/mateo-wang</uri>
        </author>
        <author>
            <name>Krrish Dholakia</name>
            <uri>https://www.linkedin.com/in/krish-d/</uri>
        </author>
        <author>
            <name>Ishaan Jaffer</name>
            <uri>https://www.linkedin.com/in/reffajnaahsi/</uri>
        </author>
        <category label="incident-report" term="incident-report"/>
        <category label="bedrock" term="bedrock"/>
        <category label="caching" term="caching"/>
        <category label="claude-code" term="claude-code"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[July stability update: hardening MCP auth and cutting pass-through memory]]></title>
        <id>https://docs.litellm.ai/blog/two-week-stability-update</id>
        <link href="https://docs.litellm.ai/blog/two-week-stability-update"/>
        <updated>2026-07-11T12:00:00.000Z</updated>
        <summary type="html"><![CDATA[A two-week product quality update. We addressed two major issues (MCP credential resolution and pass-through memory) and shipped 134 bug fixes in total. Plus our next goal: 95% end-to-end test coverage.]]></summary>
        <content type="html"><![CDATA[<p>Over the last two weeks we addressed two major product quality issues:</p>
<ol>
<li>The MCP Gateway did not have a single class for credential resolution.</li>
<li>Pass-through APIs had high memory consumption.</li>
</ol>
<p>Across the same window we shipped 134 bug fixes in total. This post covers the two big changes first, then the rest of the AI Eng and reliability work, the full breakdown, and what we are doing next.</p>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="mcp-gateway-a-single-credential-resolver">MCP Gateway: a single credential resolver<a href="https://docs.litellm.ai/blog/two-week-stability-update#mcp-gateway-a-single-credential-resolver" class="hash-link" aria-label="Direct link to MCP Gateway: a single credential resolver" title="Direct link to MCP Gateway: a single credential resolver">​</a></h2>
<p>The MCP Gateway connects a user's AI app (Claude Desktop, Cursor, an agent) to the upstream MCP servers it wants to use, and it has to attach the right credential for each upstream.</p>
<p>Before, the MCP Gateway would infer the authentication method a user was trying to use based on the credentials they set. We have now built a credential resolver class that lets a user explicitly specify which auth method they are using. We believe this will significantly drive down a class of bugs users were reporting on MCPs.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="before-infer-the-auth-method-from-whatever-credentials-are-set">Before: infer the auth method from whatever credentials are set<a href="https://docs.litellm.ai/blog/two-week-stability-update#before-infer-the-auth-method-from-whatever-credentials-are-set" class="hash-link" aria-label="Direct link to Before: infer the auth method from whatever credentials are set" title="Direct link to Before: infer the auth method from whatever credentials are set">​</a></h3>
<!-- -->
<p>Why this was bad: there was no single place that decided which credential to attach, and no error when the decision was ambiguous. Inferring from set fields meant two code paths could read the same server and disagree. The precedence order meant adding a field could silently change which credential won. And the silent fallback meant an unhandled case still sent something upstream instead of refusing. Ambiguity resolved to "attach a credential anyway" instead of "stop."</p>
<p>The types of bugs we saw from this:</p>
<ul>
<li>Tokens sent to the wrong upstream server.</li>
<li>Duplicate or stale <code>Authorization</code> headers slipping through.</li>
<li>MCP requests skipping the normal team, route, and key checks.</li>
<li>Cached OAuth tokens going stale or crossing between users.</li>
<li>Upstream URLs and secrets showing up in logs.</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="after-the-user-declares-the-auth-method-and-it-fails-closed">After: the user declares the auth method, and it fails closed<a href="https://docs.litellm.ai/blog/two-week-stability-update#after-the-user-declares-the-auth-method-and-it-fails-closed" class="hash-link" aria-label="Direct link to After: the user declares the auth method, and it fails closed" title="Direct link to After: the user declares the auth method, and it fails closed">​</a></h3>
<!-- -->
<p>Each mode has its own fully typed config, so there is no guessing from which fields are set and no precedence order. The match is exhaustive, so adding a mode without handling it fails the type checker, and an unhandled case raises instead of quietly attaching no auth.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="ai-eng-llm-providers-27-fixes">AI Eng: LLM providers (27 fixes)<a href="https://docs.litellm.ai/blog/two-week-stability-update#ai-eng-llm-providers-27-fixes" class="hash-link" aria-label="Direct link to AI Eng: LLM providers (27 fixes)" title="Direct link to AI Eng: LLM providers (27 fixes)">​</a></h2>
<p>AI Eng was focused on driving down reported bugs. Most of them were on new models (Claude 4.8, Opus 4.8, Bedrock Invoke). Here are the types of bugs we fixed:</p>
<table><thead><tr><th>Type of bug</th><th>Count</th></tr></thead><tbody><tr><td>New model capabilities getting dropped</td><td>10</td></tr><tr><td>Wrong cost or billing</td><td>6</td></tr><tr><td>Routing or fallback picking the wrong model</td><td>6</td></tr><tr><td>Broken response or streaming output</td><td>5</td></tr><tr><td>Total</td><td>27</td></tr></tbody></table>
<p>Most of these were on Bedrock and the routing layer.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="performance-pass-through-memory">Performance: pass-through memory<a href="https://docs.litellm.ai/blog/two-week-stability-update#performance-pass-through-memory" class="hash-link" aria-label="Direct link to Performance: pass-through memory" title="Direct link to Performance: pass-through memory">​</a></h2>
<p>Pass-through APIs had high memory consumption. Large non-JSON pass-through downloads (batch-result files, binary and octet-stream downloads) were buffered whole in memory before being sent on. We changed this to stream the response chunk by chunk, so memory stays flat regardless of file size (<a href="https://github.com/BerriAI/litellm/pull/32386" target="_blank" rel="noopener noreferrer">#32386</a>). This covers the provider pass-through routes (<code>/vertex_ai/*</code>, <code>/bedrock/*</code>, <code>/openai/*</code>, <code>/anthropic/*</code>, and others) and custom pass-through endpoints.</p>
<!-- -->
<p>JSON responses still buffer by design, so spend logging and guardrails can inspect the body.</p>
<p>Two more fixes in the same spirit, don't pay for work nobody needs:</p>
<ul>
<li>Prometheus skips budget-metric DB lookups entirely when the gauges are no-ops (nothing is scraping them).</li>
<li>The complexity router builds its semantic route index once under concurrent cold-start, instead of rebuilding it per request.</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="by-the-numbers">By the numbers<a href="https://docs.litellm.ai/blog/two-week-stability-update#by-the-numbers" class="hash-link" aria-label="Direct link to By the numbers" title="Direct link to By the numbers">​</a></h2>
<p>All 134 fixes, by area:</p>
<table><thead><tr><th>Area</th><th>Fixes</th></tr></thead><tbody><tr><td>MCP Gateway</td><td>50</td></tr><tr><td>LLM Providers (AI Eng)</td><td>27</td></tr><tr><td>Proxy Core / Reliability</td><td>23</td></tr><tr><td>UI / Dashboard</td><td>20</td></tr><tr><td>Logging / Observability</td><td>9</td></tr><tr><td>Guardrails</td><td>5</td></tr><tr><td>Total</td><td>134</td></tr></tbody></table>
<p>These 134 are every merged <code>fix:</code> PR in the two weeks. One reported ticket often turns into several fix PRs, so this count is higher than the number of tickets in Linear.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="next-goal-95-end-to-end-test-coverage">Next goal: 95% end-to-end test coverage<a href="https://docs.litellm.ai/blog/two-week-stability-update#next-goal-95-end-to-end-test-coverage" class="hash-link" aria-label="Direct link to Next goal: 95% end-to-end test coverage" title="Direct link to Next goal: 95% end-to-end test coverage">​</a></h2>
<p>Most of these 134 bugs were caught late, in staging or from a user report. We want to catch them before they merge. We believe by investing in improving our e2e testing coverage we can significantly reduce the number of reported regressions from users on an upgrade.</p>
<p>We are learning from <a href="https://engineering.fb.com/2021/02/17/developer-tools/fix-fast/" target="_blank" rel="noopener noreferrer">Meta's approach to fixing bugs fast</a> and raising our testing bar.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="appendix">Appendix<a href="https://docs.litellm.ai/blog/two-week-stability-update#appendix" class="hash-link" aria-label="Direct link to Appendix" title="Direct link to Appendix">​</a></h2>
<p>PRs from this window.</p>
<p><strong>MCP Gateway</strong></p>
<p>Credential resolver:</p>
<ul>
<li><a href="https://github.com/BerriAI/litellm/pull/32815" target="_blank" rel="noopener noreferrer">#32815</a> credential class merge (the single typed resolver)</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32652" target="_blank" rel="noopener noreferrer">#32652</a> stale token invalidation</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32715" target="_blank" rel="noopener noreferrer">#32715</a> semantic filter fail-closed</li>
</ul>
<p>Pass-through and delegate credential modes:</p>
<ul>
<li><a href="https://github.com/BerriAI/litellm/pull/31989" target="_blank" rel="noopener noreferrer">#31989</a> passthrough / delegate modes</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32414" target="_blank" rel="noopener noreferrer">#32414</a> passthrough UI enum</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32556" target="_blank" rel="noopener noreferrer">#32556</a> passthrough call relay</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32752" target="_blank" rel="noopener noreferrer">#32752</a> configured client for passthrough</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32735" target="_blank" rel="noopener noreferrer">#32735</a> no DCR persist for passthrough</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32507" target="_blank" rel="noopener noreferrer">#32507</a> token exchange secret pairing</li>
</ul>
<p>DCR bridge (LIT-4337):</p>
<ul>
<li><a href="https://github.com/BerriAI/litellm/pull/32745" target="_blank" rel="noopener noreferrer">#32745</a> plumbing</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32747" target="_blank" rel="noopener noreferrer">#32747</a> authorize relay</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32753" target="_blank" rel="noopener noreferrer">#32753</a> facade</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32804" target="_blank" rel="noopener noreferrer">#32804</a> UI</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32527" target="_blank" rel="noopener noreferrer">#32527</a> DCR redirect_uri</li>
</ul>
<p>Sealed envelope and delegate admission (LIT-4338):</p>
<ul>
<li><a href="https://github.com/BerriAI/litellm/pull/32748" target="_blank" rel="noopener noreferrer">#32748</a> envelope module</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32794" target="_blank" rel="noopener noreferrer">#32794</a> envelope edge consumer</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32824" target="_blank" rel="noopener noreferrer">#32824</a> delegate admission</li>
</ul>
<p><strong>AI Eng (LLM providers)</strong></p>
<p>Bedrock:</p>
<ul>
<li><a href="https://github.com/BerriAI/litellm/pull/32882" target="_blank" rel="noopener noreferrer">#32882</a> flag Claude 4.8+ entries with supports_mid_conversation_system</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32831" target="_blank" rel="noopener noreferrer">#32831</a> gate in-place system role messages for Claude Invoke</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32578" target="_blank" rel="noopener noreferrer">#32578</a> keep mid-conversation system messages for Claude Invoke</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32658" target="_blank" rel="noopener noreferrer">#32658</a> retain clear_tool_uses context-management edits and emit the beta header</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32551" target="_blank" rel="noopener noreferrer">#32551</a> honor cache_control ttl on message-level cachePoint blocks</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32538" target="_blank" rel="noopener noreferrer">#32538</a> preserve cache_control ttl on message-level cache points</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32840" target="_blank" rel="noopener noreferrer">#32840</a> add jp.anthropic.claude-opus-4-8 to the model cost map</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32389" target="_blank" rel="noopener noreferrer">#32389</a> resolve regional inference profiles to regional pricing</li>
</ul>
<p>Anthropic:</p>
<ul>
<li><a href="https://github.com/BerriAI/litellm/pull/32874" target="_blank" rel="noopener noreferrer">#32874</a> thread the real provider through capability probes (was pinned to anthropic)</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32867" target="_blank" rel="noopener noreferrer">#32867</a> translate adaptive thinking/effort for pre-4.6 models</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32833" target="_blank" rel="noopener noreferrer">#32833</a> strip @version suffix in model lookup</li>
</ul>
<p>Routing and fallbacks:</p>
<ul>
<li><a href="https://github.com/BerriAI/litellm/pull/32859" target="_blank" rel="noopener noreferrer">#32859</a> complexity router keyword tiers (max aggregation, blank-keyword hardening)</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32943" target="_blank" rel="noopener noreferrer">#32943</a> complexity router logging and auth propagation, index built once</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32873" target="_blank" rel="noopener noreferrer">#32873</a> fallback rules routing split (bare-Claude coverage, cost-map precedence, legacy schema)</li>
</ul>
<p>Responses API:</p>
<ul>
<li><a href="https://github.com/BerriAI/litellm/pull/32835" target="_blank" rel="noopener noreferrer">#32835</a> raise APIError on in-stream error events</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32837" target="_blank" rel="noopener noreferrer">#32837</a> preserve reasoning_tokens through chat to responses</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32034" target="_blank" rel="noopener noreferrer">#32034</a> idempotent response-id encoding (prevents MCP gateway double-encoding)</li>
</ul>
<p>Cost, Vertex, Rerank:</p>
<ul>
<li><a href="https://github.com/BerriAI/litellm/pull/32387" target="_blank" rel="noopener noreferrer">#32387</a> add gpt-realtime-2.1 models with regional uplift</li>
<li>coerce string tiered-pricing costs and share the tier helper</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32550" target="_blank" rel="noopener noreferrer">#32550</a> forward realtime health check params (Vertex)</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32533" target="_blank" rel="noopener noreferrer">#32533</a> log rerank params at debug to stop leaking request content</li>
</ul>
<p><strong>Performance</strong></p>
<ul>
<li><a href="https://github.com/BerriAI/litellm/pull/32386" target="_blank" rel="noopener noreferrer">#32386</a> stream non-SSE pass-through responses instead of buffering in memory</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32404" target="_blank" rel="noopener noreferrer">#32404</a> stop request params from clobbering merged target query params</li>
<li><a href="https://github.com/BerriAI/litellm/pull/32834" target="_blank" rel="noopener noreferrer">#32834</a> Prometheus skips budget-metric DB lookups when gauges are no-ops</li>
</ul>]]></content>
        <author>
            <name>Ishaan Jaffer</name>
            <uri>https://www.linkedin.com/in/reffajnaahsi/</uri>
        </author>
        <author>
            <name>Tin Lo</name>
        </author>
        <author>
            <name>Mateo Wang</name>
            <uri>https://www.linkedin.com/in/mateo-wang</uri>
        </author>
        <author>
            <name>Yassin Kortam</name>
            <uri>https://www.linkedin.com/in/yassink/</uri>
        </author>
        <category label="stability" term="stability"/>
        <category label="mcp" term="mcp"/>
        <category label="performance" term="performance"/>
        <category label="product" term="product"/>
    </entry>
</feed>