modal-gpu

modal-gpu is a skill for Claude Code, Codex from benchflow-ai/skillsbench. It costs 51 tokens per session (642 once invoked), scanned A, original, Apache-2.0.

A guide for running Python functions on cloud GPUs through Modal, a service that runs code on remote infrastructure. It covers setting up the app, choosing GPUs such as T4, A10G, or A100, installing dependencies, downloading data, and returning results.

In plain words
What is it for?
Use it to run model training or other GPU-based Python workloads, define their environment, select a GPU, fetch data inside remote functions, and collect outputs.
Why use it?
Training machine-learning models can require more GPU capacity than a local computer has. Running the function remotely avoids managing the GPU machine yourself.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

About the project

SkillsBench is a benchmark for measuring how effectively AI agents use modular skills—folders containing instructions, scripts, and resources—to complete specialized tasks. It helps researchers and developers evaluate both skill quality and agent behavior, including tasks that require combining multiple skills. The catalogue’s skills and instructions are evaluated as part of this workflow.

benchflow-ai/skillsbench · 1,747 stars · on GitHub · skillsbench.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/benchflow-ai/skillsbench/modal-gpu
Any agent
npx skills add benchflow-ai/skillsbench --skill modal-gpu
Clone the repo
git clone --depth 1 https://github.com/benchflow-ai/skillsbench

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for modal-gpu

README.md
[![agentmods](https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/modal-gpu.svg)](https://agentmods.dev/skills/benchflow-ai/skillsbench/modal-gpu)
Your own site
<a href="https://agentmods.dev/skills/benchflow-ai/skillsbench/modal-gpu"><img src="https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/modal-gpu.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 642 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.00642
Opus 5 $0.00026 $0.00321
Sonnet 5 $0.00010 $0.00128
Haiku 4.5 $0.00005 $0.00064

Measured 6d ago against content hash ba362fbddbfd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

modal-gpu scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

tasks-extra/diff-transformer_impl/environment/skills/modal-gpu/SKILL.md · 103 lines

How it starts

The opening of the file, as written. The whole thing — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Read the full file on GitHub · 103 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 103 lines · 51 tokens per session scan A ba362fbddbfd

Subscribe to this mod's changes

modal-gpu is a skill published in the GitHub repository benchflow-ai/skillsbench (1,747 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 51 tokens to every session and 642 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

tensorrt-llm

High-throughput LLM inference on NVIDIA GPUs.

NousResearch/hermes-agent · 18 tokens

agent-platform-endpoint-management

Manages Agent Platform serving endpoints. Use when you need to create, list, describe, update, or delete serving endpoints for model deployment on Agent Platform. Also use when troubleshooting endpoint permission, quota, or resource busy errors. Don't use for deploying models to endpoints or for running model…

google/skills · 64 tokens

gke-inference

Deploys and optimizes AI/ML inference workloads on GKE, using GPUs, TPUs, and model servers. Use when deploying GKE inference servers, configuring GKE GPU resources for inference, or deploying LLMs on GKE. Don't use for generic batch jobs or HPC task queues (use gke-batch-hpc instead).

google/skills · 74 tokens

skypilot-multi-cloud-orchestration

Multi-cloud orchestration for ML workloads with automatic cost optimization. Use when you need to run training or batch jobs across multiple clouds, leverage spot instances with auto-recovery, or optimize GPU costs across providers.

davila7/claude-code-templates · 51 tokens

hf-cloud-sagemaker-deployment-planner

Plan and coordinate the deployment of a model to Amazon SageMaker AI. Use this skill whenever the user wants to deploy, host, serve, or expose a model on SageMaker or AWS — including phrases like "deploy a model", "host this LLM on AWS", "serve this embedding model", "deploy a reranker", "deploy a text-to-image /…

huggingface/skills · 216 tokens

deepspeed

Expert guidance for distributed training with DeepSpeed - ZeRO optimization stages, pipeline parallelism, FP16/BF16/FP8, 1-bit Adam, sparse attention.

davila7/claude-code-templates · 38 tokens