Skip to content
alyn
benchflow-ai

Modal Gpu skill

Run Python code on cloud GPUs using Modal serverless platform. Use when you need A100/T4/A10G GPU access for training ML models. Covers Modal app setup, GPU selection, data downloading inside functions, and result handling.

$npx skills add benchflow-ai/skillsbench --skill modal-gpu
View this skill on GitHubbenchflow-ai/skillsbench/tasks-extra/diff-transformer_impl/environment/skills/modal-gpu/SKILL.md
Pack stars
1,914
Pack installs
159
Alyn Score
52/99
Updated
7 days ago
License
Apache-2.0
– views – installs via Alyn

benchflow-ai

Modal Gpu

Install Modal Gpu

Pick your agent. Every command is ready to paste.

$npx skills add benchflow-ai/skillsbench --skill modal-gpu

The open skills CLI detects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.

01

Install it

Run the command above, or upload the folder in Claude.

02

Ask naturally

Describe the task. Your agent loads modal-gpu when the request matches its description.

03

Name it if needed

If it does not trigger, say “use the modal-gpu skill”. In Codex, type $modal-gpu.

The skill itself

SKILL.md

FolderGitHub

Overview

Modal is a serverless platform for running Python code on cloud GPUs. It provides:

  • Serverless GPUs: On-demand access to T4, A10G, A100 GPUs
  • Container Images: Define dependencies declaratively with pip
  • Remote Execution: Run functions on cloud infrastructure
  • Result Handling: Return Python objects from remote functions

Two patterns:

  • Single Function: Simple script with @app.function decorator
  • Multi-Function: Complex workflows with multiple remote calls

Quick Reference

Topic Reference
Basic Structure Getting Started
GPU Options GPU Selection
Data Handling Data Download
Results & Outputs Results
Troubleshooting Common Issues

Installation

pip install modal
modal token set --token-id <id> --token-secret <secret>

Minimal Example

import modal

app = modal.App("my-training-app")

image = modal.Image.debian_slim(python_version="3.11").pip_install(
    "torch",
    "einops",
    "numpy",
)

@app.function(gpu="A100", image=image, timeout=3600)
def train():
    import torch
    device = torch.device("cuda")
    print(f"Using GPU: {torch.cuda.get_device_name(0)}")

    # Training code here
    return {"loss": 0.5}

@app.local_entrypoint()
def main():
    results = train.remote()
    print(results)

Common Imports

import modal
from modal import Image, App

# Inside remote function
import torch
import torch.nn as nn
from huggingface_hub import hf_hub_download

When to Use What

Scenario Approach
Quick GPU experiments gpu="T4" (16GB, cheapest)
Medium training jobs gpu="A10G" (24GB)
Large-scale training gpu="A100" (40/80GB, fastest)
Long-running jobs Set timeout=3600 or higher
Data from HuggingFace Download inside function with hf_hub_download
Return metrics Return dict from function

Running

# Run script
modal run train_modal.py

# Run in background
modal run --detach train_modal.py

External Resources

Tips for Modal Gpu

  • • Start a fresh session after installing so your agent picks up the new skill.
  • • It bundles reference files. The agent reads them only when needed, so they cost no context until then.
  • • It is part of a pack with 29 skills. Install only the ones you need with --skill to keep triggers precise.
  • • If two skills overlap, mention the one you want by name.

Questions about Modal Gpu

What does the Modal Gpu skill do?

Run Python code on cloud GPUs using Modal serverless platform. Use when you need A100/T4/A10G GPU access for training ML models. Covers Modal app setup, GPU selection, data downloading inside functions, and result handling.

How do I install Modal Gpu?

Run "npx skills add benchflow-ai/skillsbench --skill modal-gpu" in your project. The skills CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.

Does Modal Gpu work in Cursor and Codex?

Yes. Modal Gpu uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.

Is Modal Gpu free?

Modal Gpu is open source on GitHub under the Apache-2.0 license. It is free to install; check the license before commercial use.

Who made Modal Gpu?

Modal Gpu is published by benchflow-ai in the benchflow-ai/skillsbench repository, together with 28 other skills.

Similar skills. From other creators.