serverless-modal

Runs GPU training, inference, and batch workloads on Modal serverless cloud.

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/Lingjie-wang/autoRL --skill serverless-modal-lingjie-wang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: serverless-modal
Source: https://github.com/Lingjie-wang/autoRL/tree/main/Auto-claude-code-research-in-sleep/skills/serverless-modal
Command: npx skills add https://github.com/Lingjie-wang/autoRL --skill serverless-modal-lingjie-wang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires modal.

What problem does it solve? Running GPU workloads like model training, fine-tuning, and inference typically requires SSH access, Docker setup, and manual instance management. This Skill generates and runs Modal launcher scripts so you can execute GPU jobs from your laptop with per-second billing and automatic scale-to-zero. ## Core Features & Use Cases - Cost Estimation Before Every Run: Calculates VRAM requirements from model size, selects the right GPU (T4 through B200), and presents a cost estimate for confirmation before execution. - Six Launcher Patterns: Generates Modal scripts for one-shot training, persistent web API inference, vLLM serving, batch parallel processing, LoRA fine-tuning, and multi-GPU distributed training. - Result Collection & Cleanup: Retrieves outputs from Modal Volumes or stdout and stops deployed apps, with no manual instance teardown since billing stops automatically. - Use Case: You need to benchmark a 7B model but have no local GPU. The Skill estimates that an H100 run costs about $0.98 for 15 minutes, generates the launcher script, runs it with modal run, and returns results locally. ## Quick Start Ask the assistant to run your training script on Modal with an A100 GPU and confirm the cost estimate before it executes.

Frequently Asked Questions about serverless-modal

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

FAQPage Schema
How do I run a training script on a remote GPU without SSH?

Use Modal by writing a Python launcher that wraps your training script in an @app.function decorator with a GPU parameter, then run `modal run launcher.py`. No SSH, Docker, or port forwarding is needed, and billing stops when the code finishes.

Which GPU should I choose for 7B model inference on Modal?

A 7-8B BF16 model needs about 22GB VRAM, so T4 (16GB) is insufficient; use L4, A10, or A100-40GB. For benchmarks, H100 is often cheaper overall because it is 11x faster than L4 but only 5x more expensive per hour.

How much does Modal GPU compute cost per hour?

Modal bills per second: T4 costs about $0.59/hr, A100-80GB about $2.50/hr, and H100 about $3.95/hr. The free tier provides $5/month without a card or $30/month with a card, and you can set a workspace spending limit.

Can I deploy a persistent inference API with Modal?

Yes, use @app.cls with @modal.enter() to load the model once per container and @modal.fastapi_endpoint to expose an HTTP endpoint, then run `modal deploy app.py`. For high-throughput serving, use the vLLM pattern with @modal.web_server.

When should I use vast.ai instead of Modal for GPU training?

For long training runs over 4 hours, vast.ai typically offers lower cost per GPU-hour than Modal. Modal is better for short to medium workloads where zero setup time and automatic scale-to-zero eliminate idle billing.