FUTURE-AI COURSE GUIDE

The Future of AI Infra: Kubernetes to Agent Sandboxes

A chapter-by-chapter readback of the free course by Akshat Bubna on Latent Space.

Length59:10
Chapters20
Modules5
Plain Markdown with clickable timestamps — drops into Obsidian, Notion or GitHub as-is.

A sitting infrastructure CTO explains why AI apps — bursty GPUs, agent sandboxes, elastic training — don't fit the Kubernetes-era cloud, and what primitives replace it. Rare first-hand detail on spec decode, multi-cloud GPU pooling, and building for agents instead of humans.

Who it's for
Read this guide if
  • You build or operate GPU infrastructure for inference or training
  • You're evaluating Modal, sandboxes, or alternatives to Kubernetes for AI workloads
  • You want to understand speculative decoding and cold-start optimization from the source
Skip ahead if
  • You want a hands-on tutorial with code walkthroughs
  • You're only interested in model research, not infrastructure
  • You need on-prem or air-gapped deployment options
In brief
  • Runtime: ~59 minutes (3,550 seconds)
  • 20 chapters grouped into 5 chronological modules
  • Tools discussed: Modal, Kubernetes, SGLang, DFlash, RDMA/InfiniBand, Rust/Python/TypeScript SDKs
  • Level: intermediate to advanced — assumes familiarity with cloud infra and ML serving
  • Format: interview podcast turned into readable study guide

The walkthrough

Each chapter below is our original written explanation of what happens at that moment in the video — a paraphrase, not a transcript. Click any timestamp to jump the player.

Origins: Why AI Needed a New Cloud

0:00

Introduction

Latent Space hosts swyx and Vibhu welcome Modal CTO Akshat Bubna after Modal's Series C to discuss the state of AI infrastructure.

1:53

Origin Story

How CEO Eric, previously at Spotify, wanted a better runtime than Kubernetes-based workflow orchestration, which suffered from poor developer experience and operational difficulty.

2:45

GPUs Before ChatGPT

Modal added A100 GPUs a full year before ChatGPT launched, initially serving classical inference like computer vision and XGBoost, viewing the runtime as a primitive for verticalized products.

3:42

Why Kubernetes Fell Short

Kubernetes was designed for slowly scaling web servers, not bursty, compute-heavy workloads needing custom images and accelerators — the gap Modal set out to fill.

4:53

Decorators Over YAML

Co-locating configuration with code via decorators was core from day one; the team argued the DSL only covers hardware and scaling config, so customers still own their own code.

6:08

From DX to Agent Experience

Modal reoriented its SDK team around agent experience rather than developer experience, since typed decorators with live feedback beat untyped YAML for agents writing code.

Sandboxes and Elastic Workloads

10:03

Proto-Cognition Experiments

Akshat reflects on an early use case he calls proto-cognition, and the retrospective lesson about collecting failures and building RL environments before it was obvious.

10:24

Early Sandboxes

In May 2023 Modal built sandboxes before the concept was mainstream; the first public example put a small model in a self-improving loop, though models then diverged after roughly ten iterations.

12:03

Sandboxes Go Mainstream

The sandbox product only took off about a year before the interview, including anecdotes like instantly hosting models from a Hugging Face link on GPU sandboxes.

13:33

Elastic Inference as Core Business

Modal's biggest use case is elastic inference, first finding product-market fit with custom non-LLM models like Suno's audio and Runway's video, where unpredictable, diurnal traffic across many models and regions makes autoscaling hard.

Faster Inference: Snapshotting, Spec Decode, Auto Endpoints

17:58

Speculative Decoding Explained

A draft model predicts tokens ahead and the large model verifies them in batch, exploiting memory-bandwidth-bound single-token prediction; speedup depends on accept length with no quality loss.

19:22

DFlash: Block-Based Speculation

Modal open-sourced DFlash, a block-based speculator achieving performance comparable to proprietary providers, and plans to help customers train speculators on custom models.

20:08

The Auto Endpoints Vision

Auto Endpoints let users create endpoints from UI or CLI without touching code, with optimizations baked in, transparent code, and the option to eject into full Modal for fine-tuning.

Networking, Multi-Cloud, and Training

25:28

Multi-Cloud Capacity Pool

Modal spans 17 cloud providers without owning data centers; its software layer and own reliability handling absorb the varying reliability of NeoClouds so user workloads survive GPU failures.

28:08

Sandbox Networking and I6PN

Sandboxes support sidecars for egress control, proxies, and credential injection, plus an IPv6 overlay network letting containers address each other privately — originally built for distributed training.

33:27

RDMA-Based Distributed Training

Multi-node training bypasses the TCP stack with RDMA, reaching around 3 terabits per second internally; Modal targets post-training of medium-size models rather than frontier pre-training runs.

35:34

Auto Inference Agents

An internal repo uses an agent to run profiling sweeps, tune configs, and even switch GPU types, automating performance engineering; today's auto research is guided hyperparameter sweeps, not architecture search.

Strategy, Security, and What's Next

40:32

Batch Tier and Compute Strategy

Good economics depend on capacity management: Modal blends reservations, forecasts capacity across GPU types and regions, and offers a cheaper batch tier for latency-insensitive jobs like computational biology.

52:24

Agents Orchestrating Video Models

The XAI Grok team predicts the next tier of video generation is agents orchestrating video models via tools, enabling minute-long videos; Modal already sees companies running GPU sandboxes doing video manipulation.

55:40

SDKs and Building for Agents

Modal's runtime is Rust-based with Python, Go, and TypeScript SDKs; the DX-to-AX pivot leaned on a 'modal bench' benchmark, and agents hallucinating features became product feedback that pushed logs and metrics into the CLI.

Moment by moment

TimeWhy it matters
6:08The pivot from developer experience to agent experience — Modal's core strategic bet
17:58Clear explanation of speculative decoding and why accept length beats kernel tuning
25:28How Modal pools capacity across 17 cloud providers while staying capital-light
40:32Compute strategy: GPU reservations, forecasting, and supply-chain bets explained via the airline fuel-hedge analogy
52:24The prediction that agents orchestrating video models, not better models, unlock long-form video

Do this next

  1. Try Modal's free tier: deploy a small inference endpoint with a decorator-based function and watch cold-start behavior
  2. Read the DFlash repo and the SGLang integration to understand block-based speculative decoding hands-on
  3. Sketch how your own workload's traffic shape (bursty vs steady, GPU vs CPU-bound) maps to Modal's autoscaling versus a Kubernetes cluster

Common questions

Does Modal replace Kubernetes?

Not for always-on web workloads — Modal explicitly says it doesn't compete with providers like Render. It targets bursty, compute-heavy AI workloads needing GPUs and rapid scale up/down, where Kubernetes assumptions break down.

What is speculative decoding and why does it matter?

A small draft model proposes tokens and the large model verifies them in batch, exploiting spare compute bandwidth. Because tokens are only accepted if the big model would emit them anyway, quality is unchanged while speed improves 2–4x depending on accept length.

Is Modal suitable for agent sandboxes in production?

The episode argues managed agent offerings are fine for prototypes, but production agents need file persistence, snapshot/restore, networking control, and GPUs — which is where a specialized sandbox provider fits. Modal stays harness-agnostic.

Does Modal offer on-prem or air-gapped deployment?

No. Modal is cloud-only, running a capacity pool across 17 cloud providers rather than selling on-prem or air-gapped versions.

Spot a mistake?

Every chapter summary on this page is hand-checked against the video, but errors can slip through. If you spot a wrong timestamp, misattributed claim, or unclear paraphrase, please let us know.

More course guides