Ai4
Intelligent model routing lowers enterprise inference spending by treating multi-turn prompt selection as a robotics problem that preserves cache state and avoids frontier pricing.
AI-assisted summary of Intelligent Model Routing: Frontier Performance Without Frontier Bills With Not Diamond — original source. Check the original for full context.
Source published:
Detailed notes
- [00:04](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=4s) Tomás Hernando Kofman introduces Not Diamond and its focus on intelligent model routing to optimize performance and reduce costs for enterprise coding agents. ## Key takeaways - [00:04](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=4s) Enterprise AI inference spend is scaling massively, leading engineering organizations to deplete annual coding budgets in matter of months or weeks. - [02:15](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=135s) Rising costs for frontier models, continuous autonomous execution, and broader developer adoption drive rapidly growing inference expenditures. - [02:15](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=135s) A strong model arbitrage opportunity exists because fast-improving small and open-weight models deliver frontier-equivalent capabilities at lower prices. - [05:05](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=305s) Intelligent routing predictively chooses the optimal model for each prompt, whereas gateways primarily handle connectivity and governance across model APIs. - [05:05](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=305s) Simple or naive routing techniques like heuristics, semantic embeddings, or LLM-based decisions fail to handle long-horizon agent interactions effectively. - [05:05](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=305s) Not Diamond frames model routing as a robotics problem in a long-horizon environment to optimize costs and rewards across multi-turn sessions. - [09:01](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=541s) Key factors influencing agentic costs include model selection, reasoning effort levels, KV cache preservation, and context window compaction. - [09:01](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=541s) Invalidating the KV cache by switching models mid-session can eliminate expected cost savings due to forced full context rewrites. - [12:09](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=729s) Not Diamond operates as a telemetry layer without inspecting prompt payloads, ensuring user code and data remain strictly local and private. - [16:11](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=971s) Applying Jevons' Paradox to AI, cheaper and more efficient inference will increase overall usage across knowledge and background agents over time. - [16:11](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=971s) Model routing prevents single-vendor lock-in, shifts pricing power back to enterprises, and reduces global compute and financial waste.
## Detailed walkthrough ### [00:04](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=4s) Introduction and the Soaring Costs of Enterprise AI
Tomás Hernando Kofman, co-founder and CEO of Not Diamond, opens his presentation by introducing his company's focus: intelligent model routing specifically tailored for coding agents. He defines intelligent model routing as the ability to predictively determine when to deploy specific Large Language Models (LLMs) to maximize accuracy while minimizing costs. As new models launch on a weekly basis with vastly different price points and performance profiles, deciding which model to invoke for any given task becomes a critical operational challenge.
Kofman highlights the deep background of the Not Diamond team, noting that they are serial founders and AI researchers who previously published foundational papers introducing Retrieval-Augmented Generation (RAG) and function calling. Backed by prominent AI scientists and founders, Not Diamond powers auto-routing for major platforms such as OpenRouter and works with large enterprise clients like SAP.
Transitioning to the underlying problem, Kofman emphasizes that enterprise AI inference spending has surged tenfold over the past year and is on track to scale by another 10x. Enterprise engineering organizations are rapidly exhausting their annual coding agent budgets in months or even weeks. Kofman references a real-world example where one of the world's largest banks burned through its entire monthly Claude Code budget in a single afternoon.
- **Background & Credentials:** Team members invented function calling and introduced RAG; investors and partners include major AI founders, OpenRouter, and SAP. - **Inference Cost Surge:** Enterprise inference spend grew 10x year-over-year and is projected to grow another 10x. - **Budget Burn Example:** A major global bank depleted its entire monthly budget for Claude Code in just one afternoon.
---
[02:15](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=135s) Key Trends Driving Inference Spend and Model Arbitrage
Kofman details three key macro trends accelerating inference expenditure across organizations:
1. **Increasing Frontier Costs:** Frontier models (such as "Fable GB 5.6 Soul") continue to grow more expensive as compute demands scale alongside performance gains. 2. **Autonomous Execution Scaling:** Incremental performance improvements allow models to run far longer and execute parallel, autonomous workloads. For instance, when Claude 4.5 Opus was released, spend skyrocketed 10x—not because the token price was 10x higher, but because the model was reliable enough to run autonomously overnight. 3. **Broadening User Adoption:** While AI adoption reaches 80%–95% within engineering orgs, total spend is still disproportionately driven by power users, leaving significant room for further growth as average developers ramp up usage.
At the same time, open-source and smaller models are catching up to frontier capabilities at a fraction of the cost. Kofman points to models like GLM-5.2 (approximating Sonnet or Opus), Kimi k3 (surpassing Opus and nearing Fable), and DeepSeek-V4-Flash as high-performing, cost-effective options. This gap between expensive frontier models and powerful low-cost options creates a durable "model arbitrage" opportunity.
- **Claude 4.5 Opus Spend Impact:** Driven by continuous overnight autonomous runs rather than direct unit price increases. - **High-Performing Budget Models:** GLM-5.2, Kimi k3, and DeepSeek-V4-Flash offer frontier-like capabilities at significantly lower price points.
---
[05:05](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=305s) Defining Intelligent Model Routing vs. Gateways
Intelligent model routing is defined as automatically selecting the optimal model for each individual prompt or request to balance accuracy and expense. Kofman clarifies the distinct difference between a gateway and a router: - **Gateways** (e.g., OpenRouter, LiteLLM, Portkey) govern access, routing protocols, and infrastructure connections across multiple model APIs. - **Intelligent Routers** predictively decide *which* specific model to invoke for each turn or request.
Kofman notes that building an effective router is "deceptively difficult." Early or naive approaches often turn out to be architectural dead ends, including: - Heuristic `if/else` logic - Semantic routing based purely on query embedding space - Using an LLM call to route another LLM call - Training simple complexity classifiers - Cascade routing (trying a small model first, then falling back to a larger model on failure) - Session-based static routing (basing the entire agent trajectory on the first message)
Rather than treating routing as a single classification task, Not Diamond frames it like a **robotics problem**: a long-horizon environment with sparse rewards. The agent state serves as the environment, while the available models and reasoning effort levels form the action space. The router must predict future costs and rewards across 3, 5, 10, or 100 interaction turns before the final reward is realized upon session completion.
- **Gateways vs. Routers:** Gateways handle management/governance; routers make predictive intelligence decisions per request. - **Performance Benchmark:** On TerminalBench, Not Diamond achieved performance equivalent to Claude 4.8 Opus (Extra High reasoning) while delivering a **30% cost reduction**. - **Enterprise Savings:** Fortune 500 engineering teams achieve 20% to 40%+ cost savings using Anthropic models alone (routing between Opus, Sonnet, and Haiku), with savings nearly doubling when open-weight models are integrated.
---
[09:01](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=541s) Cost Drivers in Agentic Environments
Kofman outlines four primary levers influencing cost and performance in agentic applications:
1. **Model Selection:** Defaulting to top-tier frontier models for trivial tasks wastes budget, but selecting an underpowered small model can be equally expensive if it gets stuck in endless loops or requires costly bug fixes later. 2. **Reasoning Effort Levels:** Distinctions between reasoning settings (e.g., Opus Low vs. Medium, or Sonnet High vs. Max) dramatically impact output token volume, which compounds on every subsequent conversation turn. 3. **KV Cache Economics:** Reusing context via Key-Value (KV) caching heavily discounts input costs. Switching models mid-session invalidates the existing cache, forcing a complete cache rewrite that can negate the savings of a cheaper model. 4. **Context Window Expansion & Compaction:** Unmanaged context context growth triggers auto-compaction—an expensive process that consumes entire context windows and degrades model performance as window saturation increases.
Compounding these technical variables is the fact that the underlying ecosystem is a moving target: new models launch weekly, harnesses update, and pricing structures evolve continuously.
- **Key Cost Drivers:** Model choice, reasoning effort configurations, KV cache hit rates, and context window compaction frequency. - **Cache Trade-off:** Switching models mid-session destroys KV cache state, potentially increasing overall spend despite choosing a lower-cost model.
---
[12:09](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=729s) Real-Time Optimization and Architecture Walkthrough
To tackle these challenges, Not Diamond optimizes every turn of an agent session by evaluating model choice, reasoning effort, KV cache status, and task boundaries. For example, when developers keep a single session running indefinitely across distinct tasks, Not Diamond detects task changes (e.g., moving from Task A to Task B) and triggers targeted context compaction. Furthermore, the system incorporates implicit developer feedback—such as when a developer accepts a suggestion or manually overrides a model choice—to continuously adjust its real-time routing recommendations tailored to individual user preferences.
``` +--------------------------------------------------------------------+ | Local Developer Machine | | | | +--------------------+ Anonymized Metadata | | | Agent Harness | ---------------------------------+ | | | (Claude Code, etc) | | | | +--------------------+ v | | ^ +------------------+| | | Model & Reasoning Recommendation | Local Proxy || | +---------------------------------- | (Cache Monitor) || | +------------------+| +----------------------------------------------------------|---------+ | Metadata v +-----------------------+ +------------------+ | Existing Gateway | <---------------------- | Remote Server | | (Anthropic / LiteLLM) | Routed Execution | (Router Engine) | +-----------------------+ +------------------+ | v +-----------------------+ | Model Endpoints / VPC | +-----------------------+ ```
Kofman explains that a key privacy benefit of this architecture is that Not Diamond never sees user prompt payloads, inputs, or outputs. The local proxy extracts only privacy-preserving telemetry metadata—message counts, token counts, local complexity scores, developer feedback indicators, and KV cache states—meaning Not Diamond operates purely as a telemetry layer rather than a data subprocessor.
- **Optimization Levers:** Turn-by-turn routing, KV cache tracking, task boundary detection, and continuous real-time learning from user feedback. - **Privacy Design:** Payloads and code remain entirely local/private; only derived telemetry metadata is transmitted for routing decisions. - **Infrastructure Integrations:** Works alongside existing enterprise gateways or dedicated private VPC inference endpoints optimized for open-weight models.
---
[16:11](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=971s) Future Horizon and Industry Vision
Looking beyond software development, Kofman argues that coding agents are merely the first wave of agentic deployment. Knowledge workers across enterprise functions are rapidly adopting knowledge agents, which will soon be followed by massive deployments of autonomous background agents running continuously without human intervention to manage data pipelines and system monitoring.
Referencing **Jevons' Paradox**—which states that increased efficiency in resource usage leads to an overall increase in consumption rather than a decrease—Kofman predicts that cheaper, more accessible inference will exponentially drive up total AI workload volume over the next 6 to 18 months.
Kofman closes by outlining three key reasons why model routing is essential for the future of AI: 1. **Preventing Monopolization:** It prevents reliance on a single monolithic provider by lowering switching costs to zero and promoting a diverse model ecosystem. 2. **Empowering Consumers:** It shifts pricing power and control away from model producers and AI research labs back to enterprises and individual consumers. 3. **Maximizing Efficiency:** It eliminates environmental, compute, and financial waste across global AI infrastructure.
- **Jevons' Paradox:** Reductions in inference cost will expand overall agent usage across enterprise knowledge and background workloads over the next 6–18 months. - **Closing Contact:** Tomás Hernando Kofman shared his Twitter/X handle and email, inviting attendees to meet outside for further discussion.
## Notable quotes > [00:04](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=4s) Intelligent model routing is the ability to predictively determine when to deploy specific Large Language Models to maximize accuracy while minimizing costs. — Tomás Hernando Kofman
> [00:04](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=4s) Enterprise AI inference spending has surged tenfold over the past year and is on track to scale by another 10x. — Tomás Hernando Kofman
> [00:04](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=4s) One of the world's largest banks burned through its entire monthly Claude Code budget in a single afternoon. — Tomás Hernando Kofman
> [02:15](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=135s) Frontier models continue to grow more expensive as compute demands scale alongside performance gains. — Tomás Hernando Kofman
> [02:15](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=135s) Spend skyrocketed 10x—not because the token price was 10x higher, but because the model was reliable enough to run autonomously overnight. — Tomás Hernando Kofman
> [05:05](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=305s) Gateways govern access, routing protocols, and infrastructure connections across multiple model APIs, while intelligent routers predictively decide which specific model to invoke for each request. — Tomás Hernando Kofman
> [05:05](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=305s) Building an effective router is deceptively difficult. — Tomás Hernando Kofman
> [05:05](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=305s) Not Diamond frames routing like a robotics problem: a long-horizon environment with sparse rewards. — Tomás Hernando Kofman
> [09:01](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=541s) Selecting an underpowered small model can be equally expensive if it gets stuck in endless loops or requires costly bug fixes later. — Tomás Hernando Kofman
> [09:01](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=541s) Switching models mid-session invalidates the existing cache, forcing a complete cache rewrite that can negate the savings of a cheaper model. — Tomás Hernando Kofman
> [12:09](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=729s) Not Diamond never sees user prompt payloads, inputs, or outputs. — Tomás Hernando Kofman
> [16:11](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=971s) Coding agents are merely the first wave of agentic deployment. — Tomás Hernando Kofman
> [16:11](https://www.youtube.com/watch?v=5YdCKw2kAYI&t=971s) Model routing shifts pricing power and control away from model producers and AI research labs back to enterprises and individual consumers. — Tomás Hernando Kofman
## Mentioned Ai4, Tomás Hernando Kofman, Not Diamond, OpenRouter, SAP, Claude Code, Fable GB 5.6 Soul, Claude 4.5 Opus, GLM-5.2, Sonnet, Opus, Kimi k3, DeepSeek-V4-Flash, LiteLLM, Portkey, TerminalBench, Claude 4.8 Opus, Haiku, Anthropic, Jevons' Paradox, Twitter/X
## Video description Tomás Hernando Kofman - CEO, Not Diamond
Enterprises are burning through AI coding agent budgets in months. In this talk, Not Diamond CEO Tomás Hernando Kofman explains how intelligent model routing cuts coding agent costs by 20%+ while maintaining frontier quality, automatically identifying when a prompt needs a powerful model and when a cheaper one is sufficient. He'll cover how routing differs from gateways, why naive approaches backfire, and what model routing means for the future of AI.
[Source](https://www.youtube.com/watch?v=5YdCKw2kAYI)