# The Future of AI Infra: from Kubernetes to Agent Sandboxes — Akshat Bubna, Modal CTO
<!--
ref: @content/youtube/latent-space/2026-07-08-the-future-of-ai-infra-from-kubernetes-to-agent-sandboxes-akshat-bubna
version: 2
updated_at: 2026-10-31T20:05:40.970Z
-->

Akshat Bubna (Latent Space, 2026-07-08): Bubna's case is that AI workloads look nothing like the slow-scaling web-server workloads Kubernetes was designed for.

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


*Synthesized from Akshat Bubna on Latent Space, 2026-07-08.*

Akshat Bubna is co-founder and CTO of Modal, the serverless AI cloud. He talks with Latent Space hosts swyx and Vibhu shortly after Modal's Series C.

## Core Thesis
Bubna's case is that AI workloads look nothing like the slow-scaling web-server workloads Kubernetes was designed for. They are bursty, compute-heavy, and need special hardware and custom images, so they call for a runtime built from scratch where infrastructure is declared in code right next to the logic it runs. He argues the same primitives (fast autoscaling, snapshotting, sandboxes, overlay networking) now serve custom-model inference, RL, post-training, and agents. He also says the things that made Modal good for developers carry over almost unchanged to coding agents.

## Key Insights
- **Origin: the problem was Kubernetes.** CEO Eric Bernhardsson started out asking why workflow orchestration tools are so painful. His answer: they run on Kubernetes, which is hard to operate, doesn't handle burstiness or custom images, and has poor developer experience. Modal added GPUs about **a year before ChatGPT** came out, without expecting it to matter much. At the time the target was "classical" inference like computer vision and XGBoost.
- **Infrastructure in decorators.** Modal took swyx's "self-provisioning runtime" idea (he wrote about it while at Temporal) and turned it into decorators that live alongside the code. Bubna says lock-in pushback has been rare. The DSL only describes hardware and scaling, and users still own their code.
- **DX has become AX.** Modal's SDK team now designs for *agent experience* rather than developer experience. Bubna's argument is that an agent shouldn't have to read hundreds of Kubernetes files and write untyped YAML when it can edit a decorator and see the change running. Customers tell him agents move much faster on Modal than on other substrates.
- **Observability still matters even if code review fades.** Fewer people read the code, but humans still need to interpret what's happening and make judgment calls. Modal is moving logs and metrics, which used to be UI-only, into the **CLI** so agents can investigate failures on their own.
- **Sandboxes were early.** Modal shipped sandboxes in **May 2023**. The first published example put swyx's *smol developer* in a loop so the agent could iterate on its own output. Models of that era drifted off course after about **10 iterations**. Sandboxes stayed quiet for about two years before taking off last year.
- **What Modal is for today:** a cloud with AI-native primitives covering **inference, training, batch processing, and sandboxes**. It deliberately leaves always-on web servers to companies like Render.
- **The biggest use case is elastic inference for custom models.** Modal found product-market fit outside the LLM space, with Suno (audio), Runway (video), robotics, and computational biology companies that train elsewhere and treat Modal as a black box for deployment. Their traffic is unpredictable: launches cause spikes, and they run many models across regions whose peaks are offset from each other. The hard problem at scale is no longer going from 0 to 1. It's scaling elastically, for example **from 1,000 to 1,500 GPUs quickly within one region**.
- **GPU snapshotting** captures GPU state, such as a torch-compiled model, so later cold starts are much faster.
- **RL is extremely bursty.** RL rollouts can require **100,000 sandboxes** at once. Bubna says ordinary agent workloads are not especially bursty, but RL is. Batch jobs before a training run, such as encoding, can need thousands of GPUs.
- **Speculative decoding beats kernel tuning.** A small draft model proposes tokens and the large model verifies them in a batch. Decoding one token at a time is memory-bandwidth-bound, and batched verification uses compute more efficiently. Bubna says kernel work yields only **a few percentage points**, while raising **accept length** gives roughly a **2–4x** speedup with no quality loss, because no token is accepted unless the big model agrees with it.
- **DFlash, open sourced.** DFlash is Modal's block-based speculator, which predicts a block of tokens instead of one at a time. Modal has open sourced it and upstreams its work to SGLang. Bubna says open-source DFlash gets you performance on par with proprietary inference providers.
- **Auto Endpoints.** These are created from the UI or CLI with Modal's optimizations (including DFlash) already built in. Users get the full code and can **eject** into ordinary Modal code to fine-tune or modify models. The teased next step: Modal shadows endpoint traffic so **draft models keep adapting as your data distribution shifts**, without a human FDE involved.
- **Production inference is a hard infra problem even without autoscaling.** It includes controlling tail latency and guaranteeing each request is delivered at least once. Modal's edge over self-hosting the same model on vLLM/SGLang is elasticity (true scale-to-zero, true burst) and in-house expertise for performance work that hasn't landed upstream yet.
- **Capital-light super-cloud.** Modal has no data centers of its own. It runs a capacity pool across **17 cloud providers** (many of them neoclouds of uneven reliability) with its own reliability layer on top, so user workloads survive things like a GPU falling off the bus. This lets Modal use capacity a single user couldn't. Customers also ask for workloads pinned to specific regions (EU, US) for data locality or latency.
- **Sandbox networking features:**
  - **Sidecars.** A sandbox is now a pod of containers, which gives Docker Compose-style setups.
  - Fine-grained **egress control**: man-in-the-middle proxies (e.g. logging for RL), per-domain egress rules, and credential injection.
  - **Tunnels**, exposed to the public internet or behind an HTTP auth layer.
  - **i6pn**, an undocumented private **IPv6 overlay network**. Containers in the same workspace can reach each other on private addresses. It is TCP, *not* encrypted (unlike WireGuard), and enforced by **eBPF** programs that allow or reject connections. Modal built it to do the key exchange for RDMA in distributed training. Users found it anyway and use it for things Modal didn't plan for, including sandboxes talking to each other across nodes.
