modal-serverless-gpu

Deploy GPU-based machine learning workloads as serverless Python functions on Modal.

Updated May 5, 2026
One-click install
npx skills add https://github.com/Z43L/zeus-agent --skill modal-serverless-gpu-z43l
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modal-serverless-gpu
Source: https://github.com/Z43L/zeus-agent/tree/main/optional-skills/mlops/modal
Command: npx skills add https://github.com/Z43L/zeus-agent --skill modal-serverless-gpu-z43l

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Modal helps you run GPU-accelerated machine learning workloads without managing servers by providing serverless GPUs, scalable execution, and easy deployment.

Core Features & Use Cases

  • Serverless GPU compute: Run inference, fine-tuning, and batch jobs on-demand with automatic scaling to zero when idle.
  • Python-native infrastructure: Define apps, functions, containers, images, volumes, secrets, and scheduling directly in Python.
  • Production-ready deployment patterns: Publish ML inference as REST APIs and support performance techniques like container warm-ups, dynamic batching, and persistent model caching.

Use cases

  • Deploy a text generation or embedding model behind an HTTPS endpoint with fast autoscaling.
  • Run scheduled batch inference (cron-like workloads) for dataset processing and periodic evaluations.
  • Train or fine-tune models on GPUs while minimizing idle infrastructure costs.

Quick Start

Use the AI assistant to configure a Modal app that installs your ML dependencies into a Modal image, selects an appropriate GPU (e.g., T4 for quick prototypes or L40S/A10G for common inference), and exposes your model prediction as a Modal web endpoint.

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 a machine learning model as a serverless GPU API?

To deploy a serverless GPU API, you define a Modal app that configures a containerized image, selects a GPU like T4 or A10G, and exposes model inference through a FastAPI or ASGI web endpoint. This enables on-demand execution with automatic scaling to zero when idle.

What's the best way to run scheduled batch inference jobs on serverless GPUs?

Running scheduled batch inference on serverless GPUs involves configuring Modal functions with cron-like scheduling to process datasets or run periodic evaluations. This approach minimizes idle infrastructure costs by automatically scaling compute resources down to zero between scheduled executions.

Can I use FastAPI with Modal for ML deployment?

Yes, you can use FastAPI with Modal for ML deployment by applying ASGI endpoint decorators to your Python functions. This allows you to serve model predictions directly as REST APIs while Modal handles the underlying serverless GPU compute and autoscaling.

How do I keep model weights cached for serverless inference to reduce cold starts?

To keep model weights cached for serverless inference and reduce cold starts, you configure Modal volumes for persistent storage within your Python-native infrastructure. This allows container warm-ups and dynamic batching to maintain ready states across function invocations.

Which GPU should I select for my serverless ML workload?

You should select a GPU based on your workload requirements: choose a T4 for quick prototypes, or use L40S and A10G GPUs for common inference tasks. Modal allows explicit resource specification to match your specific machine learning compute needs.

Does serverless GPU compute support training and fine-tuning models?

Yes, serverless GPU compute supports training and fine-tuning models on-demand. By defining scalable Python functions within Modal, you can execute fine-tuning workloads while minimizing idle infrastructure costs through automatic scaling to zero when the process completes.