modal-serverless-gpu

modal-serverless-gpu is a skill for Claude Code, Codex from math-inc/OpenGauss. It costs 42 tokens per session (2,156 once invoked), scanned A, a copy of modal, MIT.

Guidance for running machine-learning jobs on Modal, a serverless cloud service that provides GPUs when needed. It covers model APIs, batch jobs, scheduled tasks, and automatic scaling.

In plain words
What is it for?
Deploying machine-learning models as APIs, running training or inference batches, processing data, scheduling jobs, and handling workloads that need GPUs only intermittently.
Why use it?
Managing GPU servers, containers, and capacity takes time, especially when workloads change. This approach lets jobs start on demand and scale without manually operating that infrastructure.

Skill for Claude CodeCodex

About the project

OpenGauss is a project-scoped Lean workflow orchestrator that gives coding agents a command-line interface for managing formal proof and formalization tasks. It is used with Lean projects to coordinate agents, tooling, backend sessions, and workflows supplied by lean4-skills. The catalogue add-ons operate these Gauss-native workflows.

math-inc/OpenGauss · 1,261 stars · on GitHub

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/math-inc/opengauss/modal
Any agent
npx skills add math-inc/OpenGauss --skill modal
Clone the repo
git clone --depth 1 https://github.com/math-inc/OpenGauss

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-serverless-gpu

README.md
[![agentmods](https://agentmods.dev/badge/skills/math-inc/opengauss/modal.svg)](https://agentmods.dev/skills/math-inc/opengauss/modal)
Your own site
<a href="https://agentmods.dev/skills/math-inc/opengauss/modal"><img src="https://agentmods.dev/badge/skills/math-inc/opengauss/modal.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,156 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin 89% copy Near-identical to another mod 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 $0.00042 $0.02156
Opus 5 $0.00021 $0.01078
Sonnet 5 $0.00008 $0.00431
Haiku 4.5 $0.00004 $0.00216

Measured 5d ago against content hash f6eef95210f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

modal-serverless-gpu scanned grade A with 1 finding 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 5d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

return subprocess.run(["nvidia-smi"], capture_output=True, text=True).stdout
Origin

This is a copy

89% identical to modal — 35 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/mlops/cloud/modal/SKILL.md · 345 lines

How it starts

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

Comprehensive guide to running ML workloads on Modal's serverless GPU cloud platform.

When to use Modal

Use Modal when:

  • Running GPU-intensive ML workloads without managing infrastructure
  • Deploying ML models as auto-scaling APIs
  • Running batch processing jobs (training, inference, data processing)
  • Need pay-per-second GPU pricing without idle costs
  • Prototyping ML applications quickly
  • Running scheduled jobs (cron-like workloads)

Key features:

  • Serverless GPUs: T4, L4, A10G, L40S, A100, H100, H200, B200 on-demand
  • Python-native: Define infrastructure in Python code, no YAML
  • Auto-scaling: Scale to zero, scale to 100+ GPUs instantly
  • Sub-second cold starts: Rust-based infrastructure for fast container launches
  • Container caching: Image layers cached for rapid iteration
  • Web endpoints: Deploy functions as REST APIs with zero-downtime updates

Use alternatives instead:

  • RunPod: For longer-running pods with persistent state
  • Lambda Labs: For reserved GPU instances
  • SkyPilot: For multi-cloud orchestration and cost optimization
  • Kubernetes: For complex multi-service architectures

Quick start

Installation

pip install modal
modal setup  # Opens browser for authentication

Hello World with GPU

import modal

app = modal.App("hello-gpu")

@app.function(gpu="T4")
def gpu_info():
    import subprocess
    return subprocess.run(["nvidia-smi"], capture_output=True, text=True).stdout

@app.local_entrypoint()
def main():
    print(gpu_info.remote())

Run: modal run hello_gpu.py

Basic inference endpoint

import modal

app = modal.App("text-generation")
image = modal.Image.debian_slim().pip_install("transformers", "torch", "accelerate")

@app.cls(gpu="A10G", image=image)
class TextGenerator:
    @modal.enter()
    def load_model(self):
        from transformers import pipeline
        self.pipe = pipeline("text-generation", model="gpt2", device=0)

    @modal.method()
    def generate(self, prompt: str) -> str:
        return self.pipe(prompt, max_length=100)[0]["generated_text"]

@app.local_entrypoint()
def main():
    print(TextGenerator().generate.remote("Hello, world"))

Read the full file on GitHub · 345 lines

Files

What ships with it

2 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. 5d ago First seen · 345 lines · 42 tokens per session scan A f6eef95210f3

Subscribe to this mod's changes

modal-serverless-gpu is a skill published in the GitHub repository math-inc/OpenGauss (1,261 stars, last pushed 5mo ago), licensed MIT. It adds 42 tokens to every session and 2,156 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). It is 89% identical to modal, differing in 35 lines, and is treated as a copy.

Related

Other skills, from other repositories

agent-platform-tuning

Agent Platform Model Tuning. Use when you need to fine-tune open models or Gemini models using Agent Platform infrastructure. Don't use for model training outside Agent Platform, model deployment to endpoints (use agent-platform-deploy), or managing serving endpoints (use agent-platform-endpoint-management).

google/skills · 64 tokens

application-design-center-design-deploy

Processes GCP infrastructure design and deployment workflows within Application Design Center (ADC). Use when: - Designing GCP infrastructure with Terraform. - Validating local HCL. - Performing best-practice plan scans. - Importing templates to Application Design Center (ADC). - Deploying templates. - Troubleshooting…

google/skills · 94 tokens

interactive-login

How to complete browser/interactive logins (aws / gh / glab / gcloud). The platform backgrounds the login poller so it survives the human's browser round-trip — and when that does NOT work.

yc-software/qm · 46 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

cloud-architect

Designs cloud architectures, creates migration plans, generates cost optimization recommendations, and produces disaster recovery strategies across AWS, Azure, and GCP. Use when designing cloud architectures, planning migrations, or optimizing multi-cloud deployments. Invoke for Well-Architected Framework, cost…

Jeffallan/claude-skills · 71 tokens

azmon-mirroredcatalogs-operations-cli

Brings Azure Monitor, Application Insights, and Log Analytics telemetry into Fabric as Eventhouse external delta tables and correlates it with business data. Use to onboard observability data, judge whether latency or availability affected revenue, or build a Real-Time dashboard and Operations Agent over it.

microsoft/skills-for-fabric · 66 tokens