modal-serverless-gpu

Deploy and run ML workloads on Modal serverless GPU cloud infrastructure.

2|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/Shubh2310-developer/ENGUNITYCORE --skill modal-serverless-gpu-shubh2310-developer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modal-serverless-gpu
Source: https://github.com/Shubh2310-developer/ENGUNITYCORE/tree/main/.claude/skills/infrastructure-modal
Command: npx skills add https://github.com/Shubh2310-developer/ENGUNITYCORE --skill modal-serverless-gpu-shubh2310-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Running GPU-intensive ML workloads typically requires provisioning servers, managing CUDA environments, and paying for idle compute. This Skill provides guidance for deploying inference endpoints, training jobs, and batch processing on Modal's serverless GPU platform with pay-per-second pricing and automatic scaling. ## Core Features & Use Cases - GPU Workload Deployment: Run functions on T4, L4, A10G, L40S, A100, H100, H200, or B200 GPUs with Python-native configuration and no YAML. - Web Endpoints & APIs: Expose ML models as FastAPI endpoints, ASGI apps, or streaming services with dynamic batching and zero-downtime deployments. - Storage, Secrets & Scheduling: Persist models with Volumes, manage credentials with Secrets, and run cron-scheduled jobs. - Use Case: Deploy a text-generation model as an auto-scaling API by defining a Modal class with @modal.enter() for model loading, an A10G GPU, and a FastAPI endpoint, then run modal deploy for a production HTTPS endpoint. ## Quick Start Use the modal skill to deploy a 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 with a function or class specifying a GPU and container image, then attach @modal.fastapi_endpoint() or @modal.asgi_app() to expose it over HTTP. Run modal deploy script.py to get a persistent HTTPS endpoint with zero-downtime updates.

Which GPU should I choose for inference on Modal?

L40S with 48GB VRAM offers the best cost-to-performance ratio for inference workloads. T4 suits budget inference of small models, while A100-80GB and H100 are better for very large models or training.

Modal vs RunPod vs SkyPilot for GPU workloads?

Modal fits serverless, scale-to-zero workloads with pay-per-second billing and Python-defined infrastructure. RunPod suits longer-running pods with persistent state, while SkyPilot handles multi-cloud orchestration and cost optimization across providers.

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 @modal.enter() so initialization happens once at container start rather than per request. Caching models in a Volume also avoids repeated downloads.

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 enable flash attention to reduce memory consumption.

How do I persist model files between Modal runs?

Use modal.Volume.from_name with create_if_missing=True and mount it into your function. After writing files, call volume.commit() to persist changes, and call volume.reload() in readers to fetch the latest data.