Ai4
Standard generative AI deployments fail in production because real-time latency and scaling bottlenecks stem from multi-cloud capacity limits, custom speculative decoding, and client-side concurrency rather than raw GPU count alone.
AI-assisted summary of Inference in the Wild: Lessons from Scaling Real-time AI in Production With Baseten — original source. Check the original for full context.
Source published:
Detailed notes
## Background Published on YouTube by the Ai4 channel on August 24, 2025, this presentation features Philip Kiely, Developer Advocate at Baseten. According to the talk description, it examines the four essential components of production-ready inference platforms—applied performance research, multi-cloud infrastructure, model management observability, and AI engineering expertise—highlighting common pitfalls and resilient architectural patterns for real-time generative AI workloads.
## TL;DR Kiely examines how modern AI-native startups reach $100M ARR with teams under 100 people by relying on automated AI infrastructure alongside an explosion of versatile open-source models. He defines the four pillars of inference strategy—quality, latency, economics, and differentiation—and explains why naive off-the-shelf deployments fail in real-world environments. Drawing on practical customer engagements, he details how custom speculative decoding slashed Sourcegraph Amp latencies to 200 ms, how multi-cloud routing provisioned over 1,800 H100 GPUs during a massive launch, and how fixing client-side bottlenecks unlocked a 12x throughput gain, ultimately showing that production inference requires rigorous software engineering rather than just raw GPU hardware.
## Atmosphere & style The presentation maintains a pragmatic, direct, and technically grounded tone typical of high-caliber engineering conferences, opening with casual personal anecdotes before quickly transitioning into rapid-fire architecture breakdowns. Kiely speaks with energetic clarity and authoritative realism, systematically dismantling AI hype to highlight unglamorous production realities like TLS handshakes, Python GIL bottlenecks, and regional cloud capacity exhaustion. The experience feels practical and empowering, offering systems builders battle-tested blueprints and empirical validation directly from the operational front lines.
## Key takeaways - [00:04](https://www.youtube.com/watch?v=xYn20Yv_giE&t=4s) Baseten's core operational thesis is that 'inference is everything' when scaling production-grade generative AI applications. - [01:12](https://www.youtube.com/watch?v=xYn20Yv_giE&t=72s) AI-native companies are scaling from $1M to $100M ARR in 1 to 2 years with tiny teams of fewer than 100 people, aiming for an informal benchmark of $1M ARR per employee. - [04:50](https://www.youtube.com/watch?v=xYn20Yv_giE&t=290s) Companies evaluating AI infrastructure focus on four core pillars: domain-specific quality, sub-second latency, shift from token 'price taker' to infrastructure 'price maker' economics, and proprietary differentiation. - [06:32](https://www.youtube.com/watch?v=xYn20Yv_giE&t=392s) The open-source model landscape has exploded across modalities, including text models like DeepSeek, Qwen 3, and OpenAI GPT-OSS, alongside specialized vision, embedding, and speech architectures. - [07:50](https://www.youtube.com/watch?v=xYn20Yv_giE&t=470s) Open-source architectures enable powerful composability across modalities, demonstrated by fine-tuning Llama 3.2 3B into Orpheus TTS to emit audio tokens directly. - [09:15](https://www.youtube.com/watch?v=xYn20Yv_giE&t=555s) Off-the-shelf deployments of engines like vLLM, SGLang, or TensorRT-LLM reliably fail in production without custom optimizations for multi-tenancy, traffic spikes, and strict latency targets. - [10:31](https://www.youtube.com/watch?v=xYn20Yv_giE&t=631s) Sourcegraph Amp reduced tab auto-completion latency from 700 ms down to roughly 200 ms by engineering over 1,000 lines of custom speculative decoding code in TensorRT-LLM. - [12:43](https://www.youtube.com/watch?v=xYn20Yv_giE&t=763s) Multi-cloud capacity management and global control planes are essential to burst compute dynamically across regions and providers, as demonstrated by scaling an active workload past 1,800 Nvidia H100 GPUs. - [14:37](https://www.youtube.com/watch?v=xYn20Yv_giE&t=877s) Client-side bottlenecks such as connection renegotiation and Python GIL saturation can severely limit throughput, with multi-core client execution delivering a 12x throughput gain on identical GPU infrastructure. - [16:33](https://www.youtube.com/watch?v=xYn20Yv_giE&t=993s) Production inference is more than just securing raw GPUs; it requires balancing model runtime optimizations, distributed multi-cloud systems, and foundational software engineering rigor.
## Detailed walkthrough ### [00:04](https://www.youtube.com/watch?v=xYn20Yv_giE&t=4s) Introduction: The Definition and Role of Inference in Modern AI
Philip Kiely, Developer Advocate at Baseten, opens his talk by referencing Baseten's bold billboard campaign declaring that "inference is everything." Presenting a photo of himself with his team on Cape Cod, Kiely explains that Baseten focuses on building production-grade inference infrastructure specifically tailored for fast-growing startups. To understand why robust inference infrastructure is critical today, he outlines a three-part agenda: examining macro market trends, analyzing the operational challenges at their intersection, and studying real-world customer case studies.
```mermaid flowchart LR accTitle: Three-Part Agenda Flow subgraph S1["1. Market Trends"] A["AI-Native Growth"] B["Open Source Explosion"] end subgraph S2["2. Core Needs"] C["Scale, Reliability & Latency"] end subgraph S3["3. Execution"] D["Production Case Studies"] end A --> C B --> C C --> D ```
- Baseten's core thesis: "Inference is everything" in production AI. - Focus: Building high-performance AI infrastructure and inference platforms for high-growth startups. - Agenda framework: Evaluating two defining industry trends, finding their intersection in real-time inference requirements, and examining concrete customer case studies.
---
[01:12](https://www.youtube.com/watch?v=xYn20Yv_giE&t=72s) Trend 1: The Exponential Growth of AI-Native "Tiny Teams"
The first major trend is the unprecedented trajectory of AI-native companies. In the traditional SaaS era, taking 5 to 10 years to scale from $1M to $100M in Annual Recurring Revenue (ARR) was considered absolute best-in-class performance. Today, AI-native startups are achieving that same $100M ARR threshold in just 1 to 2 years, adding millions or tens of millions of dollars in revenue month-over-month despite operating in very young markets.
What makes this financial scale even more remarkable is the emergence of "tiny teams." Historically, reaching $100M ARR required hundreds or thousands of employees. AI-native startups are reaching it with fewer than 100 staff members—and informally targeting a metric of $1M ARR per employee. This massive revenue growth paired with minimal headcount expansion is only possible because heavy operational and computational leverage is offloaded to automated AI infrastructure.
- **ARR Scaling Comparison**: - *SaaS Era*: 5–10 years to reach $100M ARR (required 100s–1,000s of employees). - *AI-Native Era*: 1–2 years to reach $100M ARR (achieved with fewer than 100 employees). - **Tiny Team Benchmark**: Unofficial target metric of $1,000,000 ARR per employee.
---
[03:00](https://www.youtube.com/watch?v=xYn20Yv_giE&t=180s) Real-World AI-Native Workloads: Descript and Zed Industries
Kiely illustrates how AI-native products deliver value through concrete customer examples. As a video creator, he relies on **Descript** daily. Previously, editing raw video in iMovie required manually cutting clips, typing captions, and arranging title cards—a tedious workflow consuming roughly one hour of editing per minute of finished video. With Descript powered by Baseten's transcription and AI pipeline, creators type text edits to cut video automatically, instant captions are injected, and an entire video editing session takes an hour or less in total.
A second example is **Zed Industries**, creators of the high-performance text editor Zed (similar to Cursor). Designed in Rust to maximize speed and minimize local system resource usage, Zed extends its performance-first philosophy to its integrated AI code assistant. By partnering with Baseten, Zed delivers lower-latency code autocompletion and rapid model responses directly inside the editor.
- **Descript Workflow Savings**: Reduced editing time from 1 hour per finished minute of video down to ~1 hour for an entire project. - **Zed Industries**: Rust-based text editor built for extreme performance, leveraging Baseten for low-latency code completion.
---
[04:50](https://www.youtube.com/watch?v=xYn20Yv_giE&t=290s) The Four Core Pillars of AI Infrastructure Strategy
AI-native companies evaluate their underlying AI infrastructure against four distinct priorities:
1. **Quality**: The output must be top-notch. For instance, **Open Evidence** (described as "ChatGPT for doctors") requires flawless accuracy, as medical responses carry zero tolerance for hallucinations. 2. **Latency**: For voice agents or rapid interactive loops where feedback is measured in milliseconds, winning or losing market share comes down to "literally the blink of an eye." 3. **Economics**: Startups want to transition from being passive "price takers" accepting rigid per-token rates to "price makers" who directly control their hardware and inference trade-offs. 4. **Differentiation**: Leading AI startups reject being simple "ChatGPT wrappers." They demand deep customization and control over the model layer to build defensible IP and own their own product destiny.
| Pillar | Focus & Objective | Representative Customer Example | |:--- |:--- |:--- | | **Quality** | Domain-specific precision and accuracy | **Open Evidence** (Medical domain precision) | | **Latency** | Sub-second response times for real-time interaction | Voice agents and interactive UX loops | | **Economics** | Shift from token "price taker" to infrastructure "price maker" | Custom hardware allocation and cost control | | **Differentiation** | Custom weights and fine-tuning vs. standard wrappers | Proprietary AI workflows on open models |
---
[06:32](https://www.youtube.com/watch?v=xYn20Yv_giE&t=392s) Trend 2: The Explosion and Composition of Open-Source Models
The second macro trend is the explosive growth of open-source models, with nearly 2 million models hostable on Hugging Face across every modality and parameter size. In open-source LLMs, the landscape exploded six months ago with DeepSeek, followed by powerful international models including the GLM series by Zhipu AI, Kimi, and Qwen 3 (Qwen Coder). Meanwhile, Western labs continue releasing competitive weights like Mistral, Google's Gemma, and OpenAI's recently released GPT-OSS—marking OpenAI's first open-weights release since GPT-2 in 2019.
Beyond text, open-source models lead across multiple modalities: - **Vision/Image**: Qwen Image leads diffusion transformer architectures (similar to the viral Studio Ghibli generation models). - **Embeddings**: Models like Qwen Embed act as the connective tissue for RAG and vector retrieval systems. - **Speech/Transcription**: OpenAI's Whisper remains the audio transcription standard. - **Text-to-Speech (TTS)**: Orpheus TTS represents a "Llama moment" for open-source speech, allowing developers to own and fine-tune hyper-realistic custom voices.
```mermaid flowchart TD accTitle: Open Source Base Models to Fine-Tuned Modalities subgraph Base ["Base Open Weights"] L3["Llama 3.2 3B (Language)"] end subgraph Adapted ["Adapted Modality Models"] Orph["Orpheus TTS (Speech Output)"] QEmb["Qwen Embed (Vector Search)"] end L3 -->|"Architecture fine-tuning"| Orph L3 -->|"Weight adaptation"| QEmb ```
A key technical advantage of open source is composability. For instance, Orpheus TTS was built by fine-tuning **Llama 3.2 3B**—a text-based LLM—to output audio tokens directly, demonstrating how base architectures can be adapted into entirely new modalities.
- **LLM Open Weights**: DeepSeek, GLM (Zhipu AI), Kimi, Qwen 3, Mistral, Gemma, and OpenAI GPT-OSS. - **Multimodal Open Models**: Qwen Image (Diffusion Transformer), Qwen Embed, Whisper (Speech-to-Text), and Orpheus TTS (Text-to-Speech).
---
[09:15](https://www.youtube.com/watch?v=xYn20Yv_giE&t=555s) Production Reality: Why Off-the-Shelf Deployments Fail
While getting an API key from OpenAI was the historical path to shipping products, relying on open-source models introduces operational complexity. Beginners often throw an off-the-shelf inference engine like vLLM, SGLang, or TensorRT-LLM onto a few GPUs and expect production readiness.
In practice, simple deployments crumble under actual production traffic. Standard setups fail to satisfy the combined requirements of high quality, ultra-low latency, strict unit economics, and custom differentiation. Overcoming these limitations requires solving hard engineering challenges across model performance research, cloud infrastructure, observability tooling, and systems engineering.
> "The path to production used to be: go to openai.com, get an API key, put it in your product, and ship. Now there's a lot more things you have to do in order to leverage these open source models effectively."
- Common inference frameworks: vLLM, SGLang, TensorRT-LLM. - The Core Problem: Basic deployments cannot handle real-world traffic spikes, latency constraints, or multi-tenant demand without specialized optimizations.
---
[10:31](https://www.youtube.com/watch?v=xYn20Yv_giE&t=631s) Case Study 1: Sub-Second Latency Optimization for Sourcegraph Amp
For real-time developer tooling, latency is paramount. Software engineers type rapidly, leaving only a tiny millisecond window between keystrokes. If an AI auto-completion tool delays output, it disrupts the developer's flow. **Sourcegraph** encountered this bottleneck with their **Amp** tab auto-completion feature, where latencies were spiking up to **700 milliseconds**—an unacceptable delay that rendered the product frustrating to use.
```mermaid flowchart LR accTitle: Speculative Decoding Optimization Flow subgraph SpecDec ["Speculative Decoding Mechanism"] Draft["Small Draft Model<br/>(Generates candidate tokens)"] Verify["Large Target Model<br/>(Verifies candidate tokens)"] end Draft -->|"Fast proposal"| Verify Verify -->|"High acceptance rate"| Output["Accepted Completion"] ```
To solve this, Baseten collaborated with Sourcegraph to overhaul their inference stack. They implemented TensorRT-LLM, optimized KV caching, and engineered a custom speculative decoding pipeline. Baseten wrote over **1,000 lines of code** for a new draft decoding algorithm, producing higher-quality candidate tokens that achieved significantly higher acceptance rates by the main model. This reduced completion latency down to a couple hundred milliseconds, aligning output speed directly with human typing reaction times.
- **Problem**: Sourcegraph Amp tab completions were spiking up to **700 ms**, breaking user workflow. - **Solution**: Deployed TensorRT-LLM, KV caching optimizations, and custom speculative decoding. - **Engineering Effort**: Authored 1,000+ lines of custom decoding code to improve draft token acceptance. - **Outcome**: Cut latency down to ~200 ms, matching human reaction speed.
---
[12:43](https://www.youtube.com/watch?v=xYn20Yv_giE&t=763s) Case Study 2: Auto-Scaling Across Cloud Providers (The 1,800 GPU Launch)
Scalability creates a different set of infrastructure hurdles. During a major launch for a key customer, traffic surged far beyond baseline levels. Starting from a steady state of roughly 400 GPUs, Baseten's automated scaling platform dynamically provisioned over **1,800 Nvidia H100 GPUs** during peak demand before automatically scaling back down later in the day.
```mermaid flowchart TD accTitle: Multi-Cloud Capacity Management Topology subgraph Control ["Global Control Plane"] Router["Traffic Router & Capacity Manager"] end subgraph Primary ["Primary Cloud Provider"] Reg1["Primary Region (H100 Pool Exhausted)"] end subgraph Spillover ["Spillover Infrastructure"] Reg2["Secondary Region (H100 Pool)"] Cloud2["Alternative Cloud Provider (H100 Pool)"] end Router --> Primary Router -->|"Traffic Surge Spillover"| Reg2 Router -->|"Capacity Exhaustion Spillover"| Cloud2 ```
Critically, the customer's peak GPU demand exceeded the total physical inventory available inside their primary cloud provider's single data center region. Baseten's **Multi-Cloud Capacity Management** architecture resolved this bottleneck by employing a global control plane that orchestrated workloads across multiple cloud regions and secondary cloud vendors in an active-active setup. This prevented data center capacity exhaustion, ensured high availability without regional single-point failures, and minimized latency by routing requests to geographically optimal hardware.
- **Peak Compute Deployment**: Scaled automatically from ~400 GPUs to over **1,800 Nvidia H100 GPUs** during a live launch. - **Capacity Management**: Mitigated physical data center limits by spilling traffic over into alternative regions and cloud providers seamlessly. - **Architecture**: Separated a global control plane from distributed execution planes for active-active reliability and optimal pricing.
---
[14:37](https://www.youtube.com/watch?v=xYn20Yv_giE&t=877s) Case Study 3: Eliminating Client-Side Bottlenecks for 12x Throughput
The final case study highlights how performance bottlenecks often lie entirely outside the GPU or model runtime. Developers frequently report latency discrepancies—such as expecting a 200 ms response time based on model benchmarks but experiencing 300 ms end-to-end. Kiely notes that these hidden delays often stem from traditional software engineering issues, such as failing to reuse HTTP sessions (where establishing a new connection adds several dozen milliseconds per call).
```mermaid flowchart LR accTitle: Client Parallelism Bottleneck vs Baseten Performance Client subgraph Standard ["Standard Client"] PyGIL["Python GIL Bottleneck<br/>(Single CPU Core)"] -->|"Unsaturated pipe"| StandardGPU["GPU (Idle Cycles)"] end subgraph Optimized ["Baseten Performance Client"] MultiCPU["Multi-Core Parallel Execution"] -->|"Saturates pipeline"| FullGPU["GPU (100% Utilization)"] end ```
To fix client-side bottlenecks, Baseten created the **Baseten Performance Client**. In standard Python environments, the Global Interpreter Lock (GIL) restricts execution parallelism, preventing the client from issuing concurrent requests quickly enough to saturate powerful remote GPUs. By bypassing GIL restrictions across multi-core CPUs on massive embedding workloads (benchmarked on a corpus backfill of 2,000,000 embeddings), Baseten achieved a **12x increase in throughput** on the exact same model and GPU hardware purely by optimizing client request delivery.
- **HTTP Overhead**: Failing to reuse HTTP sessions adds dozens of milliseconds in TLS handshake and connection overhead per call. - **Python GIL Bottleneck**: Standard Python SDKs bottleneck single-threaded client processing, leaving server GPUs underutilized. - **Benchmark Result**: Processing **2,000,000 embeddings** achieved a **12x throughput gain** using the Baseten Performance Client without altering the underlying GPU hardware or model runtime.
<ElicitationsGroup message="Explore related AI infrastructure and inference topics:"> <Elicitation label="Analyze speculative decoding algorithms" query="Explain how speculative decoding works in LLM inference, comparing draft model token generation and target model verification."/> <Elicitation label="Examine multi-cloud GPU orchestration design" query="How do multi-cloud control planes manage active-active GPU capacity failover and latency-based routing across cloud providers?"/> <Elicitation label="Detail client-side optimization techniques for LLMs" query="What are the main client-side bottlenecks in high-concurrency LLM inference pipelines and how do you optimize around the Python GIL?"/> </ElicitationsGroup>
[16:33](https://www.youtube.com/watch?v=xYn20Yv_giE&t=993s) Core Engineering Fundamentals and the True Nature of Production Inference
While novel AI breakthroughs and cutting-edge models are exciting to explore and discuss, engineering teams must not lose sight of foundational software engineering discipline. The core basics and fundamentals of building reliable software become even more critical when deploying real-time generative AI products into production environments under intense real-world demand.
```mermaid flowchart LR accTitle: Core Pillars of Production AI Inference subgraph InferenceSystem["Production Inference Engine"] direction TB RT["Model Runtime & Optimization"] INF["Distributed Infrastructure"] ENG["Core Software Engineering"] end InferenceSystem --> SCALE["High-Velocity Scaling with Lean Teams"] ```
Scaling AI successfully in production requires understanding that inference is fundamentally "more than just GPUs." It is a delicate combination of runtime performance optimization, resilient distributed infrastructure, and the foundational engineering practices that bind the entire architecture together. When this stack is engineered correctly, it enables next-generation applications to scale at unprecedented velocity while maintaining remarkably lean engineering teams.
- **Foundations Over Hype:** Teams must prioritize traditional software engineering excellence alongside cutting-edge AI experimentation. - **Triad of Inference:** Production inference demands a balance of optimized runtime, distributed infrastructure, and sound engineering practices rather than just raw GPU capacity. - **Expo & Follow-Up:** Attendees are invited to connect outside the session room or visit the Baseten team at Booth 600 in the expo hall to discuss production workloads and pick up Baseten t-shirts.
## Notable quotes > [00:04](https://www.youtube.com/watch?v=xYn20Yv_giE&t=4s) inference is everything — Philip Kiely
> [01:12](https://www.youtube.com/watch?v=xYn20Yv_giE&t=72s) tiny teams — Philip Kiely
> [04:50](https://www.youtube.com/watch?v=xYn20Yv_giE&t=290s) ChatGPT for doctors — Philip Kiely
> [04:50](https://www.youtube.com/watch?v=xYn20Yv_giE&t=290s) literally the blink of an eye — Philip Kiely
> [04:50](https://www.youtube.com/watch?v=xYn20Yv_giE&t=290s) price takers — Philip Kiely
> [04:50](https://www.youtube.com/watch?v=xYn20Yv_giE&t=290s) price makers — Philip Kiely
> [04:50](https://www.youtube.com/watch?v=xYn20Yv_giE&t=290s) ChatGPT wrappers — Philip Kiely
> [06:32](https://www.youtube.com/watch?v=xYn20Yv_giE&t=392s) Llama moment — Philip Kiely
> [09:15](https://www.youtube.com/watch?v=xYn20Yv_giE&t=555s) The path to production used to be: go to openai.com, get an API key, put it in your product, and ship. Now there's a lot more things you have to do in order to leverage these open source models effectively. — Philip Kiely
> [16:33](https://www.youtube.com/watch?v=xYn20Yv_giE&t=993s) more than just GPUs — Philip Kiely
## Mentioned Philip Kiely, Baseten, Descript, iMovie, Zed Industries, Zed, Cursor, Rust, Open Evidence, ChatGPT, Hugging Face, DeepSeek, GLM, Zhipu AI, Kimi, Qwen 3, Qwen Coder, Mistral, Google, Gemma, OpenAI, GPT-OSS, GPT-2, Qwen Image, Qwen Embed, Whisper, Orpheus TTS, Llama 3.2 3B, vLLM, SGLang, TensorRT-LLM, Sourcegraph, Sourcegraph Amp, Nvidia H100, Baseten Performance Client, Python
## Video description Philip Kiely, Developer Advocate, Baseten
Abstracts
Real-time generative AI applications promise transformative user experiences—but scaling inference in production is a constant battle. Demand spikes, infrastructure meltdowns, and unpredictable model behaviors lurk behind every release. Drawing from direct experience deploying mission-critical AI workloads at startups and large enterprises, this talk covers the four essential components of a production-ready inference platform: applied model performance research, distributed multi-cloud infrastructure, model management and observability tooling, and AI engineering expertise. I'll highlight common pitfalls and share concrete advice on how to build robust, resilient systems that thrive under real-world demand.
[Source](https://www.youtube.com/watch?v=xYn20Yv_giE)