modal-serverless-gpu

Deploy and run ML workloads on Modal's serverless GPU cloud platform.

13.0k|930|Updated Nov 3, 2025
One-click install
npx skills add https://github.com/Orchestra-Research/AI-research-SKILLs --skill modal-serverless-gpu-orchestra-research
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: modal-serverless-gpu
Source: https://github.com/Orchestra-Research/AI-research-SKILLs/tree/main/09-infrastructure/modal
Command: npx skills add https://github.com/Orchestra-Research/AI-research-SKILLs --skill modal-serverless-gpu-orchestra-research

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires modal>=0.64.0, and includes references (resource) components.

What problem does it solve? Running GPU-intensive ML workloads typically requires provisioning servers, managing infrastructure, and paying for idle compute. This Skill guides you through using Modal to get on-demand GPU access, deploy models as auto-scaling APIs, and run batch jobs with pay-per-second pricing. ## Core Features & Use Cases - Serverless GPU Execution: Run Python functions on T4, A10G, L40S, A100, H100, H200, or B200 GPUs with automatic scaling from zero to hundreds of containers. - Model API Deployment: Turn inference functions into FastAPI web endpoints with dynamic batching, concurrency controls, and zero-downtime updates. - Batch & Scheduled Jobs: Fan out parallel processing with .map(), or schedule recurring workloads with cron expressions. - Use Case: Deploy a text-generation model on an A10G GPU as a REST API that scales to zero when idle, loads the model once at container start with @modal.enter(), and caches weights in a persistent Volume. ## Quick Start Use the modal skill to deploy my text-generation inference function as a GPU-backed web endpoint on Modal.

Frequently Asked Questions about modal-serverless-gpu

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a Python function on a GPU with Modal?▼

Decorate a function with @app.function(gpu="T4") inside a modal.App, then execute it with modal run script.py. Modal provisions the GPU container on demand and returns the result from the .remote() call.

How to deploy an ML model as an API on Modal?▼

Define a class with @app.cls(gpu=..., image=...), load the model in an @modal.enter() hook, and expose methods with @modal.method() or attach @modal.fastapi_endpoint(). Run modal deploy script.py for a persistent HTTPS endpoint.

Which Modal GPU should I choose for inference vs training?▼

For inference, L40S (48GB) offers the best cost-performance, while T4 or A10G suit smaller models. For training large models, use A100-80GB or H100, and specify multiple GPUs like gpu="H100:4" for distributed workloads.

Modal vs RunPod vs SkyPilot for GPU workloads?▼

Modal fits serverless, scale-to-zero workloads defined in Python. RunPod suits longer-running pods with persistent state, Lambda Labs offers reserved instances, and SkyPilot handles multi-cloud orchestration and cost optimization.

Why are Modal cold starts slow and how do I fix them?▼

Cold starts include container launch and model loading. Mitigate by increasing container_idle_timeout, setting keep_warm=1, loading models in @modal.enter() hooks, and caching weights in a persistent Volume.

Why does my Modal volume lose written data?▼

Volume writes are not persisted until you call volume.commit() after writing files. Conversely, call volume.reload() in reader functions to fetch the latest committed state from other containers.