Skip to content
Blogs
Modal logo

Modal

Engineering blog · modal.com/blog

74posts0this week0watchers

Feature trails

18
Feature trailActive

Sandboxed Code Execution

Modal's platform supports scaling to millions of concurrent sandboxes, with tens of thousands of sandboxes created per second. This is achieved by rebuilding the core sandbox platform from the ground up, removing central bottlenecks from the control plane, and optimizing container scheduling and startup. The new system utilizes a fleet of horizontally scaled scheduling servers that directly contact workers via RPC, bypassing central datastores in the critical path for sandbox creation. This post introduces a new resource allocation strategy that moves away from fixed reservations towards a burstable model, significantly improving resource utilization for workloads with spiky CPU demands, such as AI agents and development tasks.

13 posts · 2024–2026

Timeline

20242026
Feature trailActive

gVisor Container Runtime Enhancements

Modal is a major contributor and now a maintainer of gVisor, a container runtime that provides a secure application kernel (Sentry) between containers and the host kernel. This enhances multi-tenancy security by creating a strong isolation boundary. Modal has significantly contributed to gVisor's GPU support (nvproxy), enabling new NVIDIA GPUs and drivers, multi-GPU workloads, graphics, simulation, video, monitoring, and profiling. They also added RDMA support (rdmaproxy) for multi-node training, improved snapshotting capabilities for faster restores, and optimized filesystem and memory performance. gVisor's ability to run without nested virtualization and its fast startup times are key to Modal's platform. Modal aims for gVisor to be the default for untrusted code and AI compute, focusing on security, performance, accelerator support, sandbox density, portable state, and multi-vendor neutrality.

1 post · 2026

Timeline

Feature trailActive

Speculative Decoding for LLM Inference

Modal's platform deeply integrates speculative decoding for LLM inference, enabling significant speedups by using a draft model to generate token sequences in parallel. This feature allows for lossless acceleration of the autoregressive decoding phase, turning serial work into parallel work. The platform supports training custom speculators tailored to application-specific data, leading to substantial improvements in acceptance lengths and overall inference throughput. Recent work has focused on optimizing diffusion models, training custom draft models on representative traffic for specific languages and domains (like Japanese business context), improving acceptance rates and reducing per-token decode latency, and extending speculative decoding to structured output (e.g., JSON schema) and grammar-constrained generation. The platform also supports dynamic batching and KV-aware routing to further optimize inference performance and tail latencies.

6 posts · 2025–2026

Timeline

20252026
Feature trailActive

Region Selection

Modal's platform allows users to select cloud regions for Function execution, offering granular control over deployment locations to meet regulatory requirements, reduce egress fees, and minimize latency by co-locating compute with data or users. This feature supports specifying regions at various levels of detail, from broad continents to specific data centers. Region selection is now available on all plans. Recent work has focused on validating the benefits of a distributed control plane to further enhance routing and session affinity.

2 posts · 2024–2026

Timeline

20242026
Feature trailActive

AI Research Infrastructure

Modal's platform provides scalable, reproducible, and isolated infrastructure for executing AI research workloads, including GPU compute, consistent benchmarking environments, and sandboxed execution. This enables researchers to accelerate AI development, particularly in areas like automated kernel generation and self-improving AI systems. The platform now offers enhanced support for Reinforcement Learning (RL) post-training of LLMs, addressing infrastructure challenges in training, rollouts, and fine-tuning. The introduction of Modal Dojo further simplifies production-grade LLM training by providing building blocks, tuned defaults, and observability for custom dataset training and recipe tuning.

4 posts · 2024–2026

Timeline

20242026
Feature trailActive

Inference Performance Optimization

Modal's platform enables significant performance improvements for AI inference through various optimizations. This includes reducing host overhead in schedulers, optimizing multimodal inference by caching shared GPU memory handles, enhancing speculative decoding for LLMs, enabling serverless GPU inference with rapid spin-up times, and supporting real-time generative video by co-locating inference containers and using direct communication via Tunnels. Recent work has focused on optimizing diffusion models and now includes support for Meta's Muse Spark Open model, offering a 1M-token context window for agentic coding and long-horizon tasks, available as a shared endpoint with per-token billing.

13 posts · 2024–2026

Timeline

20242026
Feature trailActive

Virtual Computer Abstraction

Modal's platform is presented as a virtual computer, abstracting and multiplexing compute resources across multiple cloud providers. This layer of virtualization aggregates, isolates, and multiplexes demand onto hardware at a grander scale than individual clouds, enabling higher resource efficiency for engineering teams by providing a more productive abstraction over raw cloud infrastructure. This post elaborates on the analogy of Modal as a computer, detailing how programs run, how they are stored, and how they are executed. Markov Robotics leverages this abstraction for end-to-end training and inference pipelines, processing hundreds of terabytes of data, running multiple training jobs concurrently, and enabling low-latency remote inference via Modal Tunnels. The code-first approach also empowers AI coding agents.

2 posts · 2026

Timeline

Feature trailActive

WebSockets

Modal functions now support the WebSocket protocol, enabling real-time, bidirectional data transfer between clients and servers. This feature allows for persistent connections, reducing latency and facilitating real-time updates for applications. It integrates seamlessly with existing Modal functions, supporting libraries like FastAPI and automatically scaling based on input volume. Use cases include real-time streaming responses for audio and text generation, status updates on long-running task. This post demonstrates building a low-latency voice AI chatbot using Pipecat and open models, leveraging Modal's ability to autoscale independent GPU and CPU services for STT, LLM, and TTS inference, and integrating with WebSockets for real-time communication.

1 post · 2024–2026

Timeline

20242026
Feature trailActive

Flash Attention Kernel Analysis

