[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XFMR277RA0ZPHM4GAE920Z":3,"skill-same:01M6XFMR277RA0ZPHM4GAE920Z":98},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":64,"commitSha":65,"skillDirectory":66,"forksCount":14,"repositoryHtmlUrl":67,"repositoryHomepageUrl":6,"ownerHtmlUrl":68,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":69,"install":70,"resources":83},"01M6XFMR277RA0ZPHM4GAE920Z","modal-serverless-gpu",null,"Serverless GPU cloud platform for ML workloads — inference serving, batch processing, training, web endpoints, sandboxes, and scheduled jobs. Use when you need on-demand GPUs without infrastructure management, deploying models as auto-scaling APIs, running batch jobs, or executing untrusted code in sandboxes.","fadrienne\u002FMyGitHub","fadrienne","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F197874571?v=4","01M6X64V8VWCRSMFZ4EPS2BWXG","Francesca Adrienne","01M6X64VD5MW4F9PHDWQKS7ZAF",0,"MIT","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fopenscience\u002Fbackend\u002Fcli\u002Fskills\u002Fcloud-compute\u002Fmodal\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"gpu","modal","serverless","modal serverless gpu","scaling","Web Endpoints","running","when","scheduled","you","infrastructure management","Auto-Scaling","processing","synthetic","infrastructure","auto","Inference Serving","batch","code","training","2026-11-10 10:12:30",false,"---\nname: modal-serverless-gpu\ndescription: Serverless GPU cloud platform for ML workloads — inference serving, batch processing, training, web endpoints, sandboxes, and scheduled jobs. Use when you need on-demand GPUs without infrastructure management, deploying models as auto-scaling APIs, running batch jobs, or executing untrusted code in sandboxes.\ncategory: cloud-compute\nversion: 2.0.0\nauthor: Synthetic Sciences\nlicense: MIT\ntags: [Infrastructure, Serverless, GPU, Cloud, Deployment, Modal, Inference, Training, Sandboxes, Web Endpoints]\ndependencies: [modal>=0.73.0]\n---\n\n# Modal Serverless GPU\n\nModal is a serverless GPU cloud platform. Everything is Python code — no YAML, no Docker, no Kubernetes. Pay per second, scale to zero, scale to hundreds of GPUs instantly.\n\nThis skill provides the decision framework, GPU guide, API reference, and a catalog of 50+ production-ready examples from Modal's official library. For detailed implementations, refer to the example catalog and reference docs below.\n\n## When to Use Modal\n\n**Modal is the RIGHT choice for:**\n\n| Workload | Why Modal |\n|----------|-----------|\n| **Inference serving** | Auto-scaling endpoints, zero-downtime deploys, sub-second cold starts |\n| **Batch processing** | Fan out to 100+ GPUs with `.map()`, pay only for compute time |\n| **Web endpoints \u002F APIs** | FastAPI\u002FASGI\u002FWSGI support, custom domains, streaming |\n| **Sandbox execution** | Run untrusted code safely, build coding agents, code interpreters |\n| **Scheduled jobs** | Cron\u002Fperiodic with `modal.Cron` and `modal.Period` |\n| **Full-parameter training** | Multi-GPU (up to 8), multi-node clusters (beta) |\n| **Custom architectures** | Full control over container images, any framework |\n| **Data pipelines** | Parallel processing, S3 mounts, Volume storage |\n\n**Use alternatives instead:**\n\n| Need | Use Instead |\n|------|-------------|\n| Managed LoRA fine-tuning (no infra) | **Tinker** |\n| Hosted RL \u002F agentic post-training | **Prime Intellect Lab** |\n| Reserved dedicated instances | **Lambda Labs** |\n| Multi-cloud cost optimization | **SkyPilot** |\n| Long-running persistent pods | **RunPod** |\n| Scientific GPU computing (simulations, MD, Monte Carlo) | **modal-research-gpu** |\n\n## Credential Setup (openscience)\n\nCredentials are auto-injected via OpenScience. Verify before running Modal workloads:\n\n```bash\n# Check credentials are set (NEVER echo the actual values)\n[ -n \"$MODAL_TOKEN_ID\" ] && echo \"MODAL_TOKEN_ID set\" || echo \"NOT SET\"\n[ -n \"$MODAL_TOKEN_SECRET\" ] && echo \"MODAL_TOKEN_SECRET set\" || echo \"NOT SET\"\n```\n\n**IMPORTANT**: Always rely on `MODAL_TOKEN_ID`\u002F`MODAL_TOKEN_SECRET` env vars. Do NOT read from `~\u002F.modal.toml`.\n\nIf Modal CLI isn't installed: `pip install modal` (no `modal setup` needed — env vars handle auth).\n\n## Quick Reference\n\n| Topic | Reference |\n|-------|-----------|\n| Example Catalog (50+ examples) | [Examples Catalog](references\u002Fexamples-catalog.md) |\n| Advanced Patterns & openscience Integration | [Advanced Patterns](references\u002Fadvanced-patterns.md) |\n| Troubleshooting | [Troubleshooting](references\u002Ftroubleshooting.md) |\n\n## Execution Modes\n\n| Command | When to Use |\n|---------|-------------|\n| `modal run script.py` | Quick jobs that complete in minutes |\n| `modal serve script.py` | Development: live reload on code changes, test endpoints locally |\n| `modal deploy script.py` | Production: persistent endpoints, scheduled jobs, always-on services |\n| `modal deploy` + `Function.lookup().spawn()` | **Long-running training (disconnect-safe)** |\n\n### CRITICAL: Long-Running Training Must Be Disconnect-Safe\n\n**NEVER use `.spawn()` or `.remote()` from `@app.local_entrypoint()` for training runs that take more than a few minutes.** If the local process dies (laptop battery, closed terminal, SSH disconnect), Modal tears down the app context and kills the spawned function.\n\n**The disconnect-safe pattern:**\n\n```python\n# train.py — Step 1: Define your training function\nimport modal\n\napp = modal.App(\"my-training\")\nvolume = modal.Volume.from_name(\"training-data\", create_if_missing=True)\nimage = modal.Image.debian_slim(python_version=\"3.11\").uv_pip_install(\"torch\", \"transformers\")\n\n@app.function(gpu=\"H100\", image=image, volumes={\"\u002Fdata\": volume}, timeout=86400)\ndef train():\n    # Your training code here — runs entirely in Modal's cloud\n    ...\n    volume.commit()  # Save checkpoints\n```\n\n```bash\n# Step 2: Deploy the app (persists independently of your machine)\nmodal deploy train.py\n\n# Step 3: Trigger training (fire-and-forget, survives local disconnect)\npython -c \"import modal; modal.Function.lookup('my-training', 'train').spawn()\"\n\n# Step 4: Monitor from anywhere (even a different machine)\nmodal app logs my-training\n```\n\nThis pattern ensures training runs are completely decoupled from your local machine. The function runs on Modal's infrastructure and persists even if you close your laptop, lose internet, or reboot.\n\n## GPU Selection Guide\n\n| GPU | VRAM | $\u002Fhr (approx) | Best For |\n|-----|------|----------------|----------|\n| `T4` | 16GB | ~$0.59 | Budget inference, small models (\u003C7B quantized) |\n| `L4` | 24GB | ~$0.73 | Inference, Ada Lovelace architecture |\n| `A10G` | 24GB | ~$1.10 | Training\u002Finference, 3.3x faster than T4 |\n| `L40S` | 48GB | ~$1.65 | **Best cost\u002Fperf for inference** (7B-13B FP16) |\n| `A100-40GB` | 40GB | ~$3.15 | Large model training |\n| `A100-80GB` | 80GB | ~$4.05 | Very large models, DeepSpeed |\n| `H100` | 80GB | ~$4.25 | Fastest training, FP8 + Transformer Engine |\n| `H200` | 141GB | ~$4.95 | Largest VRAM, 4.8TB\u002Fs bandwidth |\n| `B200` | 192GB | Latest | Blackwell architecture, newest |\n\n**GPU specification patterns:**\n```python\n@app.function(gpu=\"A100\")           # Single GPU\n@app.function(gpu=\"A100-80GB\")      # Specific memory variant\n@app.function(gpu=\"H100:4\")         # Multi-GPU (up to 8)\n@app.function(gpu=[\"H100\", \"A100\"]) # Fallback chain (try in order)\n@app.function(gpu=\"any\")            # Any available GPU\n```\n\n**Recommendations by task:**\n\n| Task | GPU | Config |\n|------|-----|--------|\n| Serve 7B model (FP16) | `L40S` or `A10G` | Single GPU |\n| Serve 70B model (AWQ\u002FGPTQ) | `A100-80GB` or `H100` | Single GPU |\n| Serve 70B model (FP16) | `H100:4` or `A100-80GB:4` | Multi-GPU |\n| LoRA fine-tune 7B | `A100-40GB` | Single GPU |\n| Full fine-tune 7B | `A100-80GB:4` | Multi-GPU |\n| Full fine-tune 70B | `H100:8` or multi-node | Multi-GPU\u002Fnode |\n| Batch inference | `L40S` or `A100` | `.map()` fan-out |\n| Embedding generation | `T4` or `L4` | `.map()` fan-out |\n\n## Core API Quick Reference\n\n### Key Classes\n\n| Class | Purpose | Key Methods |\n|-------|---------|-------------|\n| `modal.App` | Container for functions\u002Fresources | `.function()`, `.cls()`, `.local_entrypoint()` |\n| `modal.Image` | Container image definition | `.debian_slim()`, `.uv_pip_install()`, `.pip_install()`, `.from_registry()`, `.add_local_dir()`, `.run_commands()`, `.env()` |\n| `modal.Volume` | Persistent distributed filesystem (2.5 GB\u002Fs) | `.from_name()`, `.commit()`, `.reload()` |\n| `modal.Secret` | Secure credential injection | `.from_name()`, `.from_dict()`, `.from_dotenv()` |\n| `modal.Dict` | Distributed key-value store | `.from_name()`, `.put()`, `.get()`, `.pop()` |\n| `modal.Queue` | Distributed FIFO queue | `.from_name()`, `.put()`, `.get()` |\n| `modal.Sandbox` | Isolated code execution container | `.create()`, `.exec()`, `.terminate()`, snapshot support |\n| `modal.Cls` | Class-based serverless functions | Used via `@app.cls()` decorator |\n| `modal.Function` | Serverless function handle | `.remote()`, `.local()`, `.map()`, `.starmap()`, `.lookup()` |\n| `modal.CloudBucketMount` | Mount S3\u002FGCS buckets as filesystem | Direct bucket access |\n| `modal.Tunnel` | Network tunnel to containers | SSH, HTTP access |\n| `modal.Proxy` | Network proxy (beta) | Custom networking |\n\n### Key Decorators\n\n| Decorator | Purpose |\n|-----------|---------|\n| `@app.function()` | Define a serverless function |\n| `@app.cls()` | Define a serverless class |\n| `@modal.method()` | Mark class method as remotely callable |\n| `@modal.enter()` | Run once at container startup (model loading) |\n| `@modal.exit()` | Run at container shutdown (cleanup) |\n| `@modal.parameter()` | Typed class parameter |\n| `@modal.fastapi_endpoint()` | Expose function as FastAPI endpoint |\n| `@modal.asgi_app()` | Expose full ASGI app (FastAPI\u002FStarlette) |\n| `@modal.wsgi_app()` | Expose WSGI app (Django\u002FFlask) |\n| `@modal.web_server(port)` | Expose arbitrary HTTP server |\n| `@modal.batched()` | Dynamic input batching |\n| `@modal.concurrent()` | Input concurrency control |\n\n### Scheduling\n\n| Type | Syntax |\n|------|--------|\n| Cron | `schedule=modal.Cron(\"0 0 * * *\")` (always UTC) |\n| Periodic | `schedule=modal.Period(hours=1)` |\n\n## Essential Patterns\n\n### Pattern 1: Model Inference Service\n\n```python\nimport modal\n\napp = modal.App(\"inference\")\nimage = modal.Image.debian_slim(python_version=\"3.11\").uv_pip_install(\n    \"torch\", \"transformers\", \"accelerate\"\n)\nvolume = modal.Volume.from_name(\"model-cache\", create_if_missing=True)\n\n@app.cls(gpu=\"L40S\", image=image, volumes={\"\u002Fmodels\": volume},\n         container_idle_timeout=300)\nclass InferenceService:\n    @modal.enter()\n    def load(self):\n        from transformers import pipeline\n        self.pipe = pipeline(\"text-generation\", model=\"\u002Fmodels\u002Fmy-model\", device=0)\n\n    @modal.method()\n    def generate(self, prompt: str) -> str:\n        return self.pipe(prompt, max_length=512)[0][\"generated_text\"]\n```\n\n### Pattern 2: vLLM Deployment (see Modal example: `llm_inference`)\n\n```python\nimport modal\n\napp = modal.App(\"vllm-server\")\nimage = modal.Image.debian_slim(python_version=\"3.11\").uv_pip_install(\"vllm\")\nvolume = modal.Volume.from_name(\"model-weights\", create_if_missing=True)\n\n@app.function(gpu=\"H100\", image=image, volumes={\"\u002Fmodels\": volume},\n              container_idle_timeout=600, timeout=3600)\n@modal.asgi_app()\ndef serve():\n    # See Modal example `llm_inference` for the full implementation\n    ...\n```\n\n### Pattern 3: Batch Processing with Fan-Out\n\n```python\n@app.function(gpu=\"T4\")\ndef process_item(item):\n    return expensive_computation(item)\n\n@app.local_entrypoint()\ndef main():\n    items = list(range(10000))\n    results = list(process_item.map(items))  # Fan out to parallel GPUs\n```\n\n### Pattern 4: Container Image (use uv for speed)\n\n```python\n# Prefer uv_pip_install — 10-50x faster than pip_install\nimage = (\n    modal.Image.debian_slim(python_version=\"3.11\")\n    .uv_pip_install(\"torch\", \"transformers\", \"accelerate\", \"vllm\")\n    .add_local_dir(\".\u002Fsrc\", \"\u002Fapp\u002Fsrc\")  # Add local code\n    .env({\"HF_HOME\": \"\u002Fmodels\"})          # Set env vars\n)\n```\n\n### Pattern 5: Sandbox (Code Execution)\n\n```python\nsandbox = modal.Sandbox.create(app=app, image=image, gpu=\"T4\", timeout=300)\nprocess = sandbox.exec(\"python\", \"-c\", \"print('Hello from sandbox')\")\nprint(process.stdout.read())\nsandbox.terminate()\n```\n\n## Example Catalog (Quick Lookup)\n\nModal's official example library contains production-ready implementations. Find the right example for your task below, then refer to [Examples Catalog](references\u002Fexamples-catalog.md) for expanded descriptions and implementation notes.\n\n### LLM Inference & Serving\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `llm_inference` | Deploy OpenAI-compatible LLM service | vLLM, H100, streaming, OpenAI API |\n| `very_large_models` | Deploy really big LLMs (DeepSeek V3, Kimi-K2) | SGLang, multi-GPU (H200:4-8), 100B+ params |\n| `ministral3_inference` | 10x cold start reduction with snapshots | Memory snapshots, fast startup |\n| `vllm_throughput` | Optimize tokens\u002Fsec batch processing | vLLM, ~30K input tok\u002Fs per H100 |\n| `sglang_low_latency` | Low-latency inference with SGLang | SGLang, speculative decoding, EAGLE-3 |\n| `llama_cpp` | Run GGUF models with llama.cpp | CPU\u002FGPU inference, quantized models |\n| `trtllm_latency` | Low-latency with TensorRT-LLM | TensorRT optimization |\n| `trtllm_throughput` | High-throughput with TensorRT-LLM | Batch TensorRT inference |\n\n### Training & Fine-Tuning\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `grpo_verl` | GRPO math training with verl | RL training, math reasoning |\n| `grpo_trl` | GRPO coding training with TRL | RL training, code generation |\n| `unsloth_finetune` | Efficient fine-tuning with Unsloth | LoRA, 2x speed, memory efficient |\n| `hp_sweep_gpt` | Train SLM with hyperparameter search | Grid search, early stopping |\n| `long-training` | Long, resumable training jobs | Checkpointing, Volume, resume |\n| `llm-finetuning` | Full LLM fine-tuning pipeline | End-to-end training |\n| `flan_t5_finetune` | Fine-tune Flan-T5 | Seq2seq fine-tuning |\n| `diffusers_lora_finetune` | Fine-tune Flux with LoRA | Image generation LoRA |\n\n### Multimodal & Vision\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `flux` | Serve diffusion models with torch.compile | Image generation, compilation |\n| `text_to_image` | Stable Diffusion CLI\u002FAPI\u002FUI | Text-to-image, Gradio |\n| `image_to_image` | Edit images with Flux Kontext | Image-to-image |\n| `image_to_video` | Bring images to life with LTX-Video | Video generation |\n| `ltx` | Generate video with LTX-Video | Text-to-video |\n| `finetune_yolo` | Fine-tune & serve YOLO | Object detection |\n| `segment_anything` | Segment Anything Model | Image segmentation |\n| `comfyapp` | Run Flux on ComfyUI as API | ComfyUI, workflow API |\n| `blender_video` | 3D render farm with Blender | 3D rendering, parallelism |\n\n### Audio & Speech\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `llm-voice-chat` | Voice chat with LLMs | Real-time voice, WebSocket |\n| `streaming_kyutai_stt` | Transcribe speech with Kyutai STT | Streaming STT, low latency |\n| `music-video-gen` | Star in custom music videos | Multi-model pipeline |\n| `generate_music` | Make music with ACE-Step | Music generation |\n| `chatterbox_tts` | Generate speech with Chatterbox | TTS |\n| `batched_whisper` | High-throughput Whisper transcription | Batch ASR, Whisper |\n| `fine_tune_asr` | Fine-tune Whisper for new words | ASR fine-tuning |\n\n### Sandboxes & Code Execution\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `agent` | Sandbox a LangGraph agent's code | LangGraph, secure GPU sandbox |\n| `coding_agent` | Run a background coding agent | Coding agent, sandbox |\n| `modal-vibe` | Deploy vibe coding at scale | React + LLM + Sandboxes |\n| `safe_code_execution` | Run Node.js, Ruby, and more in sandbox | Multi-language, sandbox |\n| `simple_code_interpreter` | Stateful code interpreter | Jupyter-like, sandbox |\n| `jupyter_sandbox` | Sandboxed Jupyter notebook | Jupyter, sandbox |\n| `anthropic_computer_use` | Control computer with LLM | Computer use, sandbox |\n\n### RAG & Embeddings\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `chat_with_pdf_vision` | RAG Chat with PDFs | PDF Q&A, vision |\n| `amazon_embeddings` | Embed millions of docs with TEI | High-throughput embeddings |\n| `mongodb-search` | Satellite images to vectors + MongoDB | Image embeddings, geo search |\n| `potus_speech_qanda` | RAG Q&A chatbot with OpenAI | RAG, OpenAI |\n\n### Web Apps & Endpoints\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `basic_web` | Serving web endpoints | FastAPI, ASGI |\n| `serve_streamlit` | Deploy Streamlit apps | Streamlit |\n| `mcp_server_stateless` | Deploy stateless MCP with FastMCP | MCP, tool serving |\n| `webrtc_yolo` | Serverless WebRTC with YOLO | WebRTC, real-time |\n| `fastrtc_flip_webcam` | WebRTC quickstart with FastRTC | FastRTC |\n| `webscraper` | Simple web scraper | Scraping, parallelism |\n\n### Data & Infrastructure\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `s3_bucket_mount` | Parallel Parquet processing on S3 | CloudBucketMount, S3 |\n| `cloud_bucket_mount_loras` | LoRA playground with S3 + Gradio | LoRA management, S3 |\n| `dbt_duckdb` | Data warehouse with DuckDB + DBT | Analytics, data warehouse |\n| `doc_ocr_jobs` | Document OCR job queue | Job queue, OCR |\n| `doc_ocr_webapp` | Document OCR web app | Web app, OCR |\n| `hackernews_alerts` | Hacker News Slackbot | Scheduled jobs, Slack |\n| `discord_bot` | Deploy a Discord bot | Discord, bot |\n| `db_to_sheet` | Sync DB to Google Sheets | Google Sheets, ETL |\n| `cron_datasette` | Publish data with SQLite + Datasette | Data exploration |\n| `algolia_indexer` | Build docsearch with Algolia | Documentation search |\n\n### Computational Biology\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `chai1` | Fold proteins with Chai-1 | Protein folding |\n| `boltz_predict` | Fold proteins with Boltz-2 | Protein structure |\n| `esm3` | ESM3 protein model | Protein language model |\n\n## Common Configuration Reference\n\n```python\n@app.function(\n    gpu=\"A100\",                        # GPU type (see selection guide)\n    memory=32768,                      # RAM in MB\n    cpu=4,                             # CPU cores\n    timeout=3600,                      # Max execution time (seconds)\n    container_idle_timeout=120,        # Keep container warm (seconds)\n    retries=modal.Retries(max_retries=3, backoff_coefficient=2.0),\n    concurrency_limit=10,              # Max concurrent containers\n    allow_concurrent_inputs=20,        # Requests per container\n    keep_warm=1,                       # Min warm containers (costs money)\n    volumes={\"\u002Fdata\": volume},         # Mount volumes\n    secrets=[modal.Secret.from_name(\"my-secret\")],\n    image=image,                       # Custom container image\n    schedule=modal.Cron(\"0 0 * * *\"), # Cron schedule (UTC)\n)\ndef my_function():\n    pass\n```\n\n## Common Issues Quick-Fix\n\n| Issue | Fix |\n|-------|-----|\n| **Training dies when laptop closes** | **NEVER use `.spawn()`\u002F`.remote()` from `local_entrypoint()` for long jobs. Use `modal deploy` + `Function.lookup().spawn()` pattern (see Execution Modes above)** |\n| Cold start slow | Use `@modal.enter()` for model loading, increase `container_idle_timeout`, use memory snapshots |\n| GPU OOM | Use larger GPU, enable gradient checkpointing, use mixed precision (bf16) |\n| Image build fails | Pin versions, use `uv_pip_install`, use multi-stage builds |\n| Timeout errors | Increase `timeout`, add checkpointing for long jobs |\n| Volume changes lost | Call `volume.commit()` after writes |\n| Stale volume data | Call `volume.reload()` before reads |\n| Cron not firing | Cron is always UTC, must `modal deploy` (not `modal run`) |\n| 502 on endpoint | Increase timeout, check memory, use streaming for long responses |\n| Credentials fail | Verify `MODAL_TOKEN_ID`\u002F`MODAL_TOKEN_SECRET` env vars are set |\n\n## Implementation Workflow\n\nWhen implementing a Modal workload:\n1. Check the example catalog above to find the closest matching example\n2. Load the [Examples Catalog](references\u002Fexamples-catalog.md) for expanded implementation notes\n3. Refer to Modal's docs at https:\u002F\u002Fmodal.com\u002Fdocs\u002Fexamples for full source code\n4. Adapt for your use case using openscience credentials (`MODAL_TOKEN_ID`\u002F`MODAL_TOKEN_SECRET`)\n5. After job completes, report usage via `OpenScience.reportUsage()` with `service=\"modal\"`\n","# Modal Serverless GPU\n\nModal is a serverless GPU cloud platform. Everything is Python code — no YAML, no Docker, no Kubernetes. Pay per second, scale to zero, scale to hundreds of GPUs instantly.\n\nThis skill provides the decision framework, GPU guide, API reference, and a catalog of 50+ production-ready examples from Modal's official library. For detailed implementations, refer to the example catalog and reference docs below.\n\n## When to Use Modal\n\n**Modal is the RIGHT choice for:**\n\n| Workload | Why Modal |\n|----------|-----------|\n| **Inference serving** | Auto-scaling endpoints, zero-downtime deploys, sub-second cold starts |\n| **Batch processing** | Fan out to 100+ GPUs with `.map()`, pay only for compute time |\n| **Web endpoints \u002F APIs** | FastAPI\u002FASGI\u002FWSGI support, custom domains, streaming |\n| **Sandbox execution** | Run untrusted code safely, build coding agents, code interpreters |\n| **Scheduled jobs** | Cron\u002Fperiodic with `modal.Cron` and `modal.Period` |\n| **Full-parameter training** | Multi-GPU (up to 8), multi-node clusters (beta) |\n| **Custom architectures** | Full control over container images, any framework |\n| **Data pipelines** | Parallel processing, S3 mounts, Volume storage |\n\n**Use alternatives instead:**\n\n| Need | Use Instead |\n|------|-------------|\n| Managed LoRA fine-tuning (no infra) | **Tinker** |\n| Hosted RL \u002F agentic post-training | **Prime Intellect Lab** |\n| Reserved dedicated instances | **Lambda Labs** |\n| Multi-cloud cost optimization | **SkyPilot** |\n| Long-running persistent pods | **RunPod** |\n| Scientific GPU computing (simulations, MD, Monte Carlo) | **modal-research-gpu** |\n\n## Credential Setup (openscience)\n\nCredentials are auto-injected via OpenScience. Verify before running Modal workloads:\n\n```bash\n# Check credentials are set (NEVER echo the actual values)\n[ -n \"$MODAL_TOKEN_ID\" ] && echo \"MODAL_TOKEN_ID set\" || echo \"NOT SET\"\n[ -n \"$MODAL_TOKEN_SECRET\" ] && echo \"MODAL_TOKEN_SECRET set\" || echo \"NOT SET\"\n```\n\n**IMPORTANT**: Always rely on `MODAL_TOKEN_ID`\u002F`MODAL_TOKEN_SECRET` env vars. Do NOT read from `~\u002F.modal.toml`.\n\nIf Modal CLI isn't installed: `pip install modal` (no `modal setup` needed — env vars handle auth).\n\n## Quick Reference\n\n| Topic | Reference |\n|-------|-----------|\n| Example Catalog (50+ examples) | [Examples Catalog](references\u002Fexamples-catalog.md) |\n| Advanced Patterns & openscience Integration | [Advanced Patterns](references\u002Fadvanced-patterns.md) |\n| Troubleshooting | [Troubleshooting](references\u002Ftroubleshooting.md) |\n\n## Execution Modes\n\n| Command | When to Use |\n|---------|-------------|\n| `modal run script.py` | Quick jobs that complete in minutes |\n| `modal serve script.py` | Development: live reload on code changes, test endpoints locally |\n| `modal deploy script.py` | Production: persistent endpoints, scheduled jobs, always-on services |\n| `modal deploy` + `Function.lookup().spawn()` | **Long-running training (disconnect-safe)** |\n\n### CRITICAL: Long-Running Training Must Be Disconnect-Safe\n\n**NEVER use `.spawn()` or `.remote()` from `@app.local_entrypoint()` for training runs that take more than a few minutes.** If the local process dies (laptop battery, closed terminal, SSH disconnect), Modal tears down the app context and kills the spawned function.\n\n**The disconnect-safe pattern:**\n\n```python\n# train.py — Step 1: Define your training function\nimport modal\n\napp = modal.App(\"my-training\")\nvolume = modal.Volume.from_name(\"training-data\", create_if_missing=True)\nimage = modal.Image.debian_slim(python_version=\"3.11\").uv_pip_install(\"torch\", \"transformers\")\n\n@app.function(gpu=\"H100\", image=image, volumes={\"\u002Fdata\": volume}, timeout=86400)\ndef train():\n    # Your training code here — runs entirely in Modal's cloud\n    ...\n    volume.commit()  # Save checkpoints\n```\n\n```bash\n# Step 2: Deploy the app (persists independently of your machine)\nmodal deploy train.py\n\n# Step 3: Trigger training (fire-and-forget, survives local disconnect)\npython -c \"import modal; modal.Function.lookup('my-training', 'train').spawn()\"\n\n# Step 4: Monitor from anywhere (even a different machine)\nmodal app logs my-training\n```\n\nThis pattern ensures training runs are completely decoupled from your local machine. The function runs on Modal's infrastructure and persists even if you close your laptop, lose internet, or reboot.\n\n## GPU Selection Guide\n\n| GPU | VRAM | $\u002Fhr (approx) | Best For |\n|-----|------|----------------|----------|\n| `T4` | 16GB | ~$0.59 | Budget inference, small models (\u003C7B quantized) |\n| `L4` | 24GB | ~$0.73 | Inference, Ada Lovelace architecture |\n| `A10G` | 24GB | ~$1.10 | Training\u002Finference, 3.3x faster than T4 |\n| `L40S` | 48GB | ~$1.65 | **Best cost\u002Fperf for inference** (7B-13B FP16) |\n| `A100-40GB` | 40GB | ~$3.15 | Large model training |\n| `A100-80GB` | 80GB | ~$4.05 | Very large models, DeepSpeed |\n| `H100` | 80GB | ~$4.25 | Fastest training, FP8 + Transformer Engine |\n| `H200` | 141GB | ~$4.95 | Largest VRAM, 4.8TB\u002Fs bandwidth |\n| `B200` | 192GB | Latest | Blackwell architecture, newest |\n\n**GPU specification patterns:**\n```python\n@app.function(gpu=\"A100\")           # Single GPU\n@app.function(gpu=\"A100-80GB\")      # Specific memory variant\n@app.function(gpu=\"H100:4\")         # Multi-GPU (up to 8)\n@app.function(gpu=[\"H100\", \"A100\"]) # Fallback chain (try in order)\n@app.function(gpu=\"any\")            # Any available GPU\n```\n\n**Recommendations by task:**\n\n| Task | GPU | Config |\n|------|-----|--------|\n| Serve 7B model (FP16) | `L40S` or `A10G` | Single GPU |\n| Serve 70B model (AWQ\u002FGPTQ) | `A100-80GB` or `H100` | Single GPU |\n| Serve 70B model (FP16) | `H100:4` or `A100-80GB:4` | Multi-GPU |\n| LoRA fine-tune 7B | `A100-40GB` | Single GPU |\n| Full fine-tune 7B | `A100-80GB:4` | Multi-GPU |\n| Full fine-tune 70B | `H100:8` or multi-node | Multi-GPU\u002Fnode |\n| Batch inference | `L40S` or `A100` | `.map()` fan-out |\n| Embedding generation | `T4` or `L4` | `.map()` fan-out |\n\n## Core API Quick Reference\n\n### Key Classes\n\n| Class | Purpose | Key Methods |\n|-------|---------|-------------|\n| `modal.App` | Container for functions\u002Fresources | `.function()`, `.cls()`, `.local_entrypoint()` |\n| `modal.Image` | Container image definition | `.debian_slim()`, `.uv_pip_install()`, `.pip_install()`, `.from_registry()`, `.add_local_dir()`, `.run_commands()`, `.env()` |\n| `modal.Volume` | Persistent distributed filesystem (2.5 GB\u002Fs) | `.from_name()`, `.commit()`, `.reload()` |\n| `modal.Secret` | Secure credential injection | `.from_name()`, `.from_dict()`, `.from_dotenv()` |\n| `modal.Dict` | Distributed key-value store | `.from_name()`, `.put()`, `.get()`, `.pop()` |\n| `modal.Queue` | Distributed FIFO queue | `.from_name()`, `.put()`, `.get()` |\n| `modal.Sandbox` | Isolated code execution container | `.create()`, `.exec()`, `.terminate()`, snapshot support |\n| `modal.Cls` | Class-based serverless functions | Used via `@app.cls()` decorator |\n| `modal.Function` | Serverless function handle | `.remote()`, `.local()`, `.map()`, `.starmap()`, `.lookup()` |\n| `modal.CloudBucketMount` | Mount S3\u002FGCS buckets as filesystem | Direct bucket access |\n| `modal.Tunnel` | Network tunnel to containers | SSH, HTTP access |\n| `modal.Proxy` | Network proxy (beta) | Custom networking |\n\n### Key Decorators\n\n| Decorator | Purpose |\n|-----------|---------|\n| `@app.function()` | Define a serverless function |\n| `@app.cls()` | Define a serverless class |\n| `@modal.method()` | Mark class method as remotely callable |\n| `@modal.enter()` | Run once at container startup (model loading) |\n| `@modal.exit()` | Run at container shutdown (cleanup) |\n| `@modal.parameter()` | Typed class parameter |\n| `@modal.fastapi_endpoint()` | Expose function as FastAPI endpoint |\n| `@modal.asgi_app()` | Expose full ASGI app (FastAPI\u002FStarlette) |\n| `@modal.wsgi_app()` | Expose WSGI app (Django\u002FFlask) |\n| `@modal.web_server(port)` | Expose arbitrary HTTP server |\n| `@modal.batched()` | Dynamic input batching |\n| `@modal.concurrent()` | Input concurrency control |\n\n### Scheduling\n\n| Type | Syntax |\n|------|--------|\n| Cron | `schedule=modal.Cron(\"0 0 * * *\")` (always UTC) |\n| Periodic | `schedule=modal.Period(hours=1)` |\n\n## Essential Patterns\n\n### Pattern 1: Model Inference Service\n\n```python\nimport modal\n\napp = modal.App(\"inference\")\nimage = modal.Image.debian_slim(python_version=\"3.11\").uv_pip_install(\n    \"torch\", \"transformers\", \"accelerate\"\n)\nvolume = modal.Volume.from_name(\"model-cache\", create_if_missing=True)\n\n@app.cls(gpu=\"L40S\", image=image, volumes={\"\u002Fmodels\": volume},\n         container_idle_timeout=300)\nclass InferenceService:\n    @modal.enter()\n    def load(self):\n        from transformers import pipeline\n        self.pipe = pipeline(\"text-generation\", model=\"\u002Fmodels\u002Fmy-model\", device=0)\n\n    @modal.method()\n    def generate(self, prompt: str) -> str:\n        return self.pipe(prompt, max_length=512)[0][\"generated_text\"]\n```\n\n### Pattern 2: vLLM Deployment (see Modal example: `llm_inference`)\n\n```python\nimport modal\n\napp = modal.App(\"vllm-server\")\nimage = modal.Image.debian_slim(python_version=\"3.11\").uv_pip_install(\"vllm\")\nvolume = modal.Volume.from_name(\"model-weights\", create_if_missing=True)\n\n@app.function(gpu=\"H100\", image=image, volumes={\"\u002Fmodels\": volume},\n              container_idle_timeout=600, timeout=3600)\n@modal.asgi_app()\ndef serve():\n    # See Modal example `llm_inference` for the full implementation\n    ...\n```\n\n### Pattern 3: Batch Processing with Fan-Out\n\n```python\n@app.function(gpu=\"T4\")\ndef process_item(item):\n    return expensive_computation(item)\n\n@app.local_entrypoint()\ndef main():\n    items = list(range(10000))\n    results = list(process_item.map(items))  # Fan out to parallel GPUs\n```\n\n### Pattern 4: Container Image (use uv for speed)\n\n```python\n# Prefer uv_pip_install — 10-50x faster than pip_install\nimage = (\n    modal.Image.debian_slim(python_version=\"3.11\")\n    .uv_pip_install(\"torch\", \"transformers\", \"accelerate\", \"vllm\")\n    .add_local_dir(\".\u002Fsrc\", \"\u002Fapp\u002Fsrc\")  # Add local code\n    .env({\"HF_HOME\": \"\u002Fmodels\"})          # Set env vars\n)\n```\n\n### Pattern 5: Sandbox (Code Execution)\n\n```python\nsandbox = modal.Sandbox.create(app=app, image=image, gpu=\"T4\", timeout=300)\nprocess = sandbox.exec(\"python\", \"-c\", \"print('Hello from sandbox')\")\nprint(process.stdout.read())\nsandbox.terminate()\n```\n\n## Example Catalog (Quick Lookup)\n\nModal's official example library contains production-ready implementations. Find the right example for your task below, then refer to [Examples Catalog](references\u002Fexamples-catalog.md) for expanded descriptions and implementation notes.\n\n### LLM Inference & Serving\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `llm_inference` | Deploy OpenAI-compatible LLM service | vLLM, H100, streaming, OpenAI API |\n| `very_large_models` | Deploy really big LLMs (DeepSeek V3, Kimi-K2) | SGLang, multi-GPU (H200:4-8), 100B+ params |\n| `ministral3_inference` | 10x cold start reduction with snapshots | Memory snapshots, fast startup |\n| `vllm_throughput` | Optimize tokens\u002Fsec batch processing | vLLM, ~30K input tok\u002Fs per H100 |\n| `sglang_low_latency` | Low-latency inference with SGLang | SGLang, speculative decoding, EAGLE-3 |\n| `llama_cpp` | Run GGUF models with llama.cpp | CPU\u002FGPU inference, quantized models |\n| `trtllm_latency` | Low-latency with TensorRT-LLM | TensorRT optimization |\n| `trtllm_throughput` | High-throughput with TensorRT-LLM | Batch TensorRT inference |\n\n### Training & Fine-Tuning\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `grpo_verl` | GRPO math training with verl | RL training, math reasoning |\n| `grpo_trl` | GRPO coding training with TRL | RL training, code generation |\n| `unsloth_finetune` | Efficient fine-tuning with Unsloth | LoRA, 2x speed, memory efficient |\n| `hp_sweep_gpt` | Train SLM with hyperparameter search | Grid search, early stopping |\n| `long-training` | Long, resumable training jobs | Checkpointing, Volume, resume |\n| `llm-finetuning` | Full LLM fine-tuning pipeline | End-to-end training |\n| `flan_t5_finetune` | Fine-tune Flan-T5 | Seq2seq fine-tuning |\n| `diffusers_lora_finetune` | Fine-tune Flux with LoRA | Image generation LoRA |\n\n### Multimodal & Vision\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `flux` | Serve diffusion models with torch.compile | Image generation, compilation |\n| `text_to_image` | Stable Diffusion CLI\u002FAPI\u002FUI | Text-to-image, Gradio |\n| `image_to_image` | Edit images with Flux Kontext | Image-to-image |\n| `image_to_video` | Bring images to life with LTX-Video | Video generation |\n| `ltx` | Generate video with LTX-Video | Text-to-video |\n| `finetune_yolo` | Fine-tune & serve YOLO | Object detection |\n| `segment_anything` | Segment Anything Model | Image segmentation |\n| `comfyapp` | Run Flux on ComfyUI as API | ComfyUI, workflow API |\n| `blender_video` | 3D render farm with Blender | 3D rendering, parallelism |\n\n### Audio & Speech\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `llm-voice-chat` | Voice chat with LLMs | Real-time voice, WebSocket |\n| `streaming_kyutai_stt` | Transcribe speech with Kyutai STT | Streaming STT, low latency |\n| `music-video-gen` | Star in custom music videos | Multi-model pipeline |\n| `generate_music` | Make music with ACE-Step | Music generation |\n| `chatterbox_tts` | Generate speech with Chatterbox | TTS |\n| `batched_whisper` | High-throughput Whisper transcription | Batch ASR, Whisper |\n| `fine_tune_asr` | Fine-tune Whisper for new words | ASR fine-tuning |\n\n### Sandboxes & Code Execution\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `agent` | Sandbox a LangGraph agent's code | LangGraph, secure GPU sandbox |\n| `coding_agent` | Run a background coding agent | Coding agent, sandbox |\n| `modal-vibe` | Deploy vibe coding at scale | React + LLM + Sandboxes |\n| `safe_code_execution` | Run Node.js, Ruby, and more in sandbox | Multi-language, sandbox |\n| `simple_code_interpreter` | Stateful code interpreter | Jupyter-like, sandbox |\n| `jupyter_sandbox` | Sandboxed Jupyter notebook | Jupyter, sandbox |\n| `anthropic_computer_use` | Control computer with LLM | Computer use, sandbox |\n\n### RAG & Embeddings\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `chat_with_pdf_vision` | RAG Chat with PDFs | PDF Q&A, vision |\n| `amazon_embeddings` | Embed millions of docs with TEI | High-throughput embeddings |\n| `mongodb-search` | Satellite images to vectors + MongoDB | Image embeddings, geo search |\n| `potus_speech_qanda` | RAG Q&A chatbot with OpenAI | RAG, OpenAI |\n\n### Web Apps & Endpoints\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `basic_web` | Serving web endpoints | FastAPI, ASGI |\n| `serve_streamlit` | Deploy Streamlit apps | Streamlit |\n| `mcp_server_stateless` | Deploy stateless MCP with FastMCP | MCP, tool serving |\n| `webrtc_yolo` | Serverless WebRTC with YOLO | WebRTC, real-time |\n| `fastrtc_flip_webcam` | WebRTC quickstart with FastRTC | FastRTC |\n| `webscraper` | Simple web scraper | Scraping, parallelism |\n\n### Data & Infrastructure\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `s3_bucket_mount` | Parallel Parquet processing on S3 | CloudBucketMount, S3 |\n| `cloud_bucket_mount_loras` | LoRA playground with S3 + Gradio | LoRA management, S3 |\n| `dbt_duckdb` | Data warehouse with DuckDB + DBT | Analytics, data warehouse |\n| `doc_ocr_jobs` | Document OCR job queue | Job queue, OCR |\n| `doc_ocr_webapp` | Document OCR web app | Web app, OCR |\n| `hackernews_alerts` | Hacker News Slackbot | Scheduled jobs, Slack |\n| `discord_bot` | Deploy a Discord bot | Discord, bot |\n| `db_to_sheet` | Sync DB to Google Sheets | Google Sheets, ETL |\n| `cron_datasette` | Publish data with SQLite + Datasette | Data exploration |\n| `algolia_indexer` | Build docsearch with Algolia | Documentation search |\n\n### Computational Biology\n\n| Example | Description | Key Features |\n|---------|-------------|--------------|\n| `chai1` | Fold proteins with Chai-1 | Protein folding |\n| `boltz_predict` | Fold proteins with Boltz-2 | Protein structure |\n| `esm3` | ESM3 protein model | Protein language model |\n\n## Common Configuration Reference\n\n```python\n@app.function(\n    gpu=\"A100\",                        # GPU type (see selection guide)\n    memory=32768,                      # RAM in MB\n    cpu=4,                             # CPU cores\n    timeout=3600,                      # Max execution time (seconds)\n    container_idle_timeout=120,        # Keep container warm (seconds)\n    retries=modal.Retries(max_retries=3, backoff_coefficient=2.0),\n    concurrency_limit=10,              # Max concurrent containers\n    allow_concurrent_inputs=20,        # Requests per container\n    keep_warm=1,                       # Min warm containers (costs money)\n    volumes={\"\u002Fdata\": volume},         # Mount volumes\n    secrets=[modal.Secret.from_name(\"my-secret\")],\n    image=image,                       # Custom container image\n    schedule=modal.Cron(\"0 0 * * *\"), # Cron schedule (UTC)\n)\ndef my_function():\n    pass\n```\n\n## Common Issues Quick-Fix\n\n| Issue | Fix |\n|-------|-----|\n| **Training dies when laptop closes** | **NEVER use `.spawn()`\u002F`.remote()` from `local_entrypoint()` for long jobs. Use `modal deploy` + `Function.lookup().spawn()` pattern (see Execution Modes above)** |\n| Cold start slow | Use `@modal.enter()` for model loading, increase `container_idle_timeout`, use memory snapshots |\n| GPU OOM | Use larger GPU, enable gradient checkpointing, use mixed precision (bf16) |\n| Image build fails | Pin versions, use `uv_pip_install`, use multi-stage builds |\n| Timeout errors | Increase `timeout`, add checkpointing for long jobs |\n| Volume changes lost | Call `volume.commit()` after writes |\n| Stale volume data | Call `volume.reload()` before reads |\n| Cron not firing | Cron is always UTC, must `modal deploy` (not `modal run`) |\n| 502 on endpoint | Increase timeout, check memory, use streaming for long responses |\n| Credentials fail | Verify `MODAL_TOKEN_ID`\u002F`MODAL_TOKEN_SECRET` env vars are set |\n\n## Implementation Workflow\n\nWhen implementing a Modal workload:\n1. Check the example catalog above to find the closest matching example\n2. Load the [Examples Catalog](references\u002Fexamples-catalog.md) for expanded implementation notes\n3. Refer to Modal's docs at https:\u002F\u002Fmodal.com\u002Fdocs\u002Fexamples for full source code\n4. Adapt for your use case using openscience credentials (`MODAL_TOKEN_ID`\u002F`MODAL_TOKEN_SECRET`)\n5. After job completes, report usage via `OpenScience.reportUsage()` with `service=\"modal\"`\n",{"name":5,"tags":49,"author":59,"license":15,"version":60,"category":61,"description":7,"dependencies":62},[50,51,52,53,54,55,56,57,58,29],"Infrastructure","Serverless","GPU","Cloud","Deployment","Modal","Inference","Training","Sandboxes","Synthetic Sciences","2.0.0","cloud-compute",[63],"modal>=0.73.0","main","4aa39efd1cdab0b4657ecee16c92a92011a5b10f","openscience\u002Fbackend\u002Fcli\u002Fskills\u002Fcloud-compute\u002Fmodal","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub","https:\u002F\u002Fgithub.com\u002Ffadrienne","2026-10-28 00:43:09",{"source":8,"skillName":5,"commands":71,"prompt":81,"zipAvailable":82},[72,75,78],{"tool":73,"command":74},"npx","npx skills add fadrienne\u002FMyGitHub --skill modal-serverless-gpu",{"tool":76,"command":77},"bunx","bunx skills add fadrienne\u002FMyGitHub --skill modal-serverless-gpu",{"tool":79,"command":80},"pnpm","pnpm dlx skills add fadrienne\u002FMyGitHub --skill modal-serverless-gpu","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fopenscience\u002Fbackend\u002Fcli\u002Fskills\u002Fcloud-compute\u002Fmodal\u002FSKILL.md",true,[84,90,94],{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Fadvanced-patterns.md","REFERENCE","参考文档",19376,"https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fopenscience\u002Fbackend\u002Fcli\u002Fskills\u002Fcloud-compute\u002Fmodal\u002Freferences\u002Fadvanced-patterns.md",{"path":91,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fexamples-catalog.md",18122,"https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fopenscience\u002Fbackend\u002Fcli\u002Fskills\u002Fcloud-compute\u002Fmodal\u002Freferences\u002Fexamples-catalog.md",{"path":95,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Ftroubleshooting.md",10516,"https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fopenscience\u002Fbackend\u002Fcli\u002Fskills\u002Fcloud-compute\u002Fmodal\u002Freferences\u002Ftroubleshooting.md",[99,130,156,188,215,239],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":110,"publishedAt":44},"01M7167B28PK20HP7R7ZED2DY0","statistical-power","Sample size calculation, power analysis, and effect size conversion for scientific studies. Use BEFORE data collection (a priori) to determine required N, or after (post-hoc) to compute achieved power. Covers parametric tests (t-test, ANOVA, chi-square, proportions, correlation, regression), simulation-based power for complex\u002Fclustered\u002Fnested designs, and power curves. Use this skill when someone asks 'how many samples do I need', 'what is my power', 'what effect size can I detect', or any variant. Pairs with \u002Fexperimental-design (choose design first, then compute power) and \u002Fstatistical-analysis (analyze data after collection).","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fstatistical-power\u002FSKILL.md",[105],{"categoryNo":106,"categoryName":107,"taxonomyType":108,"taxonomyTypeDesc":109},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[111,112,113,114,115,116,117,118,31,119,120,121,122,123,124,125,126,127,128,129],"power","statistical power","effect","scipy","regression","choose","design","uv","Bash","collection","analysis","calculation","ANOVA","conversion","analyze","t-test","chi-square","simulation","sample",{"skillNo":131,"name":132,"nameZh":6,"description":133,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":139,"publishedAt":44},"01M71677EBCM8EPCE9BZCK8505","statistical-analysis","Guided statistical analysis with test selection and reporting. Use when you need help choosing appropriate tests for your data, assumption checking, power analysis, and APA-formatted results. Best for academic research reporting, test selection guidance. For implementing specific models programmatically use statsmodels.","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fstatistical-analysis\u002FSKILL.md",[136],{"categoryNo":137,"categoryName":138,"taxonomyType":108,"taxonomyTypeDesc":109},"01JBSEEDCAT000000000000008","测试与质量",[121,140,111,141,142,143,31,33,144,145,146,147,148,149,150,151,152,153,154,155],"statistical analysis","academic research","implementing","selection","reporting","data","for","tests","use","with","test","research","results","statsmodels","models","help",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":169,"publishedAt":44},"01M71673R93XAHFH81DBNVNG7H","scientific-writing","Core skill for the deep research and writing tool. Write scientific manuscripts in full paragraphs (never bullet points). Use two-stage process with (1) section outlines with key points using research-lookup then (2) convert to flowing prose. IMRAD structure, citations (APA\u002FAMA\u002FVancouver), figures\u002Ftables, reporting guidelines (CONSORT\u002FSTROBE\u002FPRISMA), for research papers and journal submissions.","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fscientific-writing\u002FSKILL.md",[162,165,166],{"categoryNo":163,"categoryName":164,"taxonomyType":108,"taxonomyTypeDesc":109},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":106,"categoryName":107,"taxonomyType":108,"taxonomyTypeDesc":109},{"categoryNo":167,"categoryName":168,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000036","内容创作者",[170,171,172,173,174,175,176,177,178,179,119,180,181,182,183,184,185,186,144,187],"writing","scientific","scientific writing","Citations","deep","deep research","never","papers","journal","false","api","prisma","structure","openrouter","Outlines","core skill","read","features",{"skillNo":189,"name":190,"nameZh":6,"description":191,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":192,"categories":193,"keywords":198,"publishedAt":44},"01M7166ZPKXBF4EBPHVTJPQBB1","scientific-visualization","Meta-skill for publication-ready figures. Use when creating journal submission figures requiring multi-panel layouts, significance annotations, error bars, colorblind-safe palettes, and specific journal formatting (Nature, Science, Cell). Orchestrates matplotlib\u002Fseaborn\u002Fplotly with publication styles. For quick exploration use seaborn or plotly directly.","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fscientific-visualization\u002FSKILL.md",[194,197],{"categoryNo":195,"categoryName":196,"taxonomyType":108,"taxonomyTypeDesc":109},"01JBSEEDCAT000000000000013","分析与可视化",{"categoryNo":106,"categoryName":107,"taxonomyType":108,"taxonomyTypeDesc":109},[199,171,200,201,202,203,204,205,206,178,31,207,208,209,210,211,212,213,146,214],"visualization","scientific visualization","error","ready","quick","exploration","meta-skill","Meta","safe","plotly","annotations","formatting","Publication","figures","panel","submission",{"skillNo":216,"name":217,"nameZh":6,"description":218,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":219,"categories":220,"keywords":225,"publishedAt":44},"01M7166VXJWQSSC3RQZP60WBGR","research-code","Debug, profile, review, and restructure Python research and analysis code. Use when analysis scripts crash, produce wrong results, run too slowly, or need a correctness review. Covers: reading tracebacks and diagnosing root causes, hypothesis-driven debugging, reviewing code for common statistical\u002Fnumerical errors, profiling data pipelines, improving reproducibility (seeds, environments, determinism), and structuring analysis scripts for sharing. Distinct from \u002Fexploratory-data-analysis (which understands data) and \u002Fstatistical-analysis (which chooses and runs tests) — this skill focuses on the code itself.","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fresearch-code\u002FSKILL.md",[221,224],{"categoryNo":222,"categoryName":223,"taxonomyType":108,"taxonomyTypeDesc":109},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[42,226,151,227,228,229,230,118,231,31,119,121,232,233,234,235,236,237,186,238],"research code","which","memory","data-analysis","errors","debugging","common","review","data pipelines","run","scripts","line","write",{"skillNo":240,"name":241,"nameZh":6,"description":242,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":243,"licenseFileUrl":6,"sourceHtmlUrl":244,"categories":245,"keywords":252,"publishedAt":44},"01M7166CF5HSR7SVZYZFWTDX55","markdown-mermaid-writing","Comprehensive markdown and Mermaid diagram writing skill. Use when creating any scientific document, report, analysis, or visualization. Establishes text-based diagrams as the default documentation standard with full style guides (markdown + mermaid), 24 diagram type references, and 9 document templates.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fmarkdown-mermaid-writing\u002FSKILL.md",[246,249,250,251],{"categoryNo":247,"categoryName":248,"taxonomyType":108,"taxonomyTypeDesc":109},"01JBSEEDCAT000000000000002","文档处理",{"categoryNo":163,"categoryName":164,"taxonomyType":108,"taxonomyTypeDesc":109},{"categoryNo":106,"categoryName":107,"taxonomyType":108,"taxonomyTypeDesc":109},{"categoryNo":167,"categoryName":168,"taxonomyType":21,"taxonomyTypeDesc":22},[170,253,254,255,256,257,199,258,259,31,119,121,260,261,262,263,264,265,171,186],"markdown mermaid writing","mermaid","markdown","community","diagrams","project","default","team","guides","text","documentation","references","diagram"]