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.

Good fit 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.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/benchflow-ai/skillsbench/modal-gpu
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,941 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.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for modal-gpu

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.5 $0.00020 $0.00257
Sonnet 5.5 $0.00010 $0.00128
Haiku 4.5 $0.00005 $0.00064

Measured 3mo ago against content hash ba362fbddbfd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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. 3mo 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,941 stars, last pushed 6d ago), licensed Apache-2.0. It adds 51 tokens to every session and 642 once invoked, about $0.0002 per session on Opus 5.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

modal-gpu compared with skills from other repositories

modal-gpu next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
modal-gpubenchflow-ai/skillsbenchSkill1.9k6d agoApache-2.0A51Claude Code, Codex
tensorrt-llmNousResearch/hermes-agentSkill267ktodayMITA18Claude Code, Codex
agent-platform-tuninggoogle/skillsSkill25ktodayApache-2.0A64Claude Code, Codex
agent-platform-endpoint-managementgoogle/skillsSkill25ktodayApache-2.0A64Claude Code, Codex
infrastructure-skypilotdavila7/claude-code-templatesSkill34ktodayMITA47Claude Code, Codex
cdf-event-video-generationNVIDIA/skillsSkill4.2k2d agoApache-2.0A167Codex
nemo-automodel-launcher-configNVIDIA/skillsSkill4.2k2d agoApache-2.0A30Claude Code