<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yahav Ohana</title>
    <description>The latest articles on DEV Community by Yahav Ohana (@yahav_ohana_10166c18e6df4).</description>
    <link>https://dev.to/yahav_ohana_10166c18e6df4</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4022928%2F904a6abb-8c2e-4899-9be1-f7a3fffbd669.png</url>
      <title>DEV Community: Yahav Ohana</title>
      <link>https://dev.to/yahav_ohana_10166c18e6df4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yahav_ohana_10166c18e6df4"/>
    <language>en</language>
    <item>
      <title>Why Model Routing Backfires and How to Build Agents That Don’t Burn Your Budget</title>
      <dc:creator>Yahav Ohana</dc:creator>
      <pubDate>Thu, 23 Jul 2026 21:20:34 +0000</pubDate>
      <link>https://dev.to/yahav_ohana_10166c18e6df4/why-model-routing-backfires-and-how-to-build-agents-that-dont-burn-your-budget-5h57</link>
      <guid>https://dev.to/yahav_ohana_10166c18e6df4/why-model-routing-backfires-and-how-to-build-agents-that-dont-burn-your-budget-5h57</guid>
      <description>&lt;h3&gt;
  
  
  By Shay Dahan, JFrog Boost Co-Founder Yahav Ohana, JFrog Boost Co-Founder | July 23, 2026
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw9az3km5k393359mwhhg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw9az3km5k393359mwhhg.png" alt="Don't burn tokens" width="800" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Model routing promises to cut your AI agent spend by offloading routine tasks to cheaper models like Claude Haiku while reserving frontier models like Claude Sonnet for complex reasoning. In the right configuration, routing strategies can reduce inference costs by &lt;a href="https://proceedings.iclr.cc/paper_files/paper/2025/hash/5503a7c69d48a2f86fc00b3dc09de686-Abstract-Conference.html" rel="noopener noreferrer"&gt;40–85%&lt;/a&gt;. But if you implement routing incorrectly in a multi-turn agent, you can end up paying more than if you’d never routed at all. Here’s why and how to fix it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Token Costs Accumulate Across a Session
&lt;/h2&gt;

&lt;p&gt;Understanding why routing backfires requires understanding how agentic sessions accumulate costs. Each turn in a conversation compounds the token count, and that compounding is the engine behind both your savings and your risk.&lt;/p&gt;

&lt;p&gt;Every turn in an agent session carries a growing token payload. The table below shows how the distribution shifts across a typical three-turn session:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs59xk2sx1y8nx2qnlzpq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs59xk2sx1y8nx2qnlzpq.png" alt=" " width="800" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By Turn 3, cached tokens make up the vast majority of your token payload. This is the efficiency you’re trying to protect. Switching models mid-session destroys that protection entirely.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F633fmhnowngo1bosbqux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F633fmhnowngo1bosbqux.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Switching Models Mid-Session Increase Your Costs?
&lt;/h2&gt;

&lt;p&gt;Switching LLM models mid-session wipes out accumulated prompt cache savings because every provider’s cache is model-specific — the new model has no access to the previous model’s stored history and must re-read the entire conversation from scratch at standard input token rates.&lt;/p&gt;

&lt;p&gt;Prompt caches operate on prefix matching. The LLM provider stores a hash of your message prefix. As long as the prefix stays stable and the model stays the same, every subsequent turn benefits from heavily discounted cached token pricing. &lt;a href="https://www.anthropic.com/claude/sonnet" rel="noopener noreferrer"&gt;Anthropic&lt;/a&gt;, for example, offers up to a 90% discount on cached input tokens. The moment you switch models, the new model starts with a cold cache. It processes the entire conversation history at full input token cost, as if Turn 1 never happened. For short sessions, this is a minor annoyance. For agentic coding workflows where context windows can stretch to 50,000 tokens or more, a single mid-session model switch can spike costs enough to eliminate all the savings routing was supposed to deliver.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Should Not Do
&lt;/h2&gt;