Modal's platform provides deep integration with FlashAttention kernels, enabling significant performance optimizations for LLM inference. Recent contributions focus on adapting FlashAttention-4 for decode-heavy workloads by adjusting parallelism strategies (e.g., switching to KV parallelism) and supporting irregular global memory accesses via `cp.async` and Tensor Memory Accelerator (TMA) optimizations. This includes adding support for FP8 inputs, enabling arbitrary KV page sizes, and optimizing for Nvidia's Blackwell architecture. The platform also details the asynchronous pipeline architecture of FA4, including warp specialization and producer-consumer models for efficient execution.

1 post · 2025–2026

Timeline

20252026
Feature trailCooling

Generative AI Evals and Compute Scaling

Modal's platform supports advanced techniques for engineering generative AI applications, including robust evaluation frameworks ('evals') and dynamic inference-time compute scaling. This enables developers to systematically improve the quality and performance of AI-driven systems, such as generating aesthetically pleasing and functional QR codes. The platform facilitates the development lifecycle from initial demos to production-ready systems by providing tools for objective measurement, and has been used to achieve high QR code scan rates and aesthetic quality.

1 post · 2025

Timeline

20252026
Feature trailCooling

Serverless Key-Value Store (Dict)

Modal's Dict primitive provides a serverless TTL'ed key-value store accessible from any container within a workspace. Recent enhancements include unlimited storage, a revised expiry policy (7 days since last read or write), data durability, and a locking primitive via the `.put()` method's `skip_if_exists` flag. These improvements enable advanced use cases like LRU-like caching with extended TTLs for hot entries and distributed locking for 'exactly once' semantics.

1 post · 2025

Timeline

20252026
Feature trailCooling

Resource Solver

Modal's platform utilizes a sophisticated resource solver, powered by linear programming (LP) and the GLOP solver, to dynamically manage cloud compute resources. This system optimizes instance procurement based on real-time demand, pricing, and availability across multiple cloud providers. It ensures customers receive scalable compute at predictable and favorable prices, while also identifying arbitrage opportunities to reduce operational costs. The solver balances the dual mandates of rapid scaling and cost-optimization, employing heuristics to prune instance types and ensure fast solve times. Observed scaling limits from cloud providers are fed back into the solver for subsequent runs. Background workers request instances based on the solver's output, and report observed limits back.

1 post · 2025

Timeline

20252026
Feature trailCooling

Fine-tuning Generative Models

Modal's platform supports fine-tuning generative models on custom datasets, enabling users to prepare datasets, set up containerized environments with necessary dependencies, utilize cloud storage for model weights, and configure training hyperparameters. The process includes training scripts, hyperparameter configuration, and serving the fine-tuned model via a web UI. Ramp has utilized Modal to accelerate the development of their text-to-structured-JSON model for receipt management, driving down costs and improving performance. Spindle, an open-source, Tinker-compatible training server, has been released to run within Modal workspaces, offering per-GPU time pricing and customization for full-parameter training and multi-LoRA on open models. It features a distributed control plane, disaggregated trainer engines, and leverages Modal primitives like Clusters, Volumes, and Servers. Spindle enables multi-client batch scheduling, async checkpointing, delta weight syncs, and custom inference routing for multi-LoRA and KV-aware request routing, leading to significant cost savings and improved GPU utilization compared to token-based pricing models.

5 posts · 2023–2024

Timeline

20232026
Feature trailCooling

Static IP Proxies

Modal's platform supports static IP egress for serverless containers, enabling secure connections to private resources. This is achieved through a Go-based VPN proxy (_vprox_) utilizing WireGuard for Layer 3 tunnels, handling dynamic IP allocation and policy-based routing. The system ensures all outbound traffic originates from a static IP, addressing requirements for consistent egress IPs.

1 post · 2024

Timeline

20242026
Feature trailQuiet since 2024

Cloud Function Platform

Modal's cloud function platform supports automated CI workflows on GPUs, enabling parallelized testing and faster iteration for AI development. This integration allows GitHub Actions to trigger Modal Functions with custom GPU requirements, significantly reducing test execution time and eliminating the need for self-hosted runners. The platform's usage-based billing and cached image builds contribute to cost-effectiveness.

5 posts · 2024

Timeline

20242026
Feature trailQuiet since 2024

Hybrid Search with Embeddings

Modal's platform supports building hybrid search applications by integrating with data platforms like MongoDB Atlas and foundation models for generating embeddings. This enables complex search queries combining text, geolocation, timestamps, and vector embeddings derived from satellite imagery, demonstrating a new capability for data-driven AI applications. This post details a specific implementation using Sentinel satellite imagery, Clay v1 foundation model, and MongoDB Atlas for hybrid search over California.

1 post · 2024

Timeline

20242026
Feature trailQuiet since 2024

Dynamic Batching

Modal's platform supports massive job processing with a new durable queue system and a `.spawn_map` interface, capable of handling 1 million inputs and guaranteeing execution for up to 7 days. This significantly enhances the platform's ability to manage large-scale batch workloads, building upon existing dynamic batching capabilities by providing a more robust and scalable solution for tasks like data preprocessing, embedding generation, and training data preparation. FunctionCall results now pe

1 post · 2024

Timeline

20242026
Feature trailQuiet since 2024

Runtime Abuse Detection

Modal has implemented a syscall-based program analysis component called `seccheck` within its serverless container runtime. This system leverages gVisor's syscall interception capabilities to monitor and detect cryptomining activities by analyzing syscall patterns. The `seccheck` component identifies suspicious syscall sequences, such as specific file access patterns or network connections associated with mining pools, and can automatically disable offending Functions, ban users, and prevent further abuse. This builds on earlier metadata-based detection systems.

1 post · 2024

Timeline

20242026