Modal without Kubernetes or Docker: the three layers that run your code
By Christophe Paka · Facts checked on 7 November 2026
A reader on r/MLQuestions asked: "do I need Kubernetes to deploy a model?" Their course had ended at "model trained". Docker and Kubernetes looked like the next two mountains to climb.
Most readers want to run a model, not run a cluster.
Modal without Kubernetes works because Modal built its own layer in the middle. The figure below shows the three layers, and who runs each one.

Use this diagram on your site
Free to share in your blog post, docs, course or slides, as long as the credit link stays. Paste the code below where the figure should go.
How to read this figure
Start with the top layer. The top layer is the only one you write: plain Python with the Modal SDK. Decorators declare what each Function needs, such as an image, a GPU, volumes and secrets. There is no cluster file and no Dockerfile.
Read the file trick in the middle. The middle layer is Modal's own software, written in Rust in place of Docker and Kubernetes. Its key trick is a virtual file system. A container gets its files over the network as it needs them, instead of downloading a whole Image before it starts. Elsewhere, pulling a large uncached image before the start can take minutes.
Read the rest of the middle layer. A scheduler packs many customers' work onto the machines with little waste. A custom runtime boots each container in about 1 second. The last item, gVisor or a microVM, is the wall Modal puts around each container, so your code cannot reach the machine or another customer's code.
Look at the bottom layer. Modal owns no hardware. The bottom layer is CPU and GPU capacity from 20+ clouds, run as one pool. You never pick a cloud, and you never size, patch or stop a machine.
See why the fast boot matters. Scaling to zero only works if boots are fast. If a boot took minutes, every first visitor after a quiet spell would wait. The fast boot is what makes paying by the second work in practice.
Key takeaways
- Skip Kubernetes to ship a model on Modal; describe what each Function needs in Python instead.
- Ask for a GPU type in one word, and list fallback types, best first, for any job with a deadline.
- Expect a container to boot in about 1 second, then plan separately for loading your model.
Try this: find the three layers in your first run
You need Python, a terminal and a Modal account. Set a Workspace budget at modal.com before you run anything.
- Install the client with
pip install modaland sign in withmodal setup. - Write a small function with
@app.function()above it, and run the file withmodal run. - Open the dashboard at modal.com and find your App, its logs and its containers.
Expected result: You wrote the top layer only. Modal's middle layer placed and booted the container, and the pooled clouds supplied the machine. You never chose a server, a cluster or a cloud.
Questions readers ask
Do I need Kubernetes to deploy a model on Modal?
No. Kubernetes is the usual tool for running many containers. Modal replaces it with its own scheduler and runtime, and you never write a file for it. You describe what your code needs in Python, and Modal places and starts the containers.
What keeps my code apart from other customers on Modal?
Modal puts a wall around each container, so your code cannot reach the machine or other customers' code. The figure names the two kinds of wall it uses, gVisor and microVM. You do not set them up; they come with every container.
What happens if the GPU type I asked for is busy?
Your input waits in the queue, unbilled, until a card of that type frees up. Modal publishes no wait times per type, so a wait can miss a deadline. The hedge is a fallback list in the decorator: Modal tries each GPU type in order. Put your preferred card first and costlier ones after it, since each bills at its own rate.
How do I keep a mistake from running up the bill?
Set a Workspace budget on the Usage & Billing page at modal.com before your first run. It is a monthly cap on all usage. The spend limit that comes with it caps what reaches your card, and at that limit Modal stops the workloads.
Sources: Security and privacy (Modal docs); Cold start performance (Modal docs); Budgets (Modal docs).
This figure is from Modal Made Crystal Clear, chapter 2.
The chapter builds the idea step by step, with recipes you can follow, a Try it to check yourself, and every source.
Get the book