&lt;p&gt;Several common routing patterns look like optimizations but actively hurt your cost profile. These are the most frequent causes of unexpected cost increases in production agent systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Switching models in the middle of a long conversation without summarization&lt;/strong&gt; — This forces the new model to reprocess the entire conversation history at full input token cost. The cache miss penalty for a 20,000-token session can cost more than the savings the switch was intended to generate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enabling auto-routing mid-session in LLM gateways&lt;/strong&gt; — LLM gateway tools like LiteLLM, OpenRouter, and Portkey support automatic routing based on query complexity. This is powerful for single-turn queries, but enabling it mid-session in an agentic loop invalidates your KV cache at every routing boundary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modifying tools or system prompts mid-session&lt;/strong&gt; — Tool definitions sit inside the cached prefix. Adding or removing a tool during a session invalidates the entire cache downstream from that change. Treat session tool configuration as immutable once started.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Using compression calls with a separate model&lt;/strong&gt; — Many agents compress long history by spawning a summarization call with a cheap model. If that call uses a different model or a different system prompt, it generates its own cache miss and resets the main session cache on return.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Avoiding these patterns requires intentional session design, not just correct routing logic. Your routing strategy is only as good as your session architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to Do Instead
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5f31j27govh1tzhhlqxu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5f31j27govh1tzhhlqxu.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Effective model routing in agentic systems is a session-level concern, not a query-level one. The following practices let you capture the cost benefits of routing without sacrificing the prompt cache savings that make agentic AI economically sustainable:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Minimize turns per task and delegate early&lt;/strong&gt; — Keep individual agent sessions as short as possible. When you know a task requires extensive context (e.g., a complex multi-file refactor, a long-running compliance check) delegate it to a subagent at the start, before the session accumulates history. Short sessions mean small caches, which means a model switch costs less.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use the subagent pattern for model diversity&lt;/strong&gt; — Instead of switching models within a single session, build an orchestrating agent that delegates subtasks to purpose-built subagents. Each subagent starts fresh with only the context it needs and runs on whatever model is best for its specific task. No cache invalidation. No accumulated history penalty. This pattern (sometimes called the orchestrator-subagent architecture) is the cleanest way to get cost-based model diversity without paying the mid-session switch penalty.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Summarize deliberately before any required model switch&lt;/strong&gt; — If a model switch mid-session is unavoidable, create a structured handoff: explicitly summarize the active context, the current task state, and any open decisions into a compact message. Start a fresh session with the new model using only that summary as input. You pay standard input costs on a small summary instead of cached costs on a 20,000-token history replay.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lock your session configuration&lt;/strong&gt; — System prompts, tool definitions, and model selection should be fixed at session start. Treat them like a schema — changing them mid-session is a migration event, not a configuration tweak. If your agent framework allows dynamic tool loading, audit where and when those loads happen relative to your cache prefix boundary.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How JFrog Boost Protects Your Cache Efficiency Automatically
&lt;/h2&gt;

&lt;p&gt;While managing model routing logic is critical for agent sustainability, context bloat acts as a massive force multiplier for token waste. Every time an agent runs a build, executes a test suite, or pulls logs, hundreds of lines of repetitive terminal noise flood the conversation history.&lt;/p&gt;

&lt;p&gt;In a multi-turn session, this noise compounds rapidly. It turns what should have been a lean history into a 50,000-token payload within a few turns. This directly breaks your cost engineering: if your session is bloated with terminal noise, the “cache miss penalty” we discussed earlier becomes exponentially more expensive the moment a mid-session model switch occurs.&lt;/p&gt;

&lt;p&gt;When utilizing coding agents, developers shouldn’t have to manually curate terminal output just to prevent a noisy build step from inflating their LLM bill.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://boost.jfrog.com" rel="noopener noreferrer"&gt;JFrog Boost&lt;/a&gt; is designed to solve this context bloat directly within the developer workflow&lt;/strong&gt;. Boost is a lightweight CLI tool that intelligently compacts terminal output during agentic loops, stripping out repetitive boilerplate while perfectly preserving the critical signal, like exact error stack traces. Instead of sending thousands of tokens of raw build logs to your model, Boost trims the payload before it ever hits the agent.&lt;/p&gt;

&lt;p&gt;By keeping your session history lean, Boost drastically reduces the baseline tokens processed per turn. This minimizes the financial penalty of unavoidable model routing switches, extends the life of your context window, and maximizes the economic efficiency of your prompt caches.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F93sx2k42k08jnicb1pny.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F93sx2k42k08jnicb1pny.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing for Sustainable Agent Economics
&lt;/h2&gt;

&lt;p&gt;Model routing delivers real cost savings, but only when it respects the underlying mechanics of provider prompt caches. To build sustainable agent workflows, treat your conversation history as a highly optimized asset: Keep your primary sessions lean, delegate heavy context to short-lived subagents, and ensure any necessary model transition is handled through a structured state summary rather than a raw history replay.&lt;/p&gt;

&lt;p&gt;Ultimately, engineering sustainable agentic systems requires treating token efficiency as a core constraint alongside speed and accuracy.&lt;/p&gt;

&lt;p&gt;To implement these session-level optimizations automatically and eliminate context waste in your development workflows, you can &lt;a href="https://boost.jfrog.com" rel="noopener noreferrer"&gt;install Boost&lt;/a&gt; and start saving tokens today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connect with us
&lt;/h2&gt;

&lt;p&gt;We would love to hear about your experiences, architectural patterns, and challenges with model routing. Feel free to reach out or follow our ongoing research into coding agents:&lt;br&gt;
→ &lt;strong&gt;X:&lt;/strong&gt; &lt;a href="https://x.com/ShayFrektman" rel="noopener noreferrer"&gt;https://x.com/ShayFrektman&lt;/a&gt;, &lt;a href="https://x.com/yahav_ohana" rel="noopener noreferrer"&gt;https://x.com/yahav_ohana&lt;/a&gt;&lt;br&gt;
→ &lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/shay-dahan" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/shay-dahan&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/yahav-ohana" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/yahav-ohana&lt;/a&gt;&lt;br&gt;
→ &lt;strong&gt;Substack:&lt;/strong&gt; &lt;a href="https://substack.com/@yahavohana" rel="noopener noreferrer"&gt;https://substack.com/@yahavohana&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Published originally on: &lt;a href="https://jfrog.com/blog/why-model-routing-backfires/" rel="noopener noreferrer"&gt;https://jfrog.com/blog/why-model-routing-backfires/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>claude</category>
      <category>openai</category>
      <category>ai</category>
    </item>
    <item>
      <title>Stop Wasting AI Tokens: How to Slash LLM Costs with JFrog Boost [free --forever] 🚀</title>
      <dc:creator>Yahav Ohana</dc:creator>
      <pubDate>Thu, 09 Jul 2026 20:11:18 +0000</pubDate>
      <link>https://dev.to/yahav_ohana_10166c18e6df4/stop-wasting-ai-tokens-how-to-slash-llm-costs-with-jfrog-boost-free-forever-45gd</link>
      <guid>https://dev.to/yahav_ohana_10166c18e6df4/stop-wasting-ai-tokens-how-to-slash-llm-costs-with-jfrog-boost-free-forever-45gd</guid>
      <description>&lt;p&gt;&lt;strong&gt;🚀 TL;DR:&lt;/strong&gt; AI coding assistants (like Cursor, Claude Code, and Copilot) burn through tokens by sending massive, bloated context windows. We built &lt;strong&gt;&lt;a href="https://boost.jfrog.com" rel="noopener noreferrer"&gt;JFrog Boost&lt;/a&gt;&lt;/strong&gt; to intellectually trim context noise and slash your LLM costs without sacrificing code quality. Try it out, read our launch deep-dive, and &lt;strong&gt;&lt;a href="https://github.com/jfrog/boost" rel="noopener noreferrer"&gt;star us on GitHub&lt;/a&gt;&lt;/strong&gt; if you like saving budget!&lt;/p&gt;




&lt;p&gt;AI coding tools are an absolute game-changer—until you see the token bill. &lt;/p&gt;

&lt;p&gt;The reality is that context windows get bloated fast. Your LLM doesn't need to swallow half your repository just to fix a simple bug or refactor a function. Massive prompts don't just cost more; they introduce context drift, slow down response times, and occasionally make the AI hallucinate.&lt;/p&gt;

&lt;p&gt;To solve this, we built &lt;strong&gt;&lt;a href="https://boost.jfrog.com" rel="noopener noreferrer"&gt;JFrog Boost&lt;/a&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;It’s an open-source developer tool designed to optimize your prompt mechanics, strip out the noise, and drastically lower your token footprint.&lt;/p&gt;

&lt;h3&gt;
  
  
  🛠️ What it does under the hood:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Token Trimming:&lt;/strong&gt; Minimizes context bloat before it hits the LLM.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Cost Efficiency:&lt;/strong&gt; Maximizes the performance-to-cost ratio of your AI engineering workflows.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Faster Iterations:&lt;/strong&gt; Smaller, tighter contexts mean faster response times from your coding agents.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We just dropped a &lt;strong&gt;&lt;a href="https://jfrog.com/blog/jfrog-boost-saves-ai-coding-tokens/" rel="noopener noreferrer"&gt;detailed launch blog post&lt;/a&gt;&lt;/strong&gt; breaking down the benchmarks, the architecture, and exactly how much token overhead you can save starting today.&lt;/p&gt;

&lt;h3&gt;
  
  
  🌟 Support the Project
&lt;/h3&gt;

&lt;p&gt;We are fully open-source! If you find the tool useful or want to contribute, please &lt;strong&gt;&lt;a href="https://github.com/jfrog/boost" rel="noopener noreferrer"&gt;give us a star on GitHub&lt;/a&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Give the tool a spin at &lt;strong&gt;&lt;a href="https://boost.jfrog.com" rel="noopener noreferrer"&gt;boost.jfrog.com&lt;/a&gt;&lt;/strong&gt; and let us know what you think in the comments! How are you currently managing your AI token budgets?&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo512lncqfjh0a2nrnigt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo512lncqfjh0a2nrnigt.png" alt="Chart showing JFrog Boost reducing AI context window size from 1.1M to 742K tokens" width="800" height="318"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxcfzirv46jdimwperyf6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxcfzirv46jdimwperyf6.png" alt="Screenshot of the JFrog Boost user interface" width="799" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>news</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
