<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>liteLLM Blog</title>
        <link>https://docs.litellm.ai/blog</link>
        <description>liteLLM Blog</description>
        <lastBuildDate>Fri, 31 Jul 2026 10:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <item>
            <title><![CDATA[Cut 69% Costs Stacking Auto-Routing on Prompt Caching]]></title>
            <link>https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark</link>
            <guid>https://docs.litellm.ai/blog/auto-router-prompt-caching-benchmark</guid>
            <pubDate>Fri, 31 Jul 2026 10:00:00 GMT</pubDate>
            <description><![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.]]></description>
            <content:encoded><![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:encoded>
            <category>routing</category>
            <category>complexity-router</category>
            <category>caching</category>
            <category>cost</category>
            <category>benchmarks</category>
            <category>engineering</category>
        </item>
        <item>
            <title><![CDATA[Cut 75% Claude Code cost with near frontier model quality]]></title>
            <link>https://docs.litellm.ai/blog/auto-router-cost-quality-benchmark</link>
            <guid>https://docs.litellm.ai/blog/auto-router-cost-quality-benchmark</guid>
            <pubDate>Mon, 27 Jul 2026 10:00:00 GMT</pubDate>
            <description><![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.]]></description>
            <content:encoded><![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:encoded>
            <category>routing</category>
            <category>complexity-router</category>
            <category>cost</category>
            <category>benchmarks</category>
            <category>engineering</category>
        </item>
        <item>
            <title><![CDATA[July Townhall Updates: 38 Security Fixes, 317 Bug Fixes, and Autorouter V2]]></title>
            <link>https://docs.litellm.ai/blog/july-townhall-updates</link>
            <guid>https://docs.litellm.ai/blog/july-townhall-updates</guid>
            <pubDate>Fri, 24 Jul 2026 12:00:00 GMT</pubDate>
            <description><![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.]]></description>
            <content:encoded><![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:encoded>
            <category>townhall</category>
            <category>security</category>
            <category>reliability</category>
            <category>product</category>
        </item>
        <item>
            <title><![CDATA[Day 0 Support: Claude Opus 5]]></title>
            <link>https://docs.litellm.ai/blog/claude_opus_5</link>
            <guid>https://docs.litellm.ai/blog/claude_opus_5</guid>
            <pubDate>Fri, 24 Jul 2026 10:00:00 GMT</pubDate>
            <description><![CDATA[Day 0 support for Claude Opus 5 on the LiteLLM AI Gateway. Use it across Anthropic, Azure, Vertex AI, and Bedrock.]]></description>
            <content:encoded><![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:encoded>
            <category>anthropic</category>
            <category>claude</category>
            <category>opus 5</category>
            <category>day 0 support</category>
        </item>
        <item>
            <title><![CDATA[Benchmarking the LiteLLM Rust AI Gateway: Overhead, Memory, and Cost]]></title>
            <link>https://docs.litellm.ai/blog/rust-ai-gateway-benchmarks</link>
            <guid>https://docs.litellm.ai/blog/rust-ai-gateway-benchmarks</guid>
            <pubDate>Wed, 22 Jul 2026 09:00:00 GMT</pubDate>
            <description><![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.]]></description>
            <content:encoded><![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:encoded>
            <category>rust</category>
            <category>ai-gateway</category>
            <category>performance</category>
            <category>benchmarks</category>
            <category>engineering</category>
        </item>
        <item>
            <title><![CDATA[Announcing Router Plugins: Customize Routing Signals]]></title>
            <link>https://docs.litellm.ai/blog/router-plugins-on-the-proxy</link>
            <guid>https://docs.litellm.ai/blog/router-plugins-on-the-proxy</guid>
            <pubDate>Fri, 17 Jul 2026 12:00:00 GMT</pubDate>
            <description><![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]]></description>
            <content:encoded><![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:encoded>
            <category>routing</category>
            <category>complexity-router</category>
            <category>plugins</category>
            <category>proxy</category>
            <category>product</category>
        </item>
        <item>
            <title><![CDATA[Auto Router v2: one router for complexity, semantic, and adaptive routing]]></title>
            <link>https://docs.litellm.ai/blog/autorouter-v2</link>
            <guid>https://docs.litellm.ai/blog/autorouter-v2</guid>
            <pubDate>Mon, 13 Jul 2026 12:00:00 GMT</pubDate>
            <description><![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.]]></description>
            <content:encoded><![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:encoded>
            <category>routing</category>
            <category>complexity-router</category>
            <category>semantic-router</category>
            <category>adaptive</category>
            <category>product</category>
        </item>
        <item>
            <title><![CDATA[Incident Report: Prompt Cache Invalidation for Claude Code on Bedrock Invoke]]></title>
            <link>https://docs.litellm.ai/blog/bedrock-invoke-prompt-caching-incident</link>
            <guid>https://docs.litellm.ai/blog/bedrock-invoke-prompt-caching-incident</guid>
            <pubDate>Mon, 13 Jul 2026 10:00:00 GMT</pubDate>
            <description><![CDATA[Date: July 4 to July 10, 2026]]></description>
            <content:encoded><![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:encoded>
            <category>incident-report</category>
            <category>bedrock</category>
            <category>caching</category>
            <category>claude-code</category>
        </item>
        <item>
            <title><![CDATA[July stability update: hardening MCP auth and cutting pass-through memory]]></title>
            <link>https://docs.litellm.ai/blog/two-week-stability-update</link>
            <guid>https://docs.litellm.ai/blog/two-week-stability-update</guid>
            <pubDate>Sat, 11 Jul 2026 12:00:00 GMT</pubDate>
            <description><![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.]]></description>
            <content:encoded><![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:encoded>
            <category>stability</category>
            <category>mcp</category>
            <category>performance</category>
            <category>product</category>
        </item>
        <item>
            <title><![CDATA[July Townhall: Product + Roadmap Updates]]></title>
            <link>https://docs.litellm.ai/blog/july-townhall-announcement</link>
            <guid>https://docs.litellm.ai/blog/july-townhall-announcement</guid>
            <pubDate>Thu, 09 Jul 2026 12:00:00 GMT</pubDate>
            <description><![CDATA[Join the LiteLLM July townhall on Thursday, 23 July at 7:30 AM PT to learn about LiteLLM's product updates and roadmap.]]></description>
            <content:encoded><![CDATA[<p>We are hosting our July townhall on <strong>Thursday, 23 July 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,iVBORw0KGgoAAAANSUhEUgAAAAoAAAADCAIAAAAlXwkiAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAZUlEQVR4nGOoMleqc1BpjfPPD/dxtbfWNzF18LBp6WwLjU2UUddgyDLTyHXQ74zzm5Sb2Bvr35MWkRgaGBYeFhgZpGmoydDjqlDmqJThaRHl7eRmqGqjo2akq2FpoWvjqmnhogYAKAYaoI9e0McAAAAASUVORK5CYII=&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/july_townhall_banner.50e0ad5.640.png srcset="/assets/ideal-img/july_townhall_banner.50e0ad5.640.png 640w,/assets/ideal-img/july_townhall_banner.f6cf5a1.800.png 800w" width=640 height=160></noscript></div>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="agenda">Agenda<a href="https://docs.litellm.ai/blog/july-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/july-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/july-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/july-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://docs.google.com/forms/d/e/1FAIpQLSetGEJJS1cqmGRdmL70Y1vu-FJccpozQ1R97Bpoba9eN0mjHA/viewform" target="_blank" rel="noopener noreferrer">LiteLLM July 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:encoded>
            <category>announcement</category>
            <category>townhall</category>
        </item>
        <item>
            <title><![CDATA[Day 0 Support: GPT-5.6 (Sol, Terra, Luna)]]></title>
            <link>https://docs.litellm.ai/blog/gpt_5_6</link>
            <guid>https://docs.litellm.ai/blog/gpt_5_6</guid>
            <pubDate>Thu, 09 Jul 2026 10:00:00 GMT</pubDate>
            <description><![CDATA[Day 0 support for the GPT-5.6 family (Sol, Terra, and Luna) on LiteLLM.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" alt="LiteLLM x GPT-5.6" src="https://docs.litellm.ai/assets/images/hero-8993f4226fae32570dd811183b27dfdf.png" width="4800" height="2508" class="img_ev3q"></p>
<p>LiteLLM now supports the <a href="https://openai.com/index/previewing-gpt-5-6-sol/" target="_blank" rel="noopener noreferrer">GPT-5.6 family</a>. Route traffic to OpenAI's newest frontier models through the LiteLLM AI Gateway with no code changes.</p>
<!-- -->
<p>GPT-5.6 introduces a new naming system where the number identifies the generation and the tier name identifies a durable capability level. <code>gpt-5.6-sol</code> is the flagship for complex reasoning and agentic workloads, <code>gpt-5.6-terra</code> is a balanced model for everyday work with performance competitive with GPT-5.5 at roughly half the cost, and <code>gpt-5.6-luna</code> is the fastest and most affordable tier. Per OpenAI, the family sets a new state of the art on agentic coding (Terminal-Bench 2.1) with broad gains in long-horizon biology and cybersecurity workflows. GPT-5.6 also adds a new <code>max</code> reasoning effort for the deepest single-agent thinking and an <code>ultra</code> mode that coordinates subagents on the most complex tasks.</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>Living post</div><div class="admonitionContent_BuS1"><p><strong>This post is updated as GPT-5.6 support expands.</strong> GPT-5.6 is now available on Azure OpenAI in addition to OpenAI direct. Global Azure deployments match OpenAI list pricing, and regional deployments (<code>azure/us/*</code> and <code>azure/eu/*</code>) are tracked with the standard 10% regional uplift.</p></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><strong>No Docker image upgrade needed.</strong> GPT-5.6 routes through the existing <code>OpenAIGPT5Config</code> in LiteLLM (the version classifier already matches <code>gpt-5.4</code> and newer), so any recent version works out of the box. The GPT-5.6 pricing and metadata are also bundled starting in <code>v1.93.0-dev.2</code> for anyone running with <code>LITELLM_LOCAL_MODEL_COST_MAP=true</code>.</p><p>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 feature is available on <code>v1.76.0</code> and above.</p></div></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="usage">Usage<a href="https://docs.litellm.ai/blog/gpt_5_6#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">LiteLLM Proxy</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">LiteLLM Python SDK</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Azure OpenAI</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"> gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5.6</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sol</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">5.6</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sol</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">5.6</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">terra</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">5.6</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">terra</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">5.6</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">luna</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">5.6</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">luna</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><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 OPENAI_API_KEY=$OPENAI_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.93.0-dev.2 \</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><p><strong>3. Test it</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://0.0.0.0:4000/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 $LITELLM_KEY" \</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": "gpt-5.6-sol",</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">      {"role": "user", "content": "Write a Python function to check if a number is prime."}</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=""><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)">"openai/gpt-5.6-sol"</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 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 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)">"Write a Python function to check if a number is prime."</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 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="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 comment" style="color:rgb(0, 128, 0)"># gpt-5.6-terra for balanced, cost-efficient everyday work</span><span class="token plain"></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)">"openai/gpt-5.6-terra"</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 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 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 the key ideas in this design doc."</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 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="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 comment" style="color:rgb(0, 128, 0)"># gpt-5.6-luna for the fastest, lowest-cost tier</span><span class="token plain"></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)">"openai/gpt-5.6-luna"</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 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 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)">"Classify this ticket as bug, feature, or question."</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 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>Point <code>model</code> at the Azure deployment name. Global deployments use the <code>azure/gpt-5.6-*</code> names; regional deployments use <code>azure/us/gpt-5.6-*</code> or <code>azure/eu/gpt-5.6-*</code> so cost tracking picks up the regional uplift automatically.</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">5.6</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sol</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/gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5.6</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">sol</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_API_BASE</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_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_version</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/AZURE_API_VERSION</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.6</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">terra</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/gpt</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">5.6</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">terra</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_API_BASE</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_API_KEY</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">api_version</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/AZURE_API_VERSION</span><br></span></code></pre></div></div><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)">"azure/gpt-5.6-sol"</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 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 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)">"Write a Python function to check if a number is prime."</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 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></div>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="responses-api">Responses API<a href="https://docs.litellm.ai/blog/gpt_5_6#responses-api" class="hash-link" aria-label="Direct link to Responses API" title="Direct link to Responses API">​</a></h2>
<p>For agentic and multi-turn workflows, use <code>/v1/responses</code> to preserve reasoning state and output item metadata across turns.</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://0.0.0.0:4000/v1/responses" \</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 $LITELLM_KEY" \</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": "gpt-5.6-sol",</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    "input": "Plan and write a Python script that scrapes a webpage and summarizes it."</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="pricing">Pricing<a href="https://docs.litellm.ai/blog/gpt_5_6#pricing" class="hash-link" aria-label="Direct link to Pricing" title="Direct link to Pricing">​</a></h2>
<p>Prices are per 1M tokens (USD), shown as short context (≤272K tokens) / long context (&gt;272K tokens).</p>
<table><thead><tr><th>Model</th><th>Input</th><th>Cached input</th><th>Cache write</th><th>Output</th></tr></thead><tbody><tr><td><code>gpt-5.6-sol</code></td><td>$5.00 / $10.00</td><td>$0.50 / $1.00</td><td>$6.25 / $12.50</td><td>$30.00 / $45.00</td></tr><tr><td><code>gpt-5.6-terra</code></td><td>$2.50 / $5.00</td><td>$0.25 / $0.50</td><td>$3.125 / $6.25</td><td>$15.00 / $22.50</td></tr><tr><td><code>gpt-5.6-luna</code></td><td>$1.00 / $2.00</td><td>$0.10 / $0.20</td><td>$1.25 / $2.50</td><td>$6.00 / $9.00</td></tr></tbody></table>
<p>Global Azure OpenAI deployments (<code>azure/gpt-5.6-*</code>) match these OpenAI list prices. Regional deployments (<code>azure/us/gpt-5.6-*</code> and <code>azure/eu/gpt-5.6-*</code>) carry the standard 10% uplift on the base rate; LiteLLM tracks the difference automatically once you route through the regional model name.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="notes">Notes<a href="https://docs.litellm.ai/blog/gpt_5_6#notes" class="hash-link" aria-label="Direct link to Notes" title="Direct link to Notes">​</a></h2>
<ul>
<li>For cost tracking on the GPT-5.6 models, hit the <strong>Reload Model Cost Map</strong> button in the Admin UI (or <code>POST /reload/model_cost_map</code>). Works on any LiteLLM version <code>v1.76.0</code> or newer, with no container restart or image upgrade required.</li>
<li>GPT-5.6 supports reasoning, function calling, parallel tool calls, vision (image input), prompt caching, web search, and structured output; see the <a href="https://docs.litellm.ai/docs/providers/openai">OpenAI provider docs</a> for advanced usage.</li>
<li>The GPT-5.6 family launched in limited preview and OpenAI is expanding availability through the API and Codex; check your OpenAI account for model access.</li>
</ul>]]></content:encoded>
            <category>openai</category>
            <category>gpt-5.6</category>
            <category>gpt-5.6-sol</category>
            <category>gpt-5.6-terra</category>
            <category>gpt-5.6-luna</category>
            <category>completion</category>
            <category>day 0 support</category>
        </item>
        <item>
            <title><![CDATA[5 ways to cut Claude Code costs with LiteLLM]]></title>
            <link>https://docs.litellm.ai/blog/save-claude-code-costs-with-litellm</link>
            <guid>https://docs.litellm.ai/blog/save-claude-code-costs-with-litellm</guid>
            <pubDate>Sat, 04 Jul 2026 10:00:00 GMT</pubDate>
            <description><![CDATA[Practical levers a platform admin can pull on the LiteLLM proxy to reduce Claude Code spend without asking developers to change a thing.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" alt="5 ways to save Claude Code cost with LiteLLM" src="https://docs.litellm.ai/assets/images/title_card-74ec0bfe3411225f0a91e484904b17da.png" width="3200" height="1800" class="img_ev3q"></p>
<p>Claude Code is one of the heaviest consumers of input tokens in a modern engineering org. Long tool loops, large file reads, and MCP catalogs with hundreds of tools push every request toward the top of the context window, and the bill scales with it.</p>
<p>If Claude Code already points at a LiteLLM proxy (via <code>ANTHROPIC_BASE_URL</code>), there are five levers the platform admin can pull to bring that cost down. None of them require a client-side change.</p>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="1-budget-windows--budget-fallbacks">1. Budget windows + budget fallbacks<a href="https://docs.litellm.ai/blog/save-claude-code-costs-with-litellm#1-budget-windows--budget-fallbacks" class="hash-link" aria-label="Direct link to 1. Budget windows + budget fallbacks" title="Direct link to 1. Budget windows + budget fallbacks">​</a></h2>
<p>Two knobs on the virtual key.</p>
<p><strong>Budget windows</strong> cap how much the key can spend inside a rolling time period. Set <code>max_budget</code> (dollars) and <code>budget_duration</code> ("24h", "7d", "30d", etc). LiteLLM resets the counter automatically at the end of every window. You can stack windows too, e.g. $10/day AND $100/month, so one bad afternoon can't burn the whole month:</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 'http://0.0.0.0:4000/key/generate' \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  --header 'Authorization: Bearer &lt;your-master-key&gt;' \</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-raw '{</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    "budget_limits": [</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      {"budget_duration": "24h", "max_budget": 10},</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      {"budget_duration": "30d", "max_budget": 100}</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>
<p><strong>Budget fallbacks</strong> decide what happens once a per-model budget is exhausted. Instead of erroring at the developer's terminal, attach <code>model_max_budget</code> per model and a <code>budget_fallbacks</code> chain naming the cheaper models to reroute to. The request silently falls to the first fallback still under its own budget:</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/key/generate \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -H "Authorization: Bearer $ADMIN_KEY" \</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">    "model_max_budget": {</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      "claude-opus-4-8":   {"budget_limit": 20.0, "time_period": "1d"},</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      "claude-sonnet-5":   {"budget_limit": 10.0, "time_period": "1d"},</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      "claude-haiku-4-5":  {"budget_limit": 5.0,  "time_period": "1d"}</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">    "budget_fallbacks": {</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      "claude-opus-4-8":  ["claude-sonnet-5", "claude-haiku-4-5"],</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      "claude-sonnet-5":  ["claude-haiku-4-5"]</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>
<p>Once the developer burns $20 of Opus in a day, subsequent Opus requests silently reroute to Sonnet; if Sonnet is also tapped out, Haiku picks up. Fallback models without a <code>model_max_budget</code> entry are treated as unlimited.</p>
<p><strong>→ Learn more:</strong> <a href="https://docs.litellm.ai/docs/proxy/users#set-multiple-budget-windows-on-a-key">Budget Windows</a> · <a href="https://docs.litellm.ai/docs/proxy/budget_fallbacks">Budget Fallbacks</a></p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="2-automatic-prompt-caching">2. Automatic Prompt Caching<a href="https://docs.litellm.ai/blog/save-claude-code-costs-with-litellm#2-automatic-prompt-caching" class="hash-link" aria-label="Direct link to 2. Automatic Prompt Caching" title="Direct link to 2. Automatic Prompt Caching">​</a></h2>
<p>Claude's prompt cache reads a cache hit for roughly 10% of the price of a fresh input token, but only if the request marks the right message with <code>cache_control</code>. LiteLLM injects that marker for you: point <code>cache_control_injection_points</code> at the system message (or the second-to-last user turn), and every Claude Code call through the proxy carries the checkpoint without any client-side edit.</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">sonnet</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">sonnet</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 key atrule">cache_control_injection_points</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">location</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> message</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">          </span><span class="token key atrule">role</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> system</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">optional_pre_call_checks</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)">"prompt_caching"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><br></span></code></pre></div></div>
<p>for automatically injecting this in all requests, do this</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">sonnet</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">4.5</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">20250929</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">sonnet</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@20250929</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)"># ...</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">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">default_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">cache_control_injection_points</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">location</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> message</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token key atrule">role</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> system</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  </span><span class="token key atrule">optional_pre_call_checks</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)">"prompt_caching"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">]</span><br></span></code></pre></div></div>
<p>Turning on 'prompt_caching' as a pre call check, means if you run multiple deployments of the same Claude model, LiteLLM will intelligently route to the model deployment which was initially used for the request.</p>
<p><strong>→ Learn more:</strong> <a href="https://docs.litellm.ai/docs/tutorials/prompt_caching">Auto-Inject Prompt Caching Checkpoints</a> · <a href="https://docs.litellm.ai/docs/tutorials/claude_code_prompt_cache_routing">Claude Code - Prompt Cache Routing</a></p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="3-prompt-compression-headroom">3. Prompt Compression (Headroom)<a href="https://docs.litellm.ai/blog/save-claude-code-costs-with-litellm#3-prompt-compression-headroom" class="hash-link" aria-label="Direct link to 3. Prompt Compression (Headroom)" title="Direct link to 3. Prompt Compression (Headroom)">​</a></h2>
<p>Prompt cache trims the static prefix; Headroom trims the dynamic middle. Tool outputs, file reads, database dumps, and RAG payloads get rewritten into a compressed form before they reach the model, and if the model actually needs the original bytes, a <code>retrieve_headroom</code> tool call fetches them on demand. Reported savings run 60-95% on the compressible portion of Claude Code traffic.</p>
<p>Headroom runs as a sidecar container next to LiteLLM. Register it as a <code>pre_call</code> guardrail and either flip <code>default_on: true</code> or attach it to per-developer virtual keys.</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">guardrails</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">guardrail_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> headroom</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">compression</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">guardrail</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> headroom</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">mode</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> pre_call</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"> https</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">headroom</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">service</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      </span><span class="token key atrule">default_on</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><br></span></code></pre></div></div>
<p>The developer still exports <code>ANTHROPIC_BASE_URL</code> and runs <code>claude</code>; the only thing they notice is a smaller number on the spend log.</p>
<p><strong>→ Learn more:</strong> <a href="https://docs.litellm.ai/docs/proxy/headroom">Headroom guardrail setup guide</a></p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="4-defer-mcp-tools">4. Defer MCP tools<a href="https://docs.litellm.ai/blog/save-claude-code-costs-with-litellm#4-defer-mcp-tools" class="hash-link" aria-label="Direct link to 4. Defer MCP tools" title="Direct link to 4. Defer MCP tools">​</a></h2>
<p>A Claude Code session that connects to five or six MCP servers can easily surface a few hundred tools, and every one of those tool schemas ships on every <code>tools/list</code> call. That is pure input-token overhead on a workload where the model uses two or three tools per turn.</p>
<p>Turn on <code>mcp_tool_search_enabled</code> on the virtual key, and LiteLLM replaces the full catalog with two virtual tools, <code>mcp_tool_search</code> and <code>mcp_tool_call</code>. The model searches by keyword, gets the ranked matches back, and calls the one it wants. The token cost of tool listing collapses from hundreds of schemas to two.</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/key/generate \</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">  -H "Authorization: Bearer $ADMIN_KEY" \</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">    "object_permission": {</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      "mcp_tool_search_enabled": true,</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">      "mcp_servers": ["github", "slack", "linear", "jira"]</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>
<p>Ranking is token-overlap over <code>name + description</code>, so there is no embedding dependency to run. The access surface does not widen; search only returns tools the key was already allowed to call.</p>
<p><strong>→ Learn more:</strong> <a href="https://docs.litellm.ai/docs/mcp_tool_search">MCP Tool Search</a></p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="5-auto-routing">5. Auto routing<a href="https://docs.litellm.ai/blog/save-claude-code-costs-with-litellm#5-auto-routing" class="hash-link" aria-label="Direct link to 5. Auto routing" title="Direct link to 5. Auto routing">​</a></h2>
<p>Send every request to the smallest model that can handle it, so cheap requests never touch the expensive model. LiteLLM ships three flavors: Semantic (embedding match), Complexity (rule-based, zero external call), and Adaptive (learns from live traffic, beta).</p>
<p>Complexity router is the fastest to set up. Point Claude Code at <code>smart-router</code> and it classifies each request into a tier:</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 comment" style="color:rgb(0, 128, 0)"># Target models</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"> 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" 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><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"> 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" 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">sonnet</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"> 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 plain">4</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token number" style="color:rgb(9, 134, 88)">20250514</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"> o1</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">preview</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"> o1</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">preview</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)"># Complexity router</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"> 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><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"> o1</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">preview</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><strong>→ Learn more:</strong> <a href="https://docs.litellm.ai/docs/proxy/auto_routing#complexity-router">Complexity Router</a> · <a href="https://docs.litellm.ai/docs/proxy/auto_routing">Semantic Auto Routing</a> · <a href="https://docs.litellm.ai/docs/adaptive_router">Adaptive Router</a></p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="stacking-the-levers">Stacking the levers<a href="https://docs.litellm.ai/blog/save-claude-code-costs-with-litellm#stacking-the-levers" class="hash-link" aria-label="Direct link to Stacking the levers" title="Direct link to Stacking the levers">​</a></h2>
<p>The five features compose. Budget-based fallbacks bound the total spend regardless of what else you do. Prompt cache checkpoints and Headroom compression each shave a different slice of the request payload before it hits the model. MCP tool search cuts the tool schema overhead at the front of every turn. Auto routing sends every request to the smallest model that can handle it. Turn them on together and the same Claude Code workload runs on a fraction of the input tokens it did before, without touching a single developer machine.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="help-us-make-this-better">Help us make this better<a href="https://docs.litellm.ai/blog/save-claude-code-costs-with-litellm#help-us-make-this-better" class="hash-link" aria-label="Direct link to Help us make this better" title="Direct link to Help us make this better">​</a></h2>
<p>We're actively investing in cost optimization across the whole stack. If you've got ideas, on auto routing, better cache heuristics, smarter budget policies, anything, join the discussion at <a href="https://github.com/BerriAI/litellm/discussions/32172" target="_blank" rel="noopener noreferrer">litellm#32172</a>.</p>]]></content:encoded>
            <category>claude-code</category>
            <category>cost</category>
            <category>budgets</category>
            <category>headroom</category>
            <category>mcp</category>
            <category>prompt-caching</category>
        </item>
        <item>
            <title><![CDATA[Day 0 Support: Claude Sonnet 5]]></title>
            <link>https://docs.litellm.ai/blog/claude_sonnet_5</link>
            <guid>https://docs.litellm.ai/blog/claude_sonnet_5</guid>
            <pubDate>Tue, 30 Jun 2026 10:00:00 GMT</pubDate>
            <description><![CDATA[Day 0 support for Claude Sonnet 5 on the LiteLLM AI Gateway. Use it across Anthropic, Azure, Vertex AI, and Bedrock.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" alt="LiteLLM x Claude Sonnet 5" src="https://docs.litellm.ai/assets/images/litellm_claude_sonnet_5_announcement-72d68fa72362d60463791439896e3c9d.png" width="4800" height="2508" class="img_ev3q"></p>
<p>LiteLLM now supports <a href="https://www.anthropic.com/news/claude-sonnet-5" target="_blank" rel="noopener noreferrer">Claude Sonnet 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-sonnet-5">What's new in Sonnet 5<a href="https://docs.litellm.ai/blog/claude_sonnet_5#whats-new-in-sonnet-5" class="hash-link" aria-label="Direct link to What's new in Sonnet 5" title="Direct link to What's new in Sonnet 5">​</a></h2>
<p>Sonnet 5 is the most agentic Sonnet model yet, with performance close to Opus 4.8 at a fraction of the price. A few things stand out for teams running it through a gateway:</p>
<ul>
<li><strong>Opus-class quality, Sonnet pricing.</strong> Anthropic reports Sonnet 5 performs close to Opus 4.8 while costing far less, and is a substantial step up from Sonnet 4.6 on reasoning, tool use, coding, and knowledge work. (<a href="https://www.anthropic.com/news/claude-sonnet-5" target="_blank" rel="noopener noreferrer">details from Anthropic</a>)</li>
<li><strong>Built to run agents.</strong> It plans, drives tools like browsers and terminals, runs autonomously, and checks its own output without being asked, finishing complex tasks where earlier Sonnet models would stop short. Anthropic highlights gains on BrowseComp (agentic search) and OSWorld-Verified (computer use).</li>
<li><strong>Adaptive thinking only.</strong> Sonnet 5 decides how deeply to think on its own. You steer it per request with <code>reasoning_effort</code> or <code>output_config.effort</code>; fixed thinking budgets, <code>temperature</code>, <code>top_p</code>, and assistant message prefill are not supported by the model.</li>
<li><strong>$3 / MTok input and $15 / MTok output</strong>, with prompt caching at $0.30 / MTok (read) and $3.75 / MTok (write). Anthropic is running introductory pricing of $2 / MTok input and $10 / MTok output through August 31, 2026. On Bedrock, the <code>us.</code>, <code>eu.</code>, <code>au.</code>, and <code>jp.</code> inference profiles carry the usual 10% regional premium while <code>global.</code> stays at base price; LiteLLM tracks every variant automatically.</li>
<li><strong>1M-token context</strong>, up to 128K output tokens.</li>
<li><strong>One gateway, every surface.</strong> Vision, PDF input, computer use, tool calling, prompt caching, adaptive thinking, and structured output, all available across Anthropic, Azure, Vertex AI, and Bedrock with unified spend tracking, logging, and fallbacks.</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="enabling-sonnet-5">Enabling Sonnet 5<a href="https://docs.litellm.ai/blog/claude_sonnet_5#enabling-sonnet-5" class="hash-link" aria-label="Direct link to Enabling Sonnet 5" title="Direct link to Enabling Sonnet 5">​</a></h2>
<p>Sonnet 5 ships in the <strong><code>v1.92.0-dev.1</code></strong> image (and every release after it). How you pick it up depends on where your proxy reads pricing from:</p>
<ul>
<li>
<p><strong>Default (remote cost map): no upgrade needed.</strong> In the LiteLLM UI, open the <strong>Price Data</strong> tab under <strong>Models + Endpoints</strong> and click <strong>Reload Price Data</strong> (or, as a proxy admin, <code>POST /reload/model_cost_map</code>). This refetches the latest pricing from LiteLLM's cost map <strong>and</strong> re-registers provider routing in one step, so <code>claude-sonnet-5</code> becomes available across Anthropic, Azure, Vertex AI, and Bedrock, even if you're on an older proxy version.</p>
</li>
<li>
<p><strong>Running <code>LITELLM_LOCAL_MODEL_COST_MAP=true</code>?</strong> The cost map is baked into the image, so the Reload button won't reach it. Pull <code>v1.92.0-dev.1</code> or later to get the bundled Sonnet 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.92.0-dev.1</span><br></span></code></pre></div></div>
</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="usage">Usage<a href="https://docs.litellm.ai/blog/claude_sonnet_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-sonnet-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">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></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.92.0-dev.1 \</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">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"> azure_ai/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/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.92.0-dev.1 \</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">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"> vertex_ai/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">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.92.0-dev.1 \</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">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"> bedrock/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">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-sonnet-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.92.0-dev.1 \</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-sonnet-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>]]></content:encoded>
            <category>anthropic</category>
            <category>claude</category>
            <category>sonnet 5</category>
            <category>day 0 support</category>
        </item>
        <item>
            <title><![CDATA[LiteLLM × Headroom: Use 60-95% fewer tokens with Claude Code]]></title>
            <link>https://docs.litellm.ai/blog/headroom-integration</link>
            <guid>https://docs.litellm.ai/blog/headroom-integration</guid>
            <pubDate>Tue, 30 Jun 2026 10:00:00 GMT</pubDate>
            <description><![CDATA[Cut input tokens on Claude Code and other LLM traffic by attaching Headroom as a pre_call guardrail on LiteLLM.]]></description>
            <content:encoded><![CDATA[<p><a href="https://headroomlabs-ai.github.io/headroom/" target="_blank" rel="noopener noreferrer">Headroom</a> now runs as a native guardrail on the LiteLLM proxy, compressing tool outputs, RAG payloads, database results, and file reads before they reach the model.</p>
<!-- -->
<p>Long-context agents burn most of their input budget on repeated tool output, retrieved chunks, and stale scratch state. Headroom intelligently rewrites that content so the model sees the same information at a fraction of the tokens.</p>
<p>If the model needs the full context, LiteLLM will also pass a 'retrieve_headroom' tool to the model, to retrieve the full context from Headroom.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-is-it-deployed">How is it deployed?<a href="https://docs.litellm.ai/blog/headroom-integration#how-is-it-deployed" class="hash-link" aria-label="Direct link to How is it deployed?" title="Direct link to How is it deployed?">​</a></h2>
<p>Headroom runs as a sidecar to LiteLLM. Client traffic still hits the LiteLLM gateway; LiteLLM invokes Headroom during the <code>pre_call</code> step, swaps in the compressed messages, and forwards the payload upstream. Clients and the LLM provider never talk to Headroom directly.</p>
<p>The benefit of this is two-fold</p>
<ul>
<li><strong>Convenience:</strong> Users get 1 api base regardless of if they use prompt compression or not.</li>
<li><strong>Reliability:</strong> If Headroom goes down, your LLM calls are unaffected.</li>
</ul>
<p><img decoding="async" loading="lazy" alt="Client to LiteLLM to LLM, with Headroom attached to LiteLLM as a sidecar" src="https://docs.litellm.ai/assets/images/headroom_architecture-99994a5782fe58e170e2789f031c104c.png" width="1960" height="882" class="img_ev3q"></p>
<p>Compression works on both <code>/v1/chat/completions</code> and <code>/v1/messages</code> (Anthropic format), which makes the Claude Code rollout a one-liner for the admin: attach <code>headroom-compression</code> to a virtual key, hand it to the developer, and every request they make through <code>ANTHROPIC_BASE_URL</code> gets compressed automatically. No client-side change, no code diff.</p>
<p>Turn it on per key, per request, or globally via <code>default_on: true</code>. Confirm it ran by checking the <code>x-litellm-applied-guardrails</code> response header or the Guardrails panel in the Logs UI.</p>
<p><strong>Get started:</strong> <a href="https://docs.litellm.ai/docs/proxy/headroom">Headroom guardrail setup guide</a> (requires LiteLLM v1.92.x or later; for testing ahead of the stable cut, grab the <a href="https://github.com/BerriAI/litellm/releases/tag/v1.92.0-dev.1" target="_blank" rel="noopener noreferrer">v1.92.0-dev.1</a> dev release)</p>
<p><strong>Discussion:</strong> <a href="https://github.com/BerriAI/litellm/discussions/31816" target="_blank" rel="noopener noreferrer">GitHub discussion #31816</a></p>]]></content:encoded>
            <category>partnership</category>
            <category>guardrails</category>
            <category>context</category>
            <category>headroom</category>
            <category>claude-code</category>
        </item>
        <item>
            <title><![CDATA[June Townhall Updates: 94 Bug Fixes, OCR + Realtime are in Rust, and a Zero-Regression Commitment]]></title>
            <link>https://docs.litellm.ai/blog/june-townhall-updates</link>
            <guid>https://docs.litellm.ai/blog/june-townhall-updates</guid>
            <pubDate>Fri, 26 Jun 2026 12:00:00 GMT</pubDate>
            <description><![CDATA[A recap of the June LiteLLM town hall covering security hardening, our zero-regression commitment, 78 feature commits, and the gradual migration of the gateway to Rust.]]></description>
            <content:encoded><![CDATA[<div style="background-size:cover;background-repeat:no-repeat;position:relative;background-image:url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAECAIAAAA4WjmaAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAYUlEQVR4nC3MSQ6AIBAAQV7jwkkZ56iAsigjAv//jBFJ6tZJM0AulnGGYRJd1f9mGAA5kwrDrVN2T3ZXUGeQMZlSzpiMVFgz6VQ8xSOQtn6le3+ypbhvChkg/87Qng20+Quqoht1WlOEsgAAAABJRU5ErkJggg==&quot;)"><svg style="width:100%;height:auto;max-width:100%;margin-bottom:-4px" width="640" height="248"></svg><noscript><img style=width:100%;height:auto;max-width:100%;margin-bottom:-4px;position:absolute;top:0;left:0 src=/assets/ideal-img/june_townhall_updates_banner.2d69c8c.640.png srcset="/assets/ideal-img/june_townhall_updates_banner.2d69c8c.640.png 640w,/assets/ideal-img/june_townhall_updates_banner.a0513d3.1280.png 1280w" width=640 height=248></noscript></div>
<p>Thank you to everyone who joined our June town hall.</p>
<p>Three numbers capture the month: <strong>24 security fixes</strong>, <strong>94 bug fixes</strong>, and <strong>78 feature commits</strong>. The sections below break each one down, alongside our public commitment to zero reported regressions and the gradual migration of the LiteLLM gateway to Rust.</p>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="security-updates">Security updates<a href="https://docs.litellm.ai/blog/june-townhall-updates#security-updates" class="hash-link" aria-label="Direct link to Security updates" title="Direct link to Security updates">​</a></h2>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="last-4-weeks-by-the-numbers">Last 4 weeks: by the numbers<a href="https://docs.litellm.ai/blog/june-townhall-updates#last-4-weeks-by-the-numbers" class="hash-link" aria-label="Direct link to Last 4 weeks: by the numbers" title="Direct link to Last 4 weeks: by the numbers">​</a></h3>
<table><thead><tr><th>Metric</th><th>Count</th></tr></thead><tbody><tr><td>Vulnerabilities patched</td><td><strong>24</strong></td></tr></tbody></table>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="bug-bounty--now-live">Bug bounty — now live<a href="https://docs.litellm.ai/blog/june-townhall-updates#bug-bounty--now-live" class="hash-link" aria-label="Direct link to Bug bounty — now live" title="Direct link to Bug bounty — now live">​</a></h3>
<p>We pay for security reports.</p>
<ul>
<li><strong>Scope</strong> — the LiteLLM gateway and SDK.</li>
<li><strong>Submit</strong> via <a href="https://github.com/BerriAI/litellm/security" target="_blank" rel="noopener noreferrer">private vulnerability report on GitHub</a>.</li>
<li><strong>Triaged</strong> by maintainers and the Veria Labs security team.</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="automated-review-on-every-pr">Automated review on every PR<a href="https://docs.litellm.ai/blog/june-townhall-updates#automated-review-on-every-pr" class="hash-link" aria-label="Direct link to Automated review on every PR" title="Direct link to Automated review on every PR">​</a></h3>
<p>Every PR gets a security pass. Look for the <strong>Veria scan</strong> — it's a required check on every PR, built on Veria AI + zizmor + semgrep. False positives are flagged, never blocking.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="whats-next-for-security">What's next for security<a href="https://docs.litellm.ai/blog/june-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>
<ul>
<li>Invest more in the bug bounty program.</li>
<li>Improve code patterns during the stability sprint.</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="stability-updates">Stability updates<a href="https://docs.litellm.ai/blog/june-townhall-updates#stability-updates" class="hash-link" aria-label="Direct link to Stability updates" title="Direct link to Stability updates">​</a></h2>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="the-commitment-zero-reported-regressions-by-august-29th">The commitment: zero reported regressions by August 29th<a href="https://docs.litellm.ai/blog/june-townhall-updates#the-commitment-zero-reported-regressions-by-august-29th" class="hash-link" aria-label="Direct link to The commitment: zero reported regressions by August 29th" title="Direct link to The commitment: zero reported regressions by August 29th">​</a></h3>
<p>The goal:</p>
<ul>
<li>Close 20 reported bugs in core functionality.</li>
<li>Fix root causes in 3 high-impact components.</li>
<li>Ship a public progress report alongside the August 29 release.</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="94-bug-fixes-done">94 bug fixes done<a href="https://docs.litellm.ai/blog/june-townhall-updates#94-bug-fixes-done" class="hash-link" aria-label="Direct link to 94 bug fixes done" title="Direct link to 94 bug fixes done">​</a></h3>
<p>Fixes shipped across five areas:</p>
<ul>
<li>Proxy core &amp; resilience — 22 fixes</li>
<li>UI + Auth / SSO — 22 fixes</li>
<li>Cost, Budgets &amp; Observability — 21 fixes</li>
<li>MCP Gateway — 15 fixes</li>
<li>Streaming / Realtime APIs — 14 fixes</li>
</ul>
<p><strong>What kinds of fixes shipped:</strong></p>
<ul>
<li><strong>Billing accuracy.</strong> Closed the gaps where spend slipped through — virtual-key limits are now enforced, and cached and tiered usage on Anthropic and Bedrock is priced correctly.</li>
<li><strong>Identity &amp; 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 now list and call consistently across every auth method, with per-user credentials and proper OAuth token refresh.</li>
<li><strong>Resource leaks.</strong> Guardrails no longer re-initialize on every request, eliminating the runner leaks, latency spikes, and OOMs they caused.</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>
<p><strong>Root causes, not just symptoms:</strong></p>
<ul>
<li><strong>MCP authentication</strong> — 5 separate code paths, one per auth method, caused inconsistent tool listing and calling. Fix: a single unified code path resolves credentials across all auth methods.</li>
<li><strong>AI gateway auth</strong> — 5+ DB lookups per request to resolve key/user/team identity. Fix: caller identity resolves once into a single record — lookups cut roughly in half.</li>
<li><strong>UI forms</strong> — saving a form could overwrite unrelated fields. Fix: frontend and backend types are 100% in sync from a shared source, so only edited fields change on save.</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="public-timeline">Public timeline<a href="https://docs.litellm.ai/blog/june-townhall-updates#public-timeline" class="hash-link" aria-label="Direct link to Public timeline" title="Direct link to Public timeline">​</a></h3>
<p>Bug triage is open and active on <a href="https://github.com/BerriAI/litellm/issues/30484" target="_blank" rel="noopener noreferrer">GitHub issue #30484</a>.</p>
<ul>
<li><strong>NOW</strong> — 20 bugs open in core. Triage active.</li>
<li><strong>JULY</strong> — MCP auth unified to a single code path. AI gateway identity lookups cut in half.</li>
<li><strong>AUGUST</strong> — UI form types synced end-to-end. No more silent field overwrites on save.</li>
<li><strong>AUG 29</strong> — Public progress report ships with the release. Zero-regression target date.</li>
</ul>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="product-updates">Product updates<a href="https://docs.litellm.ai/blog/june-townhall-updates#product-updates" class="hash-link" aria-label="Direct link to Product updates" title="Direct link to Product updates">​</a></h2>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="78-feature-commits-in-june">78 feature commits in June<a href="https://docs.litellm.ai/blog/june-townhall-updates#78-feature-commits-in-june" class="hash-link" aria-label="Direct link to 78 feature commits in June" title="Direct link to 78 feature commits in June">​</a></h3>
<p><strong>Rust</strong></p>
<ul>
<li>Rust workspace · Mistral OCR bridge</li>
<li>OpenAI Realtime translation layer</li>
</ul>
<p><strong>Sandbox API</strong></p>
<ul>
<li>E2B + OpenSandbox</li>
<li>Unified code execution API</li>
</ul>
<p><strong>New models/providers</strong></p>
<ul>
<li>TinyFish · Fal.ai · Fireworks AI</li>
<li>Cloudflare Workers AI · MAI-Image-2.5</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="performance-moving-litellm-to-rust">Performance: moving LiteLLM to Rust<a href="https://docs.litellm.ai/blog/june-townhall-updates#performance-moving-litellm-to-rust" class="hash-link" aria-label="Direct link to Performance: moving LiteLLM to Rust" title="Direct link to Performance: moving LiteLLM to Rust">​</a></h3>
<p>We're migrating the LiteLLM gateway to Rust, and the early numbers make the case:</p>
<table><thead><tr><th>Metric</th><th>Rust gateway</th><th>LiteLLM (Python)</th><th>Improvement</th></tr></thead><tbody><tr><td>Per-request overhead</td><td>0.05ms</td><td>7.5ms</td><td>~150x lower</td></tr><tr><td>Throughput under load</td><td>6,782 req/s</td><td>453 req/s</td><td>15x</td></tr><tr><td>Peak memory under load</td><td>32MB</td><td>359MB</td><td>11x lighter</td></tr></tbody></table>
<p><em>Per-request overhead measured at 10 concurrent clients vs. a local mock upstream; throughput and memory under sustained load at 50 concurrent clients. Reproducible harness checked in.</em></p>
<p><strong>How the migration works:</strong> a staged rollout, moving piece by piece from a pure Python SDK + FastAPI proxy, to Python driving Rust transforms via PyO3, to a FastAPI shell with pure Rust on the hot path, to an all-Rust async server (axum).</p>
<p><strong>A gradual rollout</strong> — one route at a time, proven in production before the next begins. Same config, database, and API: nothing for you to change.</p>
<ul>
<li><strong>Aug 15</strong> — OCR routes: Mistral first, then all OCR.</li>
<li><strong>Sep 1</strong> — <code>/messages</code>, then <code>/chat/completions</code>.</li>
<li><strong>Sep 15</strong> — The router: load balancing, fallbacks, retries, cooldowns.</li>
<li><strong>Dec 1</strong> — The full server: FastAPI thin shell, then pure Rust (axum).</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="announcing-our-version-policy">Announcing our version policy<a href="https://docs.litellm.ai/blog/june-townhall-updates#announcing-our-version-policy" class="hash-link" aria-label="Direct link to Announcing our version policy" title="Direct link to Announcing our version policy">​</a></h3>
<p>Going forward, we'll maintain only the four most recent stable minor releases. This takes effect <strong>next Monday, June 29th</strong>. Our focus is ensuring stability on the most up-to-date product offerings — bookmark our <a href="https://docs.litellm.ai/release_notes" target="_blank" rel="noopener noreferrer">Release Notes</a> to stay current.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="whats-next">What's next<a href="https://docs.litellm.ai/blog/june-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>Thank you again for all the questions and feedback. We'll keep sharing concrete progress updates as these efforts ship — especially as we approach the August 29 zero-regression milestone.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="hiring">Hiring<a href="https://docs.litellm.ai/blog/june-townhall-updates#hiring" class="hash-link" aria-label="Direct link to Hiring" title="Direct link to Hiring">​</a></h2>
<p>We are actively hiring across several roles — apply <a href="https://jobs.ashbyhq.com/litellm" target="_blank" rel="noopener noreferrer">here</a> if you're interested!</p>
<p>Thank you for using LiteLLM - Krrish &amp; Ishaan</p>]]></content:encoded>
            <category>townhall</category>
            <category>security</category>
            <category>reliability</category>
            <category>product</category>
        </item>
        <item>
            <title><![CDATA[Swap OpenAI Code Interpreter for E2B/OpenSandbox]]></title>
            <link>https://docs.litellm.ai/blog/swap_openai_code_interpreter</link>
            <guid>https://docs.litellm.ai/blog/swap_openai_code_interpreter</guid>
            <pubDate>Tue, 23 Jun 2026 10:00:00 GMT</pubDate>
            <description><![CDATA[Keep the OpenAI code_interpreter tool in your requests, run the code in your own sandbox. LiteLLM intercepts the tool call and routes it to E2B or OpenSandbox; no client changes.]]></description>
            <content:encoded><![CDATA[<p><img decoding="async" loading="lazy" alt="Swap OpenAI Code Interpreter with E2B" src="https://docs.litellm.ai/assets/images/hero-e599b9dabee2c3b4ff42e7360688be0e.png" width="3320" height="1526" class="img_ev3q"></p>
<p>The OpenAI Responses and Chat Completions APIs let you declare a <code>code_interpreter</code> tool and the model runs Python inside an OpenAI-hosted container. That container is opaque, billed by OpenAI, and the code (often customer data) leaves your perimeter. LiteLLM now let's you intercept that tool call and runs it in a sandbox you control. The client request is unchanged.</p>
<p>Available starting <code>LiteLLM v1.91.0.dev1</code>. Check here for <a href="https://github.com/BerriAI/litellm/releases" target="_blank" rel="noopener noreferrer">releases</a>.</p>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-the-swap-works">How the swap works<a href="https://docs.litellm.ai/blog/swap_openai_code_interpreter#how-the-swap-works" class="hash-link" aria-label="Direct link to How the swap works" title="Direct link to How the swap works">​</a></h2>
<p>Register a sandbox tool, enable the interceptor, then call the model the way you already do. When the model emits a <code>code_interpreter</code> tool call, LiteLLM creates a sandbox (E2B or OpenSandbox), executes the generated code, feeds the result back into the loop, and tears the sandbox down on completion. The response shape stays compatible with OpenAI's native <code>code_interpreter_call</code>.</p>
<p>Two backends are supported today: <a href="https://e2b.dev/" target="_blank" rel="noopener noreferrer">E2B</a> for a managed sandbox, and <a href="https://github.com/opensandboxai/opensandbox" target="_blank" rel="noopener noreferrer">OpenSandbox</a> for self-hosted Docker-backed execution when the code or data cannot leave your network.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="sdk">SDK<a href="https://docs.litellm.ai/blog/swap_openai_code_interpreter#sdk" class="hash-link" aria-label="Direct link to SDK" title="Direct link to SDK">​</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">Responses API</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Chat Completions</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)">import</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> litellm</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)">from</span><span class="token plain"> litellm</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">sandbox</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">sandbox_tools </span><span class="token keyword" style="color:rgb(0, 0, 255)">import</span><span class="token plain"> register_sandbox_tools</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)">from</span><span class="token plain"> litellm</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">integrations</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">code_interpreter_interception</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">handler </span><span class="token keyword" style="color:rgb(0, 0, 255)">import</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">    CodeInterpreterInterceptionLogger</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">os</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token string" style="color:rgb(163, 21, 21)">"E2B_API_KEY"</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 string" style="color:rgb(163, 21, 21)">"e2b_..."</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">os</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token string" style="color:rgb(163, 21, 21)">"OPENAI_API_KEY"</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 string" style="color:rgb(163, 21, 21)">"sk-..."</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">register_sandbox_tools</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">        </span><span class="token string" style="color:rgb(163, 21, 21)">"sandbox_tool_name"</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)">"my-e2b"</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 string" style="color:rgb(163, 21, 21)">"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 plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">            </span><span class="token string" style="color:rgb(163, 21, 21)">"sandbox_provider"</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)">"e2b"</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 string" style="color:rgb(163, 21, 21)">"api_key"</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)">"os.environ/E2B_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 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"></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" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">litellm</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">callbacks </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">    CodeInterpreterInterceptionLogger</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">sandbox_tool_name</span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token string" style="color:rgb(163, 21, 21)">"my-e2b"</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">response </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(0, 0, 255)">await</span><span class="token plain"> litellm</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">aresponses</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)">"openai/gpt-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">    tools</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)">"type"</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)">"code_interpreter"</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)">"container"</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)">"type"</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)">"auto"</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"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token builtin" style="color:rgb(0, 112, 193)">input</span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token string" style="color:rgb(163, 21, 21)">"Product of first 6 primes. Just the number."</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"></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">output_text</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=""><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)">import</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> litellm</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)">from</span><span class="token plain"> litellm</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">sandbox</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">sandbox_tools </span><span class="token keyword" style="color:rgb(0, 0, 255)">import</span><span class="token plain"> register_sandbox_tools</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)">from</span><span class="token plain"> litellm</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">integrations</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">code_interpreter_interception</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">handler </span><span class="token keyword" style="color:rgb(0, 0, 255)">import</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">    CodeInterpreterInterceptionLogger</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">os</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token string" style="color:rgb(163, 21, 21)">"E2B_API_KEY"</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 string" style="color:rgb(163, 21, 21)">"e2b_..."</span><span class="token plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">os</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(4, 81, 165)">[</span><span class="token string" style="color:rgb(163, 21, 21)">"OPENAI_API_KEY"</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 string" style="color:rgb(163, 21, 21)">"sk-..."</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">register_sandbox_tools</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">        </span><span class="token string" style="color:rgb(163, 21, 21)">"sandbox_tool_name"</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)">"my-e2b"</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 string" style="color:rgb(163, 21, 21)">"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 plain"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">            </span><span class="token string" style="color:rgb(163, 21, 21)">"sandbox_provider"</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)">"e2b"</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 string" style="color:rgb(163, 21, 21)">"api_key"</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)">"os.environ/E2B_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 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"></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" style="display:inline-block"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">litellm</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">callbacks </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">    CodeInterpreterInterceptionLogger</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">sandbox_tool_name</span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token string" style="color:rgb(163, 21, 21)">"my-e2b"</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">response </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(0, 0, 255)">await</span><span class="token plain"> litellm</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">acompletion</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)">"openai/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">    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)">"Product of first 6 primes. Just the number."</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">    tools</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)">"type"</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)">"code_interpreter"</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)">"container"</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)">"type"</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)">"auto"</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"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    max_agentic_loops</span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token number" style="color:rgb(9, 134, 88)">4</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"></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></div>
<p>The native <code>code_interpreter</code> tool is rewritten before it reaches OpenAI; on the chat path it becomes a <code>litellm_code_execution</code> function tool and LiteLLM appends each sandbox result as a <code>role: tool</code> message until the model returns a final answer.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="proxy">Proxy<a href="https://docs.litellm.ai/blog/swap_openai_code_interpreter#proxy" class="hash-link" aria-label="Direct link to Proxy" title="Direct link to Proxy">​</a></h2>
<p>Same swap behind the AI gateway, with no client-side change.</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"> gpt</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"> 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</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/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">sandbox_tools</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">sandbox_tool_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> my</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">e2b</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">sandbox_provider</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> e2b</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/E2B_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">litellm_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">callbacks</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)">"code_interpreter_interception"</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">code_interpreter_interception_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">sandbox_tool_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> my</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">e2b</span><br></span></code></pre></div></div>
<p>The OpenAI SDK keeps working unchanged. Point it at the proxy, declare <code>code_interpreter</code>, and the gateway handles the rest.</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"> openai </span><span class="token keyword" style="color:rgb(0, 0, 255)">import</span><span class="token plain"> OpenAI</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">client </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> OpenAI</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">api_key</span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token string" style="color:rgb(163, 21, 21)">"sk-1234"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> base_url</span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token string" style="color:rgb(163, 21, 21)">"http://localhost:4000/v1"</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">response </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> client</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">responses</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">create</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)">"gpt-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">    tools</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)">"type"</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)">"code_interpreter"</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)">"container"</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)">"type"</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)">"auto"</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"></span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token builtin" style="color:rgb(0, 112, 193)">input</span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token string" style="color:rgb(163, 21, 21)">"Product of first 6 primes. Just the number."</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"></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">output_text</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><br></span></code></pre></div></div>
<p>To run fully on-prem, swap the <code>sandbox_tools</code> entry to OpenSandbox:</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">sandbox_tools</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">sandbox_tool_name</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> my</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">opensandbox</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">sandbox_provider</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> opensandbox</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/OPEN_SANDBOX_API_BASE</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/OPEN_SANDBOX_API_KEY</span><br></span></code></pre></div></div>
<p>OpenSandbox runs sandboxes locally with egress denied by default; flip <code>allow_internet_access=True</code> or pass an explicit <code>network_policy</code> when the code needs the network.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="why-route-it-through-your-own-sandbox">Why route it through your own sandbox<a href="https://docs.litellm.ai/blog/swap_openai_code_interpreter#why-route-it-through-your-own-sandbox" class="hash-link" aria-label="Direct link to Why route it through your own sandbox" title="Direct link to Why route it through your own sandbox">​</a></h2>
<p>You keep the OpenAI client contract while owning the execution layer. The generated code and any uploaded data stay inside the sandbox you operate, billing for execution stops going to OpenAI, and the same setup works for Responses and Chat Completions across any model the gateway routes to. Streaming, forced <code>tool_choice</code>, and concurrent requests are isolated per request and cleaned up on completion.</p>
<p>Full reference is in the <a href="https://docs.litellm.ai/docs/sandbox">sandbox docs</a>.</p>]]></content:encoded>
            <category>code interpreter</category>
            <category>sandbox</category>
            <category>e2b</category>
            <category>opensandbox</category>
            <category>agents</category>
        </item>
        <item>
            <title><![CDATA[Migrating LiteLLM to Rust - Building the Fastest and Litest AI Gateway]]></title>
            <link>https://docs.litellm.ai/blog/litellm-rust-launch</link>
            <guid>https://docs.litellm.ai/blog/litellm-rust-launch</guid>
            <pubDate>Mon, 22 Jun 2026 09:00:00 GMT</pubDate>
            <description><![CDATA[LiteLLM is moving its AI gateway to Rust: 15x throughput, 11x less memory, and sub-1ms per-request overhead. No v2, no migration, your config stays the same.]]></description>
            <content:encoded><![CDATA[<figure style="margin:0 0 2rem 0"><div style="background:#3a3a2e;border-radius:12px;overflow:hidden;aspect-ratio:1200 / 500;width:100%"><svg viewBox="0 0 1200 500" width="100%" height="100%" preserveAspectRatio="xMidYMid meet" style="display:block" role="img" aria-label="A wide bundle of thin lines on the left funnels down and collapses into one small glowing core on the right, a large Python gateway shrinking into a small, fast Rust binary."><defs><radialGradient id="rustGlow" cx="50%" cy="50%" r="50%"><stop offset="0%" stop-color="#f0a35e" stop-opacity="0.9"></stop><stop offset="50%" stop-color="#d97a3d" stop-opacity="0.35"></stop><stop offset="100%" stop-color="#d97a3d" stop-opacity="0"></stop></radialGradient></defs><ellipse cx="150" cy="250" rx="14" ry="215" fill="none" stroke="#faf9f5" stroke-width="0.8" stroke-opacity="0.1"></ellipse><ellipse cx="360" cy="250" rx="14" ry="150" fill="none" stroke="#faf9f5" stroke-width="0.8" stroke-opacity="0.085"></ellipse><ellipse cx="560" cy="250" rx="14" ry="95" fill="none" stroke="#faf9f5" stroke-width="0.8" stroke-opacity="0.07"></ellipse><ellipse cx="740" cy="250" rx="14" ry="52" fill="none" stroke="#faf9f5" stroke-width="0.8" stroke-opacity="0.06"></ellipse><path d="M 0 22 Q 540 181.60000000000002, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.16" stroke-linecap="round"></path><path d="M 0 34.666666666666664 Q 540 185.4, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.1789" stroke-linecap="round"></path><path d="M 0 47.33333333333333 Q 540 189.2, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.1978" stroke-linecap="round"></path><path d="M 0 60 Q 540 193, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.2167" stroke-linecap="round"></path><path d="M 0 72.66666666666666 Q 540 196.8, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.2356" stroke-linecap="round"></path><path d="M 0 85.33333333333334 Q 540 200.6, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.2544" stroke-linecap="round"></path><path d="M 0 98 Q 540 204.4, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.2733" stroke-linecap="round"></path><path d="M 0 110.66666666666667 Q 540 208.20000000000002, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.2922" stroke-linecap="round"></path><path d="M 0 123.33333333333333 Q 540 212, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.3111" stroke-linecap="round"></path><path d="M 0 136 Q 540 215.8, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.33" stroke-linecap="round"></path><path d="M 0 148.66666666666669 Q 540 219.60000000000002, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.3489" stroke-linecap="round"></path><path d="M 0 161.33333333333334 Q 540 223.4, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.3678" stroke-linecap="round"></path><path d="M 0 174 Q 540 227.2, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.3867" stroke-linecap="round"></path><path d="M 0 186.66666666666666 Q 540 231, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.4056" stroke-linecap="round"></path><path d="M 0 199.33333333333334 Q 540 234.8, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.4244" stroke-linecap="round"></path><path d="M 0 212 Q 540 238.6, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.4433" stroke-linecap="round"></path><path d="M 0 224.66666666666666 Q 540 242.4, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.4622" stroke-linecap="round"></path><path d="M 0 237.33333333333331 Q 540 246.2, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.4811" stroke-linecap="round"></path><path d="M 0 250 Q 540 250, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.5" stroke-linecap="round"></path><path d="M 0 262.6666666666667 Q 540 253.8, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.4811" stroke-linecap="round"></path><path d="M 0 275.33333333333337 Q 540 257.6, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.4622" stroke-linecap="round"></path><path d="M 0 288 Q 540 261.4, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.4433" stroke-linecap="round"></path><path d="M 0 300.6666666666667 Q 540 265.2, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.4244" stroke-linecap="round"></path><path d="M 0 313.3333333333333 Q 540 269, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.4056" stroke-linecap="round"></path><path d="M 0 326 Q 540 272.8, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.3867" stroke-linecap="round"></path><path d="M 0 338.66666666666663 Q 540 276.59999999999997, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.3678" stroke-linecap="round"></path><path d="M 0 351.3333333333333 Q 540 280.4, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.3489" stroke-linecap="round"></path><path d="M 0 364 Q 540 284.2, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.33" stroke-linecap="round"></path><path d="M 0 376.6666666666667 Q 540 288, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.3111" stroke-linecap="round"></path><path d="M 0 389.33333333333337 Q 540 291.8, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.2922" stroke-linecap="round"></path><path d="M 0 402 Q 540 295.6, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.2733" stroke-linecap="round"></path><path d="M 0 414.6666666666667 Q 540 299.4, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.2544" stroke-linecap="round"></path><path d="M 0 427.3333333333333 Q 540 303.2, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.2356" stroke-linecap="round"></path><path d="M 0 440 Q 540 307, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.2167" stroke-linecap="round"></path><path d="M 0 452.66666666666663 Q 540 310.79999999999995, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.1978" stroke-linecap="round"></path><path d="M 0 465.3333333333333 Q 540 314.6, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.1789" stroke-linecap="round"></path><path d="M 0 478 Q 540 318.4, 1000 250" fill="none" stroke="#faf9f5" stroke-width="0.9" stroke-opacity="0.16" stroke-linecap="round"></path><circle cx="1000" cy="250" r="34" fill="url(#rustGlow)"></circle><circle cx="1000" cy="250" r="5.5" fill="#f4b079" opacity="0.98"></circle></svg></div></figure>
<p><em>Last Updated: June 2026</em></p>
<p>Over the past year, we have heard the same thing from our users and our community: they want the fastest, most lightweight AI gateway they can run. We have heard you. We are addressing it by moving LiteLLM to Rust, and committing to sub-<code>1ms</code> overhead with a sub-<code>100MB</code> memory binary you can deploy. By the end of this migration, you will get a pure Rust server that can serve 100% of your AI traffic, with every hot path operation, including auth and rate limiting, running in Rust.</p>
<div class="theme-admonition theme-admonition-tip admonition_xJq3 alert alert--success"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>Want to help us build it?</div><div class="admonitionContent_BuS1"><p>We are opening an early beta and want to work directly with teams who care about a fast, lightweight gateway. If that is you, <a href="https://docs.google.com/forms/d/e/1FAIpQLSecWdOjkzjEson2UiZpDftOoZPs8RQbtlAM40KSvDXZqEgYaA/viewform?usp=dialog" target="_blank" rel="noopener noreferrer">sign up here</a> and we will get you testing the Rust gateway in your own stack, with a direct line to our team.</p></div></div>
<p>The reason it matters: under real load, CPU and memory climb with concurrency, and pods get OOM-killed at the worst time. Today the LiteLLM Python proxy peaks around <code>359MB</code> of memory under load, and that cost multiplies across every pod, region, and retry you run.</p>
<p>We are already seeing the payoff in benchmarks. The Rust gateway serves about <code>15x</code> the throughput (<code>453</code> to <code>6,782</code> requests per second) on about <code>11x</code> less memory (<code>359MB</code> to <code>32MB</code>), and cuts per-request overhead from about <code>7.5ms</code> on the Python path to about <code>0.05ms</code>, well under the <code>1ms</code> we commit to.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-you-get">What you get<a href="https://docs.litellm.ai/blog/litellm-rust-launch#what-you-get" class="hash-link" aria-label="Direct link to What you get" title="Direct link to What you get">​</a></h2>
<p>You deploy a single Rust binary. It uses about <code>65MB</code> of memory, gateway overhead stays under <code>1ms</code>, and nothing in your setup changes: same <code>config.yaml</code>, same database, same client API, same providers. You keep LiteLLM's coverage of 100+ LLM providers behind one OpenAI-compatible API, with <code>/chat/completions</code>, <code>/messages</code>, <code>/responses</code>, and every other LLM endpoint LiteLLM supports today, now as the fastest and most lightweight LLM gateway you can self-host.</p>
<p>This is not a v2 and not a rewrite. There is no new major version to migrate to and nothing for you to change. The runtime under the hot path gets faster and lighter while your config stays exactly where it is.</p>
<p>We ship this the careful way. Each route moves to Rust only after it passes our full parity and end-to-end test suite, and it runs in production before the next route starts. Stability is the priority, and we target zero regressions on every release.</p>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-fast-is-the-litellm-gateway-a-throughput-overhead-and-memory-benchmark">How fast is the LiteLLM gateway? A throughput, overhead, and memory benchmark<a href="https://docs.litellm.ai/blog/litellm-rust-launch#how-fast-is-the-litellm-gateway-a-throughput-overhead-and-memory-benchmark" class="hash-link" aria-label="Direct link to How fast is the LiteLLM gateway? A throughput, overhead, and memory benchmark" title="Direct link to How fast is the LiteLLM gateway? A throughput, overhead, and memory benchmark">​</a></h2>
<p><strong>Per-request overhead.</strong> We built a small harness: a mock upstream, a thin Rust forwarding gateway (axum), the same forwarding path running through LiteLLM today (<code>litellm.acompletion</code> over uvicorn), and a load client that times each request in microseconds. At <code>10</code> concurrent clients against the same mock, the Rust gateway adds about <code>0.05ms</code> of overhead per request; the LiteLLM Python path adds about <code>7.5ms</code>. That is roughly <code>150x</code> lower, and well under the <code>1ms</code> we commit to.</p>
<p><strong>Sustained load.</strong> Against the current LiteLLM Python proxy on the same <code>/v1/responses</code> workload at <code>50</code> concurrent clients, the Rust path served about <code>15x</code> the throughput on about <code>11x</code> less memory.</p>
<p><img decoding="async" loading="lazy" alt="Rust vs Python gateway benchmark: overhead, throughput, and memory" src="https://docs.litellm.ai/assets/images/rust_vs_python_proxy_benchmark-438fbd58fcd0bc120123da793339c06a.png" width="2222" height="821" class="img_ev3q"></p>
<table><thead><tr><th></th><th>Per-request overhead</th><th>Throughput under load</th><th>Peak memory under load</th></tr></thead><tbody><tr><td><strong>Rust gateway</strong></td><td><code>~0.05ms</code></td><td><code>6,782</code> req/s</td><td><code>31.7MB</code></td></tr><tr><td><strong>LiteLLM (Python)</strong></td><td><code>~7.5ms</code></td><td><code>453</code> req/s</td><td><code>358.9MB</code></td></tr></tbody></table>
<p>The overhead harness (mock, gateway, load client) is checked in next to this post under <a href="https://github.com/BerriAI/litellm-docs/tree/main/blog/litellm_rust_launch/benchmark" target="_blank" rel="noopener noreferrer"><code>benchmark/</code></a>, and the summarized numbers are in <a href="https://docs.litellm.ai/assets/files/rust_proxy_benchmark_results-bb0d4a70407b0618217e30d15e4e186b.csv" target="_blank"><code>rust_proxy_benchmark_results.csv</code></a>, so you can reproduce the sub-<code>1ms</code> result. This measures the gateway forwarding path (request transform, forwarding, response handling), not a full production workload.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-stays-the-same">What stays the same<a href="https://docs.litellm.ai/blog/litellm-rust-launch#what-stays-the-same" class="hash-link" aria-label="Direct link to What stays the same" title="Direct link to What stays the same">​</a></h2>
<p>Nothing you depend on changes. The migration is invisible from the outside:</p>
<ul>
<li>Your Python SDK keeps the exact same interface; the same calls now run on Rust bindings underneath.</li>
<li>Your <code>config.yaml</code> is unchanged.</li>
<li>Your database and schema are unchanged.</li>
<li>Your client API and request/response shapes are unchanged.</li>
<li>Your providers, routing, and keys are unchanged.</li>
</ul>
<p>You get lower memory and lower overhead, and you do nothing to get it.</p>
<hr>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-the-migration-works">How the migration works<a href="https://docs.litellm.ai/blog/litellm-rust-launch#how-the-migration-works" class="hash-link" aria-label="Direct link to How the migration works" title="Direct link to How the migration works">​</a></h2>
<p>If you just want the outcome, you have it above. The rest of this post is for engineers who want to see how we move the gateway to Rust without breaking anything.</p>
<p>The core idea is a clean split. We build one Rust core that only transforms data: it turns your request into a provider request, turns the provider response back, transforms stream chunks, counts tokens, and normalizes errors. It never opens a socket, reads a secret, or writes to your database. The host process does all of that. That separation is what lets us put Rust into production without rewriting the server, because Python keeps doing the I/O while Rust takes over the translation.</p>
<figure style="margin:2.5rem 0;font-family:inherit"><div style="border-radius:12px;border:1px solid #e5e7eb;background:#fff;padding:2rem 2.5rem;overflow-x:auto"><div style="min-width:760px"><div style="display:grid;grid-template-columns:1fr 22px 1fr 22px 1fr 22px 1fr;align-items:center"><div style="border:1.5px solid #2563eb;background:#eff6ff;border-radius:8px;padding:16px 14px;text-align:center;min-height:116px"><div style="font-size:12px;color:#2563eb;font-weight:800;margin-bottom:8px">Stage 0 · Today</div><div style="font-size:13px;color:#111827;font-weight:600;line-height:1.35">Pure Python SDK + FastAPI proxy</div><div style="font-size:11px;color:#6b7280;margin-top:10px;font-weight:600">100% Python</div></div><svg width="22" height="16" viewBox="0 0 22 16" aria-hidden="true"><path d="M1 8h14" stroke="#9ca3af" stroke-width="2"></path><path d="M13 2l8 6-8 6z" fill="#9ca3af"></path></svg><div style="border:1.5px solid #16a34a;background:#f0fdf4;border-radius:8px;padding:16px 14px;text-align:center;min-height:116px"><div style="font-size:12px;color:#16a34a;font-weight:800;margin-bottom:8px">Stage 1 · Core in Rust</div><div style="font-size:13px;color:#111827;font-weight:600;line-height:1.35">Python drives Rust transforms via PyO3</div><div style="font-size:11px;color:#6b7280;margin-top:10px;font-weight:600">V0 to V3</div></div><svg width="22" height="16" viewBox="0 0 22 16" aria-hidden="true"><path d="M1 8h14" stroke="#9ca3af" stroke-width="2"></path><path d="M13 2l8 6-8 6z" fill="#9ca3af"></path></svg><div style="border:1.5px solid #d97706;background:#fffbeb;border-radius:8px;padding:16px 14px;text-align:center;min-height:116px"><div style="font-size:12px;color:#d97706;font-weight:800;margin-bottom:8px">Stage 2 · Thin shell</div><div style="font-size:13px;color:#111827;font-weight:600;line-height:1.35">FastAPI shell, hot path all Rust</div><div style="font-size:11px;color:#6b7280;margin-top:10px;font-weight:600">V4 to V5a</div></div><svg width="22" height="16" viewBox="0 0 22 16" aria-hidden="true"><path d="M1 8h14" stroke="#9ca3af" stroke-width="2"></path><path d="M13 2l8 6-8 6z" fill="#9ca3af"></path></svg><div style="border:1.5px solid #7c3aed;background:#faf5ff;border-radius:8px;padding:16px 14px;text-align:center;min-height:116px"><div style="font-size:12px;color:#7c3aed;font-weight:800;margin-bottom:8px">Stage 3 · Pure Rust</div><div style="font-size:13px;color:#111827;font-weight:600;line-height:1.35">axum server, Python in sidecar</div><div style="font-size:11px;color:#6b7280;margin-top:10px;font-weight:600">V5b</div></div></div><div style="height:1px;background:#e5e7eb;margin:20px 0 12px"></div><div style="display:grid;grid-template-columns:1fr 22px 1fr 22px 1fr 22px 1fr;align-items:center"><div style="grid-column:1 / -1;font-size:11px;color:#6b7280;font-weight:600;margin-bottom:8px">Rust share of hot path</div><div style="text-align:center;font-size:12px;color:#2563eb;font-weight:700">0%</div><div></div><div style="text-align:center;font-size:12px;color:#16a34a;font-weight:700">transforms + router</div><div></div><div style="text-align:center;font-size:12px;color:#d97706;font-weight:700">~entire forwarding path</div><div></div><div style="text-align:center;font-size:12px;color:#7c3aed;font-weight:700">100%</div></div></div></div><figcaption style="text-align:center;font-size:12px;color:#9ca3af;margin-top:12px">Four stages, each shipped to production before the next begins.</figcaption></figure>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="one-route-at-a-time-proven-in-production">One route at a time, proven in production<a href="https://docs.litellm.ai/blog/litellm-rust-launch#one-route-at-a-time-proven-in-production" class="hash-link" aria-label="Direct link to One route at a time, proven in production" title="Direct link to One route at a time, proven in production">​</a></h3>
<p>We never flip a whole endpoint at once. For each route we prove one provider first, roll it out to every provider on that route, and only then start the next route. The smallest, lowest-risk route goes first.</p>
<figure style="margin:2.5rem 0;font-family:inherit"><div style="border-radius:12px;border:1px solid #e5e7eb;background:#fff;padding:2rem 2.5rem;overflow-x:auto"><p style="font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.12em;color:#9ca3af;text-align:center;margin-bottom:1.5rem">The repeating cadence inside Stage 1</p><div style="min-width:680px;display:grid;grid-template-columns:150px 1fr 26px 1fr 26px 1fr;align-items:center;row-gap:12px"><div></div><div style="font-size:11px;color:#6b7280;font-weight:700;text-align:center">1. Prove one provider</div><div></div><div style="font-size:11px;color:#6b7280;font-weight:700;text-align:center">2. Roll out all providers</div><div></div><div style="font-size:11px;color:#6b7280;font-weight:700;text-align:center">3. Fold route into the Rust core</div><div style="font-size:13px;font-weight:800;color:#16a34a">OCR</div><div style="border:1.5px solid #16a34a;background:#f0fdf4;border-radius:8px;padding:10px 12px;text-align:center"><div style="font-size:12px;color:#111827;font-weight:700">Mistral OCR</div><div style="font-size:10px;color:#9ca3af;margin-top:3px">lowest-risk route, start here</div></div><div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg width="24" height="14" viewBox="0 0 24 14" aria-hidden="true"><path d="M0 7h16" stroke="#16a34a" stroke-width="1.5"></path><path d="M15 1l8 6-8 6z" fill="#16a34a"></path></svg></div><div style="border:1.5px solid #16a34a;background:#f0fdf4;border-radius:8px;padding:10px 12px;text-align:center"><div style="font-size:12px;color:#111827;font-weight:700">all OCR</div></div><div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg width="24" height="14" viewBox="0 0 24 14" aria-hidden="true"><path d="M0 7h16" stroke="#16a34a" stroke-width="1.5"></path><path d="M15 1l8 6-8 6z" fill="#16a34a"></path></svg></div><div style="border:1.5px solid #16a34a;background:#f0fdf4;border-radius:8px;padding:10px 12px;text-align:center"><div style="font-size:12px;color:#111827;font-weight:700">OCR in Rust</div></div><div style="font-size:13px;font-weight:800;color:#2563eb">/v1/messages</div><div style="border:1.5px solid #2563eb;background:#eff6ff;border-radius:8px;padding:10px 12px;text-align:center"><div style="font-size:12px;color:#111827;font-weight:700">one provider</div><div style="font-size:10px;color:#9ca3af;margin-top:3px">adds the streaming axis</div></div><div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg width="24" height="14" viewBox="0 0 24 14" aria-hidden="true"><path d="M0 7h16" stroke="#2563eb" stroke-width="1.5"></path><path d="M15 1l8 6-8 6z" fill="#2563eb"></path></svg></div><div style="border:1.5px solid #2563eb;background:#eff6ff;border-radius:8px;padding:10px 12px;text-align:center"><div style="font-size:12px;color:#111827;font-weight:700">all /v1/messages</div></div><div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg width="24" height="14" viewBox="0 0 24 14" aria-hidden="true"><path d="M0 7h16" stroke="#2563eb" stroke-width="1.5"></path><path d="M15 1l8 6-8 6z" fill="#2563eb"></path></svg></div><div style="border:1.5px solid #2563eb;background:#eff6ff;border-radius:8px;padding:10px 12px;text-align:center"><div style="font-size:12px;color:#111827;font-weight:700">/v1/messages in Rust</div></div><div style="font-size:13px;font-weight:800;color:#7c3aed">/chat/completions</div><div style="border:1.5px solid #7c3aed;background:#faf5ff;border-radius:8px;padding:10px 12px;text-align:center"><div style="font-size:12px;color:#111827;font-weight:700">one provider</div><div style="font-size:10px;color:#9ca3af;margin-top:3px">largest param surface</div></div><div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg width="24" height="14" viewBox="0 0 24 14" aria-hidden="true"><path d="M0 7h16" stroke="#7c3aed" stroke-width="1.5"></path><path d="M15 1l8 6-8 6z" fill="#7c3aed"></path></svg></div><div style="border:1.5px solid #7c3aed;background:#faf5ff;border-radius:8px;padding:10px 12px;text-align:center"><div style="font-size:12px;color:#111827;font-weight:700">all /chat/completions</div></div><div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg width="24" height="14" viewBox="0 0 24 14" aria-hidden="true"><path d="M0 7h16" stroke="#7c3aed" stroke-width="1.5"></path><path d="M15 1l8 6-8 6z" fill="#7c3aed"></path></svg></div><div style="border:1.5px solid #7c3aed;background:#faf5ff;border-radius:8px;padding:10px 12px;text-align:center"><div style="font-size:12px;color:#111827;font-weight:700">/chat/completions in Rust</div></div></div></div><figcaption style="text-align:center;font-size:12px;color:#9ca3af;margin-top:12px">Same three beats per route: one provider, then all providers, then the route lives in the Rust core. OCR goes first.</figcaption></figure>
<p>In Stage 1 the server does not change shape. Python still serves traffic and does the I/O, but hands translation to the Rust core through a flag-gated binding, per provider. A parity check enforces identical output before any provider turns on, and if the flag is off the existing Python path runs unchanged.</p>
<figure style="margin:2.5rem 0;font-family:inherit"><div style="border-radius:12px;border:1px solid #e5e7eb;background:#fff;padding:2rem 2.5rem;overflow-x:auto"><p style="font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.12em;color:#9ca3af;text-align:center;margin-bottom:1.5rem">Stage 1 · Rust core, driven by the Python SDK</p><div style="min-width:720px;max-width:760px;margin:0 auto;display:flex;flex-direction:column;align-items:center"><div style="border:1.5px solid #9ca3af;border-radius:8px;padding:12px 18px;background:#f3f4f6;color:#111827;text-align:center;width:140px;box-sizing:border-box">client</div><svg width="2" height="26" style="display:block" aria-hidden="true"><line x1="1" y1="0" x2="1" y2="20" stroke="#9ca3af" stroke-width="1.5"></line><polygon points="1,26 -2,19 4,19" fill="#9ca3af"></polygon></svg><div style="border:1.5px solid #2563eb;border-radius:8px;padding:12px 18px;background:#eff6ff;color:#1e3a8a;text-align:center;width:100%;box-sizing:border-box"><div style="font-weight:700;font-size:13px">FastAPI proxy (Python)</div><div style="font-size:11px;color:#3b5b7a;margin-top:4px">auth · rate limit · callbacks · DB · spend</div><div style="font-size:10px;color:#9ca3af;margin-top:4px">unchanged in Stage 1</div></div><svg width="2" height="26" style="display:block" aria-hidden="true"><line x1="1" y1="0" x2="1" y2="20" stroke="#9ca3af" stroke-width="1.5"></line><polygon points="1,26 -2,19 4,19" fill="#9ca3af"></polygon></svg><div style="display:grid;grid-template-columns:1.1fr 60px 1fr;align-items:center;width:100%"><div style="border:1.5px solid #2563eb;border-radius:8px;padding:12px 18px;background:#eff6ff;color:#1e3a8a;text-align:center;width:100%;box-sizing:border-box"><div style="font-weight:700;font-size:13px">litellm Python SDK</div><div style="font-size:11px;color:#3b5b7a;margin-top:4px">does the I/O: HTTP · auth · retries · streaming loop</div></div><div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><span style="font-size:10px;color:#16a34a;font-weight:600;margin-bottom:3px">flag on</span><svg width="56" height="14" viewBox="0 0 56 14" aria-hidden="true"><path d="M0 7h48" stroke="#16a34a" stroke-width="1.5"></path><path d="M47 1l8 6-8 6z" fill="#16a34a"></path></svg></div><div style="border:1.5px solid #d97706;border-radius:8px;padding:12px 18px;background:#fffbeb;color:#92400e;text-align:center;width:100%;box-sizing:border-box"><div style="font-weight:700;font-size:13px">PyO3 bridge</div><div style="font-size:10px;color:#b45309;margin-top:4px">flag-gated</div></div></div><div style="display:grid;grid-template-columns:1.1fr 60px 1fr;align-items:stretch;width:100%;margin-top:10px"><div style="border:1.5px dashed #cbd5e1;border-radius:8px;padding:12px 18px;text-align:center;background:#fafafa"><div style="font-weight:600;font-size:12px;color:#6b7280">Python transforms (today's code)</div><div style="font-size:10px;color:#9ca3af;margin-top:4px">flag off or unsupported provider</div></div><div style="display:flex;align-items:center;justify-content:center;font-size:18px;color:#16a34a">↓</div><div style="border:1.5px solid #16a34a;border-radius:8px;padding:12px 18px;background:#f0fdf4;color:#166534;text-align:center;width:100%;box-sizing:border-box"><div style="font-weight:700;font-size:13px">litellm-core (Rust, pure)</div><div style="font-size:11px;color:#15803d;margin-top:4px">transform_request / transform_response</div><div style="font-size:11px;color:#15803d">stream chunk transform · token cost</div><div style="font-size:10px;color:#9ca3af;margin-top:4px">“describe, don't execute” · no I/O</div></div></div><svg width="2" height="30" style="display:block" aria-hidden="true"><line x1="1" y1="0" x2="1" y2="24" stroke="#6b7280" stroke-width="1.5"></line><polygon points="1,30 -2,23 4,23" fill="#6b7280"></polygon></svg><div style="border:1.5px solid #9ca3af;border-radius:8px;padding:12px 18px;background:#f3f4f6;color:#111827;text-align:center;width:220px;box-sizing:border-box"><div style="font-weight:600;font-size:13px">upstream LLM</div><div style="font-size:10px;color:#9ca3af;margin-top:2px">provider API · HTTP (Python flips)</div></div></div></div><figcaption style="text-align:center;font-size:12px;color:#9ca3af;margin-top:12px">The Rust core returns a prepared request; the Python SDK still performs every byte of I/O.</figcaption></figure>
<p>The routes move in order of risk:</p>
<ul>
<li><strong>OCR first.</strong> Start with Mistral OCR, the smallest surface: no streaming, tiny schema, few params. Once it matches the Python output byte for byte in production, roll out to all OCR providers, then move the route into the Rust core. Integration risk is retired here before any larger endpoint moves.</li>
<li><strong><code>/v1/messages</code> next.</strong> This adds streaming: SSE parsing, chunk emission, usage accounting, token cost. One provider first, then all, then the route into Rust.</li>
<li><strong><code>/chat/completions</code> after that.</strong> The largest surface, taken on only once streaming is proven: tools, function calling, multimodal, and the full optional-param matrix.</li>
<li><strong>Major providers.</strong> Azure, then Bedrock, then Vertex, by traffic volume. Auth-coupled providers get signed headers from the host (boto3 / google-auth first, native Rust later). Long-tail providers keep running on Python.</li>
</ul>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="onto-a-rust-server">Onto a Rust server<a href="https://docs.litellm.ai/blog/litellm-rust-launch#onto-a-rust-server" class="hash-link" aria-label="Direct link to Onto a Rust server" title="Direct link to Onto a Rust server">​</a></h3>
<p>Once the routes run on Rust, the router moves too: routing, fallbacks, retries, and cooldowns, with state in Redis. Then the server itself moves in two steps.</p>
<figure style="margin:2.5rem 0;font-family:inherit"><div style="border-radius:12px;border:1px solid #e5e7eb;background:#fff;padding:2rem 2.5rem;overflow-x:auto"><p style="font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.12em;color:#9ca3af;text-align:center;margin-bottom:1.5rem">Stage 2 → Stage 3 · onto a server</p><div style="display:grid;grid-template-columns:1fr 1fr;gap:28px;align-items:start;min-width:640px"><div><div style="font-size:12px;color:#d97706;font-weight:800;margin-bottom:14px">Stage 2 · FastAPI as a thin shell (V5a)</div><div style="display:flex;flex-direction:column;align-items:center;gap:8px"><div style="border:1.5px solid #9ca3af;border-radius:8px;padding:12px 18px;background:#f3f4f6;color:#111827;text-align:center;width:100%;box-sizing:border-box"><div style="font-size:13px;font-weight:700">client</div></div><svg width="2" height="26" style="display:block" aria-hidden="true"><line x1="1" y1="0" x2="1" y2="20" stroke="#9ca3af" stroke-width="1.5"></line><polygon points="1,26 -2,19 4,19" fill="#9ca3af"></polygon></svg><div style="border:1.5px solid #d97706;border-radius:8px;padding:12px 18px;background:#fffbeb;color:#92400e;text-align:center;width:100%;box-sizing:border-box"><div style="font-size:13px;font-weight:700">FastAPI shell (Python)</div><div style="font-size:11px;color:#6b7280;margin-top:4px">auth · rate limit · callbacks only</div><div style="font-size:11px;color:#374151;margin-top:2px">terminates HTTP</div><div style="font-size:11px;color:#374151;margin-top:2px">no forwarding logic</div></div><svg width="2" height="26" style="display:block" aria-hidden="true"><line x1="1" y1="0" x2="1" y2="20" stroke="#9ca3af" stroke-width="1.5"></line><polygon points="1,26 -2,19 4,19" fill="#9ca3af"></polygon></svg><div style="border:1.5px solid #16a34a;border-radius:8px;padding:12px 18px;background:#f0fdf4;color:#166534;text-align:center;width:100%;box-sizing:border-box"><div style="font-size:13px;font-weight:700">Rust engine (one PyO3 call)</div><div style="font-size:11px;color:#6b7280;margin-top:4px">router + core + HTTP + stream + cost</div><div style="font-size:11px;color:#374151;margin-top:2px">entire forwarding hot path</div></div><svg width="2" height="26" style="display:block" aria-hidden="true"><line x1="1" y1="0" x2="1" y2="20" stroke="#9ca3af" stroke-width="1.5"></line><polygon points="1,26 -2,19 4,19" fill="#9ca3af"></polygon></svg><div style="border:1.5px solid #9ca3af;border-radius:8px;padding:12px 18px;background:#f3f4f6;color:#111827;text-align:center;width:100%;box-sizing:border-box"><div style="font-size:13px;font-weight:700">upstream LLM</div><div style="font-size:11px;color:#6b7280;margin-top:4px">provider API</div></div></div></div><div><div style="font-size:12px;color:#7c3aed;font-weight:800;margin-bottom:14px">Stage 3 · Pure Rust server (V5b)</div><div style="display:flex;flex-direction:column;align-items:center;gap:8px"><div style="border:1.5px solid #9ca3af;border-radius:8px;padding:12px 18px;background:#f3f4f6;color:#111827;text-align:center;width:100%;box-sizing:border-box"><div style="font-size:13px;font-weight:700">client</div></div><svg width="2" height="26" style="display:block" aria-hidden="true"><line x1="1" y1="0" x2="1" y2="20" stroke="#9ca3af" stroke-width="1.5"></line><polygon points="1,26 -2,19 4,19" fill="#9ca3af"></polygon></svg><div style="display:grid;grid-template-columns:1fr 110px;gap:10px;align-items:center;width:100%"><div style="border:1.5px solid #7c3aed;border-radius:8px;padding:12px 18px;background:#faf5ff;color:#5b21b6;text-align:center;width:100%;box-sizing:border-box"><div style="font-size:13px;font-weight:700">Rust server (axum / hyper)</div><div style="font-size:11px;color:#6b7280;margin-top:4px">auth · rate limit · router</div><div style="font-size:11px;color:#374151;margin-top:2px">core · streaming · cost · spend</div><div style="font-size:11px;color:#374151;margin-top:2px">no PyO3 on hot path</div></div><div style="border:1.5px dashed #c4b5fd;border-radius:8px;padding:10px 8px;font-size:10px;color:#7c3aed;text-align:center;background:#faf5ff"><div style="font-weight:700">PyO3 sidecar</div><div style="color:#9ca3af;margin-top:2px">customer Python plugins · guardrails</div></div></div><div style="display:grid;grid-template-columns:1fr 1fr;gap:10px;width:calc(100% - 120px);align-self:flex-start"><div style="border:1.5px solid #9ca3af;border-radius:8px;padding:12px 18px;background:#f3f4f6;color:#111827;text-align:center;width:100%;box-sizing:border-box"><div style="font-size:13px;font-weight:700">Redis</div><div style="font-size:11px;color:#6b7280;margin-top:4px">routing state</div></div><div style="border:1.5px solid #9ca3af;border-radius:8px;padding:12px 18px;background:#f3f4f6;color:#111827;text-align:center;width:100%;box-sizing:border-box"><div style="font-size:13px;font-weight:700">Postgres</div><div style="font-size:11px;color:#6b7280;margin-top:4px">spend + config</div></div></div><svg width="2" height="26" style="display:block" aria-hidden="true"><line x1="1" y1="0" x2="1" y2="20" stroke="#9ca3af" stroke-width="1.5"></line><polygon points="1,26 -2,19 4,19" fill="#9ca3af"></polygon></svg><div style="border:1.5px solid #9ca3af;border-radius:8px;padding:12px 18px;background:#f3f4f6;color:#111827;text-align:center;width:100%;box-sizing:border-box"><div style="font-size:13px;font-weight:700">upstream LLM</div><div style="font-size:11px;color:#6b7280;margin-top:4px">provider API</div></div></div></div></div></div><figcaption style="text-align:center;font-size:12px;color:#9ca3af;margin-top:12px">V5a removes Python from forwarding while keeping the shell; V5b removes PyO3 from the hot path.</figcaption></figure>
<ul>
<li><strong>FastAPI as a thin shell.</strong> FastAPI still terminates HTTP and runs auth, rate-limit, and callbacks, but the entire forwarding path is a single call into Rust.</li>
<li><strong>Pure Rust server.</strong> A native server (axum / hyper) runs the forwarding path with no Python on the hot path. Your custom Python plugins (auth, guardrails, callbacks, SSO) keep working in an optional sidecar, so nothing breaks. We roll it out with shadow traffic and a percentage cutover.</li>
</ul>
<p>The end state is a pure Rust data plane. Customer Python plugins keep running in the sidecar, so it is non-breaking. Removing Python entirely would require porting plugins to a Rust or WASM interface, which is a breaking change we are deferring.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="why-this-order">Why this order<a href="https://docs.litellm.ai/blog/litellm-rust-launch#why-this-order" class="hash-link" aria-label="Direct link to Why this order" title="Direct link to Why this order">​</a></h3>
<ul>
<li>The OCR route retires integration risk on the smallest surface.</li>
<li><code>/v1/messages</code> retires streaming risk before the largest parameter set.</li>
<li><code>/chat/completions</code> is taken on only after streaming is proven.</li>
<li>By the time the server moves, the core, providers, and router are already running in production through the SDK, so the server work is mostly plumbing.</li>
</ul>
<p>Every step ships to real users before the next begins, with the parity check as the gate.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="timeline">Timeline<a href="https://docs.litellm.ai/blog/litellm-rust-launch#timeline" class="hash-link" aria-label="Direct link to Timeline" title="Direct link to Timeline">​</a></h2>
<p>We move one function at a time, smallest first, and only after each step passes our test suite.</p>
<table><thead><tr><th>Target</th><th>What moves to Rust</th></tr></thead><tbody><tr><td>Aug 15, 2026</td><td><code>litellm.ocr()</code> for Mistral, then all of <code>litellm.ocr()</code>, then the <code>/ocr</code> route</td></tr><tr><td>Sep 1, 2026</td><td>Same pattern for <code>/messages</code>, then <code>/chat/completions</code></td></tr><tr><td>Sep 15, 2026</td><td>The router: load balancing, fallbacks, retries, cooldowns</td></tr><tr><td>Dec 1, 2026</td><td>The full server: FastAPI thin shell, then pure Rust (axum)</td></tr></tbody></table>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="frequently-asked-questions">Frequently asked questions<a href="https://docs.litellm.ai/blog/litellm-rust-launch#frequently-asked-questions" class="hash-link" aria-label="Direct link to Frequently asked questions" title="Direct link to Frequently asked questions">​</a></h2>
<!-- -->
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="is-litellm-the-fastest-llm-gateway">Is LiteLLM the fastest LLM gateway?<a href="https://docs.litellm.ai/blog/litellm-rust-launch#is-litellm-the-fastest-llm-gateway" class="hash-link" aria-label="Direct link to Is LiteLLM the fastest LLM gateway?" title="Direct link to Is LiteLLM the fastest LLM gateway?">​</a></h3>
<p>That is the goal of this work. With the Rust hot path, LiteLLM targets sub-<code>1ms</code> gateway overhead and a sub-<code>100MB</code> binary, matching compiled-language gateways while keeping coverage of 100+ providers behind one OpenAI-compatible API. In our benchmark the Rust gateway adds about <code>0.05ms</code> of overhead per request, versus about <code>7.5ms</code> for the LiteLLM Python path today, and serves <code>6,782</code> requests per second under load at <code>31.7MB</code> peak memory. Gateway overhead is usually a small fraction of total model latency, so it matters most for high-throughput, low-latency workloads like classification and embeddings at scale.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="is-litellm-slow">Is LiteLLM slow?<a href="https://docs.litellm.ai/blog/litellm-rust-launch#is-litellm-slow" class="hash-link" aria-label="Direct link to Is LiteLLM slow?" title="Direct link to Is LiteLLM slow?">​</a></h3>
<p>Gateway latency and throughput depend on how you deploy the proxy: worker count, concurrency settings, and whether logging callbacks run on the hot path. Tuned, the Python proxy serves production traffic across hundreds of providers today. Moving the hot path to Rust pushes the floor lower still: in our reproducible benchmark the Rust gateway adds about <code>0.05ms</code> of overhead per request, versus about <code>7.5ms</code> for the LiteLLM Python path, and serves <code>6,782</code> requests per second at <code>31.7MB</code> peak memory.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="is-litellm-limited-by-the-python-gil">Is LiteLLM limited by the Python GIL?<a href="https://docs.litellm.ai/blog/litellm-rust-launch#is-litellm-limited-by-the-python-gil" class="hash-link" aria-label="Direct link to Is LiteLLM limited by the Python GIL?" title="Direct link to Is LiteLLM limited by the Python GIL?">​</a></h3>
<p>The GIL only matters for CPU-bound work on the request path, and the gateway is mostly I/O. LiteLLM scales today by running multiple workers. The Rust migration removes the question for the hot path: request transforms, streaming, and routing run in the Rust core and router, outside the GIL, with no first-party Python on the forwarding path in the end state.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="how-much-memory-does-the-litellm-gateway-use">How much memory does the LiteLLM gateway use?<a href="https://docs.litellm.ai/blog/litellm-rust-launch#how-much-memory-does-the-litellm-gateway-use" class="hash-link" aria-label="Direct link to How much memory does the LiteLLM gateway use?" title="Direct link to How much memory does the LiteLLM gateway use?">​</a></h3>
<p>The Python proxy peaked at <code>358.9MB</code> under our load test. The Rust end state targets roughly <code>65MB</code>. Lower, bounded memory is the main reason for this work: it reduces the high-CPU and OOM failures that show up under concurrent load.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="are-these-benchmarks-reproducible">Are these benchmarks reproducible?<a href="https://docs.litellm.ai/blog/litellm-rust-launch#are-these-benchmarks-reproducible" class="hash-link" aria-label="Direct link to Are these benchmarks reproducible?" title="Direct link to Are these benchmarks reproducible?">​</a></h3>
<p>Yes. The overhead harness (a mock upstream, a thin Rust gateway, and a load client that times each request in microseconds) is checked in under <a href="https://github.com/BerriAI/litellm-docs/tree/main/blog/litellm_rust_launch/benchmark" target="_blank" rel="noopener noreferrer"><code>benchmark/</code></a>, alongside the summarized CSV. Same upstream and payload for both runtimes; the only variable is Python versus Rust.</p>
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="will-the-rust-gateway-be-a-breaking-change">Will the Rust gateway be a breaking change?<a href="https://docs.litellm.ai/blog/litellm-rust-launch#will-the-rust-gateway-be-a-breaking-change" class="hash-link" aria-label="Direct link to Will the Rust gateway be a breaking change?" title="Direct link to Will the Rust gateway be a breaking change?">​</a></h3>
<p>No. Config, database schema, and the client API contract stay the same. The runtime under the hot path changes gradually, route by route, behind passing parity and end-to-end tests.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="we-are-hiring-rust-engineers">We are hiring Rust engineers<a href="https://docs.litellm.ai/blog/litellm-rust-launch#we-are-hiring-rust-engineers" class="hash-link" aria-label="Direct link to We are hiring Rust engineers" title="Direct link to We are hiring Rust engineers">​</a></h2>
<p>We are building this with a small team and looking for Rust engineers who want to work on the hot path of an AI gateway that serves 100+ providers. If that sounds like you, <a href="https://jobs.ashbyhq.com/litellm/3f326076-7415-46a1-921e-8a1b1d6ee2b6" target="_blank" rel="noopener noreferrer">come build it with us</a>.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="references">References<a href="https://docs.litellm.ai/blog/litellm-rust-launch#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References">​</a></h2>
<ul>
<li><a href="https://www.datadoghq.com/blog/engineering/how-we-migrated-our-static-analyzer-from-java-to-rust/" target="_blank" rel="noopener noreferrer">How Datadog migrated their static analyzer from Java to Rust</a></li>
<li><a href="https://blog.gitguardian.com/how-we-migrated-the-heart-of-our-platform-to-rust/" target="_blank" rel="noopener noreferrer">How GitGuardian migrated the heart of their platform to Rust</a></li>
<li><a href="https://docs.litellm.ai/docs/simple_proxy" target="_blank" rel="noopener noreferrer">LiteLLM AI Gateway, full feature overview</a></li>
<li><a href="https://docs.litellm.ai/docs/routing" target="_blank" rel="noopener noreferrer">Load balancing and routing across 100+ LLM providers</a></li>
</ul>]]></content:encoded>
            <category>rust</category>
            <category>ai-gateway</category>
            <category>performance</category>
            <category>benchmarks</category>
            <category>reliability</category>
            <category>engineering</category>
        </item>
        <item>
            <title><![CDATA[LiteLLM version support: focusing on the four most recent stable lines]]></title>
            <link>https://docs.litellm.ai/blog/version-support</link>
            <guid>https://docs.litellm.ai/blog/version-support</guid>
            <pubDate>Sat, 20 Jun 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Starting Monday, June 29, 2026, LiteLLM actively supports the four most recent stable minor lines. Older lines reach end of life, and the window rolls forward as new stable lines ship.]]></description>
            <content:encoded><![CDATA[<p><em>Starting Monday, June 29, 2026, LiteLLM will only actively support the four most recent stable minor lines. Here's what's changing and what it means for you.</em></p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="why-were-doing-this">Why we're doing this<a href="https://docs.litellm.ai/blog/version-support#why-were-doing-this" class="hash-link" aria-label="Direct link to Why we're doing this" title="Direct link to Why we're doing this">​</a></h2>
<p>Maintaining older lines means carrying every fix back to keep them all in parity. That overhead grows with the number of lines we keep alive, not the number of fixes we make. Our focus is ensuring the most up-to-date product offerings are stable and working for you. Because of this, LiteLLM is focusing on the four most recent stable minor lines going forward.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-the-rolling-window-works">How the rolling window works<a href="https://docs.litellm.ai/blog/version-support#how-the-rolling-window-works" class="hash-link" aria-label="Direct link to How the rolling window works" title="Direct link to How the rolling window works">​</a></h2>
<p>This shift in focus takes effect Monday, June 29, 2026.</p>
<p>A minor line is a release series written as 1.89.x, covering every patch in it: 1.89.0, 1.89.1, 1.89.2, and any later ones. We support the four most recent lines and every patch inside each of them.</p>
<p>Today the four supported lines are <strong>1.89.x, 1.88.x, 1.87.x, and 1.86.x</strong>. Everything <strong>1.85.x and earlier</strong> has reached end of life and will no longer actively receive updates. The window rolls forward: when 1.90.x ships, 1.86.x rolls out and the supported set becomes 1.90.x, 1.89.x, 1.88.x, and 1.87.x. With a new line about every week, that works out to roughly a month of coverage per line.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-this-means-for-you">What this means for you<a href="https://docs.litellm.ai/blog/version-support#what-this-means-for-you" class="hash-link" aria-label="Direct link to What this means for you" title="Direct link to What this means for you">​</a></h2>
<p>To stay supported, pin to a line and take its patches, then move up before it ages out. Patching within a line is a drop-in; moving up a line is where you'd check the release notes for changes. Enterprise customers who need longer coverage can reach out, and for rare high-severity issues we'll use our judgment and may patch outside the window.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-stay-current">How to stay current<a href="https://docs.litellm.ai/blog/version-support#how-to-stay-current" class="hash-link" aria-label="Direct link to How to stay current" title="Direct link to How to stay current">​</a></h2>
<p>The best way to stay up to date on these changes is to bookmark our <a href="https://docs.litellm.ai/release_notes" target="_blank" rel="noopener noreferrer">release notes</a>. We update it as new versions ship, so you can see the latest stable line and the three behind it that are still supported.</p>]]></content:encoded>
            <category>release</category>
            <category>support</category>
        </item>
        <item>
            <title><![CDATA[Semantic Caching on Valkey and AWS ElastiCache]]></title>
            <link>https://docs.litellm.ai/blog/valkey_semantic_caching</link>
            <guid>https://docs.litellm.ai/blog/valkey_semantic_caching</guid>
            <pubDate>Wed, 17 Jun 2026 10:00:00 GMT</pubDate>
            <description><![CDATA[LiteLLM now supports semantic prompt caching on Valkey clusters running the valkey-search module, including AWS ElastiCache for Valkey, with no RediSearch, Redis Stack, or Qdrant required.]]></description>
            <content:encoded><![CDATA[<p>LiteLLM now supports semantic prompt caching on Valkey. If you run a Valkey cluster with the <a href="https://github.com/valkey-io/valkey-search" target="_blank" rel="noopener noreferrer">valkey-search</a> module, including AWS ElastiCache for Valkey, you can point LiteLLM at it with <code>type: valkey-semantic</code> and get embedding-based cache hits without standing up Redis Stack or a separate vector database.</p>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="why-this-matters">Why this matters<a href="https://docs.litellm.ai/blog/valkey_semantic_caching#why-this-matters" class="hash-link" aria-label="Direct link to Why this matters" title="Direct link to Why this matters">​</a></h2>
<p>Semantic caching stores responses by the meaning of a prompt rather than an exact string match, so a reworded request can still hit the cache and skip a paid model call. Until now LiteLLM's semantic cache was built on RedisVL, which depends on RediSearch's <code>FT.*</code> vector API. RediSearch is not available on Redis OSS or on ElastiCache for Redis OSS, which left teams standing up Redis Stack or Qdrant just to get semantic caching. With Redis moving to a source-available license, more teams are standing up Valkey instead, and ElastiCache for Valkey is a common managed target.</p>
<p>Valkey ships vector search through the valkey-search module, and ElastiCache for Valkey exposes it. LiteLLM's new backend talks to valkey-search directly over the Redis protocol, so semantic caching on ElastiCache for Valkey works without RediSearch, Redis Stack, or Qdrant in the path.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-it-works">How it works<a href="https://docs.litellm.ai/blog/valkey_semantic_caching#how-it-works" class="hash-link" aria-label="Direct link to How it works" title="Direct link to How it works">​</a></h2>
<p>The <code>valkey-semantic</code> backend builds its own vector index from the field types valkey-search supports, a tag field that isolates each cache key's scope and an HNSW vector field for the prompt embedding, then runs a KNN query at lookup time and returns the cached response when the cosine similarity clears your threshold. Prompt extraction, embedding generation, and response handling are shared with the existing Redis semantic cache, so behavior matches the Redis path including per-request scope isolation. Connections resolve from <code>VALKEY_HOST</code>, <code>VALKEY_PORT</code>, and <code>VALKEY_PASSWORD</code>, falling back to the <code>REDIS_*</code> equivalents, and passwordless clusters are supported for IAM or no-auth setups.</p>
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="get-started">Get started<a href="https://docs.litellm.ai/blog/valkey_semantic_caching#get-started" class="hash-link" aria-label="Direct link to Get started" title="Direct link to Get started">​</a></h2>
<p>Add the cache to your <code>config.yaml</code>:</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">litellm_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">cache</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">cache_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">type</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> valkey</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">semantic</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">host</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/VALKEY_HOST</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">port</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> os.environ/VALKEY_PORT</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">valkey_semantic_cache_embedding_model</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> openai</span><span class="token punctuation" style="color:rgb(4, 81, 165)">-</span><span class="token plain">embedding</span><br></span><span class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token key atrule">similarity_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.8</span><br></span></code></pre></div></div>
<p>For ElastiCache with encryption in transit, pass a <code>rediss://</code> URL through <code>cache_params.redis_url</code> instead of host and port. To try valkey-search locally, the bundled image has the module ready:</p>
<div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell 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 -p 6379:6379 valkey/valkey-bundle:8.1</span><br></span></code></pre></div></div>
<p>See the <a href="https://docs.litellm.ai/docs/proxy/caching" target="_blank" rel="noopener noreferrer">caching docs</a> for the full setup, including the SDK usage and the parameter reference.</p>]]></content:encoded>
            <category>caching</category>
            <category>valkey</category>
            <category>elasticache</category>
            <category>semantic cache</category>
        </item>
        <item>
            <title><![CDATA[June Townhall: Product + Roadmap Updates]]></title>
            <link>https://docs.litellm.ai/blog/june-townhall-announcement</link>
            <guid>https://docs.litellm.ai/blog/june-townhall-announcement</guid>
            <pubDate>Tue, 16 Jun 2026 07:30:00 GMT</pubDate>
            <description><![CDATA[Join the LiteLLM June townhall on Thursday, 25 June at 7:30 AM PST to learn about LiteLLM's product updates and roadmap.]]></description>
            <content:encoded><![CDATA[<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>Rescheduled</div><div class="admonitionContent_BuS1"><p>The June townhall has been moved from Thursday, 18 June to <strong>Thursday, 25 June at 7:30 AM PST</strong>. Thanks for your patience!</p></div></div>
<p>We are hosting our June townhall on <strong>Thursday, 25 June at 7:30 AM PST</strong>.</p>
<div style="background-size:cover;background-repeat:no-repeat;position:relative;background-image:url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAADCAIAAAAlXwkiAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAZUlEQVR4nGNQ1zIUVzKwCMjRMPEyt/EO9Yv0dwm0N7Qz1rAy0bFnUFM38nIPSUrISYhLDwuO9fEO9/aJCotMUzNwVtZyZFDTtfG2NzXRUhIREmZi5WFh42Xj5Gdm42Nk5WVk5QMA9GESa0+FNe4AAAAASUVORK5CYII=&quot;)"><svg style="width:100%;height:auto;max-width:100%;margin-bottom:-4px" width="640" height="166"></svg><noscript><img style=width:100%;height:auto;max-width:100%;margin-bottom:-4px;position:absolute;top:0;left:0 src=/assets/ideal-img/june_townhall_banner.d4959f3.640.png srcset="/assets/ideal-img/june_townhall_banner.d4959f3.640.png 640w,/assets/ideal-img/june_townhall_banner.dc93478.693.png 693w" width=640 height=166></noscript></div>
<!-- -->
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="agenda">Agenda<a href="https://docs.litellm.ai/blog/june-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/june-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/june-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/june-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/sjWTYN2BBrikZg3KA" target="_blank" rel="noopener noreferrer">LiteLLM June Townhall Form</a></p>
<p>We will hold the townhall from <strong>7:30 AM to 8:30 AM PST 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:encoded>
            <category>announcement</category>
            <category>townhall</category>
        </item>
    </channel>
</rss>