# "The Future of AI Infra: from Kubernetes to Agent Sandboxes"
<!--
ref: @content/youtube/latent-space/the-future-of-ai-infra-from-kubernetes-to-agent-sandboxes
tags: [AI infrastructure, sandboxes, GPU autoscaling, speculative decoding, agent experience, networking primitives, capacity planning]
version: 2
updated_at: 2026-11-22T08:54:05.505Z
-->

**[Watch on YouTube](https://www.youtube.com/watch?v=UwxxlTNPjWo)**

# The Future of AI Infra: from Kubernetes to Agent Sandboxes

*Synthesized from Akshat Bubna in conversation with the hosts of Latent Space, 2026-07-08.*

Akshat Bubna, CTO of Modal, discusses how a serverless compute platform built for spiky, specialized workloads grew into a home for inference, training, batch jobs and agent sandboxes.

## Core Thesis
Akshat argues that AI workloads have a different shape from web serving: they need accelerators, scale up and down violently, and run across many regions, which Kubernetes was not designed for. Modal's answer is a small set of code-defined primitives, now tuned for agents as much as for developers, that customers combine in ways the team did not plan.

## Key Insights
- **Origin.** The founding idea was a better runtime than the Kubernetes-based stacks that made workflow orchestration painful. Infrastructure is declared in decorators beside the code instead of YAML. GPUs (A100s) were added about a year before ChatGPT launched.
- **Sandboxes came early.** Modal built sandboxes in May 2023, initially so an agent could iterate in a loop; models of that era diverged after roughly 10 iterations. The product only took off the previous year, after several quiet years.
- **Elastic inference is the largest use.** Customers such as Suno and Runway have unpredictable daily traffic and deploy many models across regions, so autoscaling per region is the hard part. GPU memory snapshots (for example of a compiled Torch model) make cold starts much faster.
- **Spiky RL demand.** Reinforcement learning deployments can need on the order of 100,000 sandboxes within 20 seconds, and some customers go from 1,000 to 1,500 GPUs in a region quickly.
- **Speculative decoding.** A small draft model proposes tokens and the large model verifies them in a batch. Kernel tuning yields a few percent; raising the acceptance length gives a multiplicative gain of up to about 4x with no quality loss. Modal open-sourced DFlash, a block-based speculator, and works with the SGLang team. It also launched automated endpoints that ship these optimizations with the code visible and editable.
- **Capacity across clouds.** Modal pools capacity from 17 cloud providers with no data centers of its own, and builds its own reliability layer on top. Customers also ask for specific locations for data locality or latency.
- **Networking primitives.** Sandboxes can run sidecars (a sandbox is effectively a pod), egress proxies for logging or credential injection, and tunnels. I6PN, a private IPv6 overlay, was built for the distributed training product and was adopted by users for other purposes. It is plain TCP gated by eBPF programs, not encrypted like WireGuard; RDMA over inter-node links reaches about 3 terabits per second.
- **Training focus.** Modal targets mid-size post-training runs and small research runs rather than giant pre-training. Internally an agent repo automates the forward-deployed-engineer work of profiling and tuning inference configurations, including moving from A100 to B200.
- **Agent experience.** Modal refocused its SDK team on agents: logs and metrics moved from the web interface into the CLI, a Modal skill was written, and a benchmark shows where agents hallucinate functions that the product should then offer. Python remains dominant, while agents use the TypeScript SDK more.
- **Batch pricing.** Modal is building a cheaper tier for jobs that can wait about 24 hours, aimed at customers outside LLMs such as computational biology.
- **Managed agents versus infrastructure.** Managed agent offerings are a good starting point; production agents need control over file storage, snapshots and networking, which is the role Modal wants.
- **Markets beyond LLMs.** Robotics, drug discovery, real-time audio and video, and CI for coding agents (where memory snapshots cut dependency setup) are growth areas.

## Actionable Takeaways
1. Declare infrastructure in code next to the application instead of in separate YAML.
2. For bursty model traffic, plan autoscaling per region, and use GPU snapshots to shorten cold starts.
3. When optimizing inference, work on speculative decoding acceptance length before micro-tuning kernels.
4. Expose observability through a CLI so agents can investigate failures, while keeping a dashboard for human interpretation.
5. Use hard sandbox boundaries for permissions instead of trusting an LLM to mediate them.
6. Forecast capacity as a finance problem, weighing 1-year against 3-year reservations across interchangeable GPU types and regions.

## Notable Quotes
> "We actually changed our SDK team to think about the agent experience, not the developer experience." — Akshat Bubna

> "I'm skeptical of LLM-mediated permissions for things that are at the sandbox level because you need hard boundaries." — Akshat Bubna

> "Speculative decoding is where you have a smaller model, called a draft model, that predicts tokens earlier than the larger model." — Akshat Bubna

---

*Related: `@content/youtube/sequoia/ai-that-designs-its-own-chips-ricursives-anna-goldie-and-azalia-mirhoseini` · `@content/youtube/aie/unlock-agent-autonomy-the-runtime-for-ai-native-systems-tushar-jain-docker` · `@content/youtube/aie/the-one-thing-every-ai-agent-framework-agrees-on-mislav-ivanda-daytona` · `@content/youtube/yc-root-access/meet-the-devtool-founders-building-for-ai-agents` · `@content/youtube/a16z/why-top-founders-are-racing-into-ai-infrastructure`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*