modal

Deploy Python functions and GPU workloads to Modal serverless cloud infrastructure.

Updated Oct 7, 2022
One-click install
npx skills add https://github.com/tamagusko/linux-cfg --skill modal-tamagusko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modal
Source: https://github.com/tamagusko/linux-cfg/tree/main/dotfiles/claude/skills/modal
Command: npx skills add https://github.com/tamagusko/linux-cfg --skill modal-tamagusko

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Running AI/ML workloads on cloud GPUs typically requires managing servers, Dockerfiles, and infrastructure configuration. This Skill provides the knowledge to deploy Python code to Modal's serverless platform, where functions, GPUs, storage, and web endpoints are defined entirely in Python code. ## Core Features & Use Cases - GPU Compute on Demand: Request T4, L40S, A100, H100, H200, or B200 GPUs with a single decorator parameter for training and inference workloads. - Serverless Functions and Web Endpoints: Deploy autoscaling functions, FastAPI/ASGI/WSGI endpoints, and scheduled cron jobs with modal deploy. - Persistent Storage and Secrets: Use Volumes for model weights and datasets, and Secrets for secure credential injection. - Use Case: Serve a 70B LLM as a production API by defining a class with @modal.enter() to load vLLM once on an H100, then expose it via @modal.fastapi_endpoint() with autoscaling containers. ## Quick Start Ask the assistant to write and deploy a Modal app that runs a Python function on a cloud GPU, such as serving an LLM inference endpoint on an H100.

Frequently Asked Questions about modal

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

FAQPage Schema
How do I run Python code on a cloud GPU with Modal?

Install the modal package, authenticate with modal setup, then decorate a function with @app.function(gpu="H100") and call it with .remote(). Modal builds the container and executes the function on the requested GPU in the cloud.

How do I deploy a machine learning model as a web endpoint?

Define a class with @app.cls() that loads the model in @modal.enter(), then expose it with @modal.fastapi_endpoint() or @modal.asgi_app(). Run modal deploy script.py to get a permanent production URL with autoscaling.

Which GPU should I choose for LLM inference on Modal?

L40S is recommended for inference due to its cost-performance balance and 48 GB VRAM. Models above 70B parameters typically need A100-80GB, H100, or multi-GPU configurations like H100:2.

Does Modal support scheduled or cron jobs?

Yes, Modal supports scheduled functions via modal.Cron("0 9 * * *") for cron syntax or modal.Period(hours=6) for fixed intervals. Schedules activate only after running modal deploy, not modal run or modal serve.

How do I store model weights persistently in Modal?

Use modal.Volume.from_name("model-weights", create_if_missing=True) and mount it via the volumes parameter. Volumes persist across deployments, support CLI upload with modal volume put, and auto-commit writes in the background.

What are the limits of Modal autoscaling and concurrency?

Modal allows up to 25,000 total inputs, 1,000 concurrent inputs per .map() call, and 200 requests per second on web endpoints. Configure max_containers, min_containers, and @modal.concurrent(max_inputs=N) to control scaling behavior.