- **Serverless multi-node training.** Adding a decorator to a function gives you a GPU cluster with **RDMA** networking at about **3 Tbps** internal bandwidth. It targets smaller-scale post-training (e.g. medium-sized **Qwen** models), not large pre-training runs. It is also useful for researchers doing small elastic runs even when they have a big cluster.
- **Auto research is mostly hyperparameter tuning for now.** What Bubna sees is a sweep guided by model intuition, more efficient than ordinary sweepers, not architecture search. Internally, Modal's **"auto inference"** repo automates its own FDE work. An agent launches config sweeps, runs **NVIDIA Nsight** profiling, tweaks configs, and even switches GPUs (e.g. **H200 → B200**).
- **Modal's FDEs are applied researchers.** They're essentially applied inference and training researchers. Pre-sales goes to separate solutions architects.
- **How well LLMs write Modal code.** Bubna says models were poor at it before **Claude 4** and now one-shot it. Modal built **Modal Bench** to find what agents still get wrong, mainly reading logs and observability to debug a failure. Results feed into a **Modal skill**. If agents keep reaching for a feature that doesn't exist, Modal treats that as product feedback and may build it (e.g. "maybe this should just be a CLI").
- **Compute strategy is a discipline of its own.** A dedicated team decides the mix of **1-year vs 3-year reservations**, forecasts capacity that is interchangeable across GPU types and regions, and bets on how the supply chain will evolve. swyx compares it to airlines hedging fuel. Unit economics depend on capacity management.
- **Upcoming:** a **batch tier** with much cheaper pricing and results within about **24 hours**, which Bubna says is wanted mostly by non-LLM users like computational biology. Also **regional routing with fallbacks** for low-latency real-time audio and video, more post-training and endpoint tooling, and more agent-stack primitives beyond sandboxes and persistent file systems.
- **Permissions.** Bubna is skeptical of LLM-mediated permissions at the sandbox level. He wants hard boundaries and is fine with softer LLM guardrails layered on top.
- **Managed agents from the labs** (Anthropic and others) are a good starting point. Production teams like **Ramp**, whose background agent Ramp Inspect and accounting agent both run on Modal, need control over file handling, snapshot/restore, networking, and GPUs. Modal has no opinion on where the harness runs.
- **On Replicate:** Modal avoided offering simple model APIs because they mostly serve a less sticky hobbyist market. Modal's examples are starter *code*, aimed at companies with custom needs. One example Bubna gives is a customer that does its training elsewhere but runs all inference on Modal because its model architecture is completely custom.
- **CI is an opportunity.** Coding agents will run far more CI. A lot of CI time goes to preparing dependencies and artifacts, and memory snapshot/restore could speed that up. On GitPod/Ona, which joined OpenAI: strong technically, but Bubna thinks it may have aimed at the wrong market at the wrong time, building build-time sandboxes when runtime sandboxes are what took off.
- **Languages.** The SDKs are Python, Go, and TypeScript, and the runtime is written in Rust and language-agnostic. Inference and training users still use Python. Agent builders use the TypeScript SDK much more. Bubna doesn't expect to need other languages soon.
- **Modal is not an LLM-only company.** Bubna expects major results in drug discovery and computational biology (e.g. Chai Discovery) and robotics. Modal is cloud-only, with no on-prem or air-gapped option.

## Actionable Takeaways
1. **Put infra config in typed code, not YAML,** especially if agents edit your infrastructure. Use decorator-style declarations of GPU type, image, and scaling next to the function so an agent can change one line and watch it run.
2. **Make observability agent-accessible.** Expose logs and metrics in a CLI (Modal moved theirs out of UI-only) so agents can debug failures themselves, and keep humans on dashboards for judgment calls.
3. **Optimize inference by raising speculative-decoding accept length before tuning kernels.** Bubna expects about 2–4x from accept length versus a few percent from kernels. Try a block-based speculator such as Modal's open-source **DFlash** with **SGLang**, and retrain draft models as your traffic distribution changes.
4. **Cut cold starts with GPU snapshotting.** Snapshot the post-`torch.compile` GPU state so later cold starts skip warmup.
5. **Budget sandbox capacity for RL as a burst, not a steady state.** Rollouts can need on the order of 100,000 sandboxes at once.
6. **Control sandbox egress.** Use sidecar containers for MITM proxies to log RL traffic, limit egress to allowed domains, and inject credentials rather than placing secrets inside the sandbox.
7. **Use hard isolation boundaries for sandboxes**, with LLM-mediated guardrails only as an extra layer on top.
8. **Build an internal "auto inference"/auto-research harness:** let an agent launch config sweeps, run NVIDIA Nsight profiling, compare GPU types (H200 vs B200), and pick the winner.
9. **Benchmark how agents use your product.** Build something like Modal Bench, ship a skill to fix the gaps, and when agents keep hallucinating a feature, think about building it.
10. **For latency-insensitive bulk jobs** (comp-bio batches, evals, synthetic data), use batch tiers with a roughly 24-hour turnaround for cheaper compute.
11. **Use managed agents to prototype, then move to a specialized sandbox provider** once you need control over file handling, snapshot/restore, networking, or GPUs.

## Notable Quotes
> "We've actually changed our SDK team to think about agent experience instead of uh developer experience." — Akshat Bubna

> "We built sandboxes in May of 2023 before anyone was even knew this was going to be a thing." — Akshat Bubna

> "Improving kernel only give you like a few percentage points of improvement and increasing accept length literally is a multiplicative decrease…" — Akshat Bubna

> "This is literally not even in our docs page. People somehow found it and they're using it." — Akshat Bubna

> "I'm skeptical of LM mediated permission for stuff that is at the sandbox level because you do want hard boundaries." — Akshat Bubna

> "If they're reaching for this thing it's product feedback like give it to them." — Akshat Bubna

---

*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).*