modal-serverless-gpu

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

Updated Jun 7, 2026
One-click install
npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill modal-serverless-gpu-chensihakniroth
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: modal-serverless-gpu
Source: https://github.com/Chensihakniroth/ANAKOT-AGENT/tree/main/optional-skills/mlops/modal
Command: npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill modal-serverless-gpu-chensihakniroth

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 provides guidance for deploying models, running batch jobs, and scaling inference on Modal's serverless GPU platform without infrastructure management. ## Core Features & Use Cases - Serverless GPU Execution: Run functions on T4, A10G, L40S, A100, H100, and B200 GPUs with pay-per-second pricing and scale-to-zero behavior. - Model Deployment as APIs: Deploy ML models as auto-scaling FastAPI endpoints with dynamic batching, lifecycle hooks, and zero-downtime updates. - Batch and Scheduled Jobs: Fan out parallel processing with .map() and run cron-scheduled workloads with persistent volumes for model caching. - Use Case: Deploy a text-generation model on an A10G GPU as a REST endpoint that scales from zero to dozens of containers automatically during traffic spikes. ## Quick Start Use the modal skill to deploy my text generation model as a GPU-backed API 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 deploy an ML model as an API on Modal?▼

Define a modal.App, attach a function with a GPU and container image, then add the @modal.fastapi_endpoint or @modal.asgi_app decorator. Run modal deploy script.py to get a persistent HTTPS endpoint with automatic scaling.

Which GPU should I choose for inference on Modal?▼

L40S with 48GB VRAM offers the best cost-to-performance ratio for inference. T4 suits budget workloads with small models, while A100-80GB and H100 handle very large models requiring more memory.

Modal vs RunPod vs SkyPilot for GPU workloads?▼

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

How do I reduce cold start latency on Modal?▼

Increase container_idle_timeout to keep containers warm, use keep_warm=1 for always-ready instances, and load models inside an @modal.enter() lifecycle hook so initialization happens once at container start rather than per request.

Why is my Modal function getting CUDA out of memory errors?▼

CUDA OOM occurs when the model exceeds GPU VRAM. Switch to a larger GPU like A100-80GB, enable gradient checkpointing, use mixed precision with torch.autocast, or reduce batch sizes to fit within available memory.

How do I persist models between Modal function runs?▼

Use modal.Volume.from_name with create_if_missing=True and mount it into your function. Save models to the mounted path and call volume.commit() to persist changes, then volume.reload() to read the latest data.