neoanthropocene/agents-united/modal-serverless-python

Claude Code and agent skill by neoanthropocene/agents-united

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Serverless Python applications, GPU function definitions (A10G,

Install

npx vskill@latest install neoanthropocene/agents-united/modal-serverless-python

SKILL.md

The same SKILL.md was published earlier as neoanthropocene/agents-united/modal-serverless-python.

Modal Serverless Python Playbook

Overview & Purpose

modal-serverless-python provides production best practices for authoring, deploying, and optimizing serverless Python AI workloads on Modal.com with hardware-accelerated GPU infrastructure and cold-start mitigations.

When to Trigger

Trigger this skill whenever:

  • Designing serverless GPU inference functions (LLMs, Diffusion models, Whisper transcription).
  • Building fine-tuning or embedding generation pipelines requiring on-demand GPU clusters.
  • Optimizing Python container cold-start latency and GPU memory management.
  • Mounting persistent storage volumes for large machine learning model checkpoints.

Input & Output Requirements

  • Inputs: Model identifier (Hugging Face ID or local weights path), target GPU tier (T4, A10G, A100, H100), concurrency parameters, and environment secrets.
  • Outputs: Fully functional Modal Python scripts (modal.App), persistent volume definitions, deployment runbooks, and endpoint latency benchmarks.

Step-by-Step Execution Runbook

Phase 1 — Environment & Image Scaffolding
  • Define container images with minimal base layers and pinned PyTorch/CUDA wheels.
  • Pre-download model weights into container image layers using image.run_function().
Phase 2 — GPU Function & Lifecycle Declaration
  • Decorate class-based functions with @app.cls(gpu="A10G", container_idle_timeout=60).
  • Load weights into GPU VRAM once during container startup with @modal.enter().
Phase 3 — Verification & Scale Testing
  • Execute test invocations using modal run before deploying production web endpoints (modal deploy).

Edge Cases & Boundary Conditions

  • CUDA Out of Memory (OOM): Handle batch sizes dynamically based on available VRAM limits; fall back to gradient checkpointing or 4-bit quantization (bitsandbytes).
  • Cold-Start Spikes: Utilize warm pools and flash-attention container optimizations to keep cold start < 8s.
  • Network Timeouts on Large Weight Downloads: Split weight shards across persistent Modal Volumes.

Error Recovery & Fallbacks

  • If GPU capacity is unavailable in the primary region, configure fallback GPU selections (e.g. gpu=["A10G", "A100"]).
  • When secret loading fails, verify authentication with modal secret list and surface missing secret keys.

Code Exemplars & Patterns

python
import modal
app = modal.App("vllm-inference-service")
vllm_image = (
modal.Image.debian_slim(python_version="3.11")
.pip_install("vllm==0.6.3", "torch==2.4.0", "transformers")
)
@app.cls(
image=vllm_image,
gpu="A10G",
scaledown_window=60,
timeout=300,
)
class ModelServer:
@modal.enter()
def load_model(self):
from vllm import LLM
self.llm = LLM(model="meta-llama/Llama-3.1-8B-Instruct")
@modal.method()
def generate(self, prompt: str) -> str:
from vllm import SamplingParams
sampling_params = SamplingParams(temperature=0.7, max_tokens=512)
outputs = self.llm.generate([prompt], sampling_params)
return outputs[0].outputs[0].text

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/neoanthropocene/agents-united/modal-serverless-python/badge)](https://verified-skill.com/skills/neoanthropocene/agents-united/modal-serverless-python)

Something wrong with this skill or its page? Tell us.