[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ACB74CMM5WT1RVVV1G7V46":3,"skill-same:01M7ACB74CMM5WT1RVVV1G7V46":92},{"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":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":14,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":47},"01M7ACB74CMM5WT1RVVV1G7V46","flash",null,"runpod-flash — code-first serverless: write Python locally, run it on remote Runpod GPUs\u002FCPUs with `flash dev` (hot-reload + live worker logs), then `flash deploy`. Use for @Endpoint\u002F@remote functions, resource config, and debugging flash deployments. For CLI-only infra management use runpodctl or runpod-mcp.","NeelakshSaxena\u002FVayu","NeelakshSaxena","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F87892838?v=4","01M7A3B9YFS6F6N9DD1787DT86","Neelaksh Saxena","01M7A3B9ZKBT09MNMPX2XN69BY",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflash\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: flash\ndescription: >-\n  runpod-flash — code-first serverless: write Python locally, run it on remote\n  Runpod GPUs\u002FCPUs with `flash dev` (hot-reload + live worker logs), then\n  `flash deploy`. Use for @Endpoint\u002F@remote functions, resource config, and\n  debugging flash deployments. For CLI-only infra management use runpodctl or\n  runpod-mcp.\nuser-invocable: true\nmetadata:\n  author: runpod\n  version: \"1.2.0\" # x-release-please-version\nlicense: Apache-2.0\n---\n\n# Runpod Flash\n\nWrite code locally, iterate with `flash dev` — it runs your functions on remote Runpod GPUs\u002FCPUs with hot-reload and live worker logs — then `flash deploy` to ship. `Endpoint` handles provisioning.\n\n`runpod-flash` releases on its own cadence, so **`flash --help` and `flash \u003Ccommand> --help`\nare authoritative for the command surface** — this skill is the mental model, the decision\nrules, and the gotchas that help output does not carry. Confirm the installed version with\n`pip show runpod-flash` before concluding a subcommand or flag is unavailable.\n\n**Worked examples first for anything multi-step.** Flash appears in verified end-to-end\npaths — [03 variant B (whisper endpoint via flash)](..\u002Frunpod\u002Fgolden-paths\u002F03-whisper-endpoint\u002Fvariant-b-flash.md)\nand [08 (fine-tune → serve)](..\u002Frunpod\u002Fgolden-paths\u002F08-finetune-to-serverless.md); the full\nindex is [runpod\u002Fgolden-paths\u002FREADME.md](..\u002Frunpod\u002Fgolden-paths\u002FREADME.md). Open the matching\npath before planning a deploy — it carries the ordering and the cost cleanup this skill only\nsummarizes.\n\n**Load on demand — this skill keeps the mental model + gotchas inline; details live in [`reference\u002F`](reference\u002F):**\n\n| Need | Read |\n|------|------|\n| Install, auth, `flash init`, and the full `flash` command list | [reference\u002Fsetup-and-cli.md](reference\u002Fsetup-and-cli.md) |\n| `Endpoint(...)` constructor params, `NetworkVolume`\u002F`PodTemplate`\u002F`EndpointJob`, GPU & CPU enum tables | [reference\u002Fapi.md](reference\u002Fapi.md) |\n| Worked patterns — choosing a model, warm-worker model loading, CPU→GPU pipeline, parallel calls | [reference\u002Fpatterns.md](reference\u002Fpatterns.md) |\n\nQuick start: `uv tool install runpod-flash` → `flash login` (or `export RUNPOD_API_KEY=...`) → `flash init my-project` → `flash dev`. Details in [reference\u002Fsetup-and-cli.md](reference\u002Fsetup-and-cli.md).\n\n## Dev vs Deploy\n\n- `flash dev` — **iterate.** Local server at `:8888`, but your decorated functions\n  execute on **remote GPU\u002FCPU workers**. Hot-reloads on save and **streams the worker's\n  logs live** to the terminal. No build\u002Fupload\u002Fdeploy wait — use this the whole time you\n  develop.\n- `flash deploy` — **ship.** Builds an artifact and deploys a stable endpoint. Slow\n  (build + upload + provision); only do this once the code works under `flash dev`.\n\n`flash dev` ships **only the function body** to the worker, so a `NameError` for a\nmodule-level name surfaces immediately here. `flash deploy` imports the whole module and\ncan mask that bug (see Gotcha #1). Develop against `flash dev` and you catch it first.\n\n## Autonomous Dev Loop\n\n`flash dev` is a long-running server. Three rules:\n- **Run it in the background** — don't block on it.\n- **Capture its output** to a log file.\n- **Drive it over HTTP.**\n\nThe captured log is the remote worker's live stream (cold start, model load, `print`s,\ntracebacks) — read it to debug.\n\n```bash\nflash dev > \u002Ftmp\u002Fflash-dev.log 2>&1 &                          # background; never run it blocking\nfor i in $(seq 1 60); do grep -q \"flash dev  localhost:\" \u002Ftmp\u002Fflash-dev.log && break; sleep 2; done  # bounded ~2min; if it never appears, check the log for errors\nURL=$(grep -o \"localhost:[0-9]*\" \u002Ftmp\u002Fflash-dev.log | head -1)               # actual port (8888 bumps if taken)\ncurl -s \"$URL\u002Fmain\u002Fpredict\" -d '{\"data\": {...}}'               # dispatches to the remote worker\n```\n\n- **Read the real URL from the log** — flash auto-bumps the port if 8888 is in use, and\n  prints `✓ flash dev  localhost:\u003Cport>` plus the route table.\n- **Routes are namespaced by file**: `main.py`'s `\u002Fpredict` is served at `\u002Fmain\u002Fpredict`.\n- **Two route shapes, two body shapes** (mismatch → `422` naming the missing field in `loc`):\n  - **Load-balanced** (`@api.post(\"\u002Fpredict\")`) → `POST \u002Fmain\u002Fpredict`, body is the arg\n    at top level: a handler `def predict(data: dict)` wants `{\"data\": {...}}` (not the bare object).\n  - **Queue-based** (bare `@Endpoint` decorator) → `POST \u002Fmain\u002Frunsync` (the local dev\n    server only generates `\u002Frunsync`; production also exposes `\u002Frun`),\n    body is **double-wrapped** in `input`: a handler `def synthesize(data: dict)` wants\n    `{\"input\": {\"data\": {...}}}`. The outer `input` is the queue envelope; the inner key is\n    the handler's param name.\n- Edit a handler and save — hot-reload re-syncs the body; just re-send the request, no\n  redeploy. Add `--auto-provision` to skip the first-call cold start. `kill %1` when done.\n\n## Endpoint: Three Modes\n\nFull constructor params and the GPU\u002FCPU enum tables are in [reference\u002Fapi.md](reference\u002Fapi.md).\n\n### Mode 1: Your Code (Queue-Based Decorator)\n\nOne function = one endpoint with its own workers.\n\n```python\nfrom runpod_flash import Endpoint, GpuGroup\n\n@Endpoint(name=\"my-worker\", gpu=GpuGroup.AMPERE_80, workers=5, dependencies=[\"torch\"])\nasync def compute(data):\n    import torch  # MUST import inside function (cloudpickle)\n    return {\"sum\": torch.tensor(data, device=\"cuda\").sum().item()}\n\nresult = await compute([1, 2, 3])\n```\n\n### Mode 2: Your Code (Load-Balanced Routes)\n\nMultiple HTTP routes share one pool of workers.\n\n```python\nfrom runpod_flash import Endpoint, GpuGroup\n\napi = Endpoint(name=\"my-api\", gpu=GpuGroup.ADA_24, workers=(1, 5), dependencies=[\"torch\"])\n\n@api.post(\"\u002Fpredict\")\nasync def predict(data: list[float]):\n    import torch\n    return {\"result\": torch.tensor(data, device=\"cuda\").sum().item()}\n\n@api.get(\"\u002Fhealth\")\nasync def health():\n    return {\"status\": \"ok\"}\n```\n\n### Mode 3: External Image (Client)\n\nDeploy a pre-built Docker image and call it via HTTP.\n\n```python\nfrom runpod_flash import Endpoint, GpuGroup, PodTemplate\n\nserver = Endpoint(\n    name=\"my-server\",\n    image=\"my-org\u002Fmy-image:latest\",\n    gpu=GpuGroup.AMPERE_80,\n    workers=1,\n    env={\"HF_TOKEN\": \"xxx\"},\n    template=PodTemplate(containerDiskInGb=100),\n)\n\n# LB-style\nresult = await server.post(\"\u002Fv1\u002Fcompletions\", {\"prompt\": \"hello\"})\nmodels = await server.get(\"\u002Fv1\u002Fmodels\")\n\n# QB-style\njob = await server.run({\"prompt\": \"hello\"})        # optional: webhook=\"https:\u002F\u002F...\" for completion callback\nawait job.wait()\nprint(job.output)\n```\n\nConnect to an existing endpoint by ID (no provisioning):\n\n```python\nep = Endpoint(id=\"abc123\")\njob = await ep.runsync({\"prompt\": \"hello\"})  # runsync wraps this as {\"input\": {\"prompt\": \"hello\"}}\nprint(job.output)\n```\n\n## How Mode Is Determined\n\n| Parameters | Mode |\n|-----------|------|\n| `name=` only | Decorator (your code) |\n| `image=` set | Client (deploys image, then HTTP calls) |\n| `id=` set | Client (connects to existing, no provisioning) |\n\nThe table above is *how* the mode is picked from params. *When* to reach for `image=`:\n\n### When to use `image=` (custom container) vs your own code\n\nDefault to writing Python (decorator \u002F routes) — it runs arbitrary code with\n`dependencies=[...]`\u002F`system_dependencies=[...]` and needs no Dockerfile. Even large\nHuggingFace models stay in decorator mode (weights stream at runtime — see\n[reference\u002Fpatterns.md → Loading ML models](reference\u002Fpatterns.md#loading-ml-models-warm-workers)).\nReach for `image=` **only** when you need:\n\n- **a pre-built inference server** — vLLM, TensorRT-LLM (`image=\"vllm\u002Fvllm-openai:latest\"`, or `runpod\u002Fworker-vllm`, `runpod\u002Fworker-comfy`)\n- **system-level deps not pip-installable** — a specific CUDA\u002FcuDNN, OS libraries\n- **models baked into the image** — to skip the runtime download entirely\n- **an existing Runpod Serverless worker** — you already have a working image\n\nTrade-off: `image=` mode **can't run arbitrary Python** (the image owns all logic) and the\nimage must implement a Runpod Serverless handler. Full list + examples:\nhttps:\u002F\u002Fdocs.runpod.io\u002Fflash\u002Fcustom-docker-images\n\n## Gotchas\n\n1. **Only the function body ships to the worker** -- most common error. Put imports *and* any module-level constants\u002Fhelpers the function uses *inside* the decorated body. `flash deploy` imports the whole module so module globals happen to work; `flash dev` ships just the body, so a module-level name raises `NameError`. A handler that works deployed can break under dev — fix it by moving everything inside.\n2. **Forgetting await** -- all decorated functions and client methods need `await`.\n3. **Missing dependencies** -- must list in `dependencies=[]`.\n4. **gpu\u002Fcpu are exclusive** -- pick one per Endpoint.\n5. **idle_timeout is seconds** -- default 60s, not minutes.\n6. **10MB payload limit** -- pass URLs, not large objects. Return binary (audio\u002Fimages\u002Ffiles) as base64 in the JSON (`{\"audio_b64\": ...}`) and decode client-side; for larger outputs write to a NetworkVolume or upload to storage and return a URL.\n7. **Client vs decorator** -- `image=`\u002F`id=` = client. Otherwise = decorator.\n8. **Auto GPU switching requires workers >= 5** -- pass a list of GPU types (e.g. `gpu=[GpuGroup.ADA_24, GpuGroup.AMPERE_80]`) and set `workers=5` or higher. The platform only auto-switches GPU types based on supply when max workers is at least 5.\n9. **`runsync` timeout is 60s** -- cold starts can exceed 60s. Use `ep.runsync(data, timeout=120)` for first requests or use `ep.run()` + `job.wait()` instead.\n10. **Request body shape (raw\u002Fexternal HTTP callers only)** -- match the request shape to the endpoint type:\n    - **LB routes** (`@api.post(...)`): send the handler arg at the top level — `{\"data\": {...}}`.\n    - **QB endpoints** (bare `@Endpoint`, hit via `...\u002Frun` or `...\u002Frunsync`): the worker calls\n      **`handler(**job_input)`**, so the request's `input` keys must match the handler's parameter\n      names — `def transcribe(input_data: dict)` wants `{\"input\": {\"input_data\": {...}}}`, and\n      `def read(input: dict)` wants `{\"input\": {\"input\": {...}}}`. A mismatch fails with\n      `got an unexpected keyword argument …`. Use `**kwargs` if the handler ignores the payload.\n    - **Never send an empty `input`.** A QB request with `{\"input\": {}}` is rejected by the\n      worker SDK as `Job has missing field(s): id or input` — always include at least one key.\n    - *Context:* the flash client (`ep.runsync(x)`, `api.post(...)`) hides the spreading, so this\n      only bites raw HTTP\u002Fexternal callers (mismatch behavior verified 2026-07-10 via worker logs).\n      See *Autonomous Dev Loop*.\n11. **Load a model once per worker (not per call)** -- for real inference use a class `@Endpoint` whose `__init__` loads the model once per worker (see [reference\u002Fpatterns.md → Loading ML models](reference\u002Fpatterns.md#loading-ml-models-warm-workers)). In function-form, reconcile with #1 by caching in a module global *inside* the body so it works under both `flash dev` and `deploy`:\n    ```python\n    global _MODEL\n    try: _MODEL\n    except NameError: _MODEL = load_model()   # runs once per worker, reused across calls\n    ```\n12. **Native CUDA libs go in `dependencies=[]` too** -- e.g. CTranslate2\u002Ffaster-whisper needs `nvidia-cublas-cu12` + `nvidia-cudnn-cu12` or it silently falls back to CPU. Add them alongside the Python package.\n13. **Silent 401 auth failure** -- a set `RUNPOD_API_KEY` env var overrides the `flash login` token, so a bad\u002Fexpired key wins. The failure is quiet: provisioning logs `GraphQL request failed: 401`, but `flash dev` still prints its normal ready line (\"failed endpoints deploy on-demand\"), so it *looks* healthy. When endpoints fail to provision:\n    1. Check the provisioning log for `GraphQL request failed: 401`.\n    2. Verify the current key independently: `curl -s -o \u002Fdev\u002Fnull -w '%{http_code}' https:\u002F\u002Frest.runpod.io\u002Fv1\u002Fendpoints -H \"Authorization: Bearer $RUNPOD_API_KEY\"` (200 = good, 401 = bad).\n    3. Fix it: `unset RUNPOD_API_KEY` to fall back to the `flash login` token, or `export` a valid key.\n14. **`system_dependencies=` adds to cold start** -- apt packages (e.g. `[\"ffmpeg\", \"espeak-ng\"]`) install on the worker before first use, so the initial call is slower (on top of any model download); warm calls are unaffected.\n15. **Teardown a deployed app with `flash app delete \u003Capp>`** -- `flash undeploy list` may show \"no endpoints\" for an app that is deployed and serving; `flash app delete` (or `runpodctl serverless delete \u003Cid>`) reliably removes it.\n\n## Resources\n\n- Setup & CLI: [reference\u002Fsetup-and-cli.md](reference\u002Fsetup-and-cli.md) · API & compute enums: [reference\u002Fapi.md](reference\u002Fapi.md) · Patterns: [reference\u002Fpatterns.md](reference\u002Fpatterns.md)\n- Flash source: https:\u002F\u002Fgithub.com\u002Frunpod\u002Fflash\n- Runnable examples: https:\u002F\u002Fgithub.com\u002Frunpod\u002Fflash-examples — clone and adapt the closest one\n- Package (PyPI): https:\u002F\u002Fpypi.org\u002Fproject\u002Frunpod-flash\u002F\n- Docs: https:\u002F\u002Fdocs.runpod.io\u002Fflash\u002Foverview\n  - Custom Docker images (when + how): https:\u002F\u002Fdocs.runpod.io\u002Fflash\u002Fcustom-docker-images\n  - Storage \u002F network volumes: https:\u002F\u002Fdocs.runpod.io\u002Fflash\u002Fconfiguration\u002Fstorage\n","# Runpod Flash\n\nWrite code locally, iterate with `flash dev` — it runs your functions on remote Runpod GPUs\u002FCPUs with hot-reload and live worker logs — then `flash deploy` to ship. `Endpoint` handles provisioning.\n\n`runpod-flash` releases on its own cadence, so **`flash --help` and `flash \u003Ccommand> --help`\nare authoritative for the command surface** — this skill is the mental model, the decision\nrules, and the gotchas that help output does not carry. Confirm the installed version with\n`pip show runpod-flash` before concluding a subcommand or flag is unavailable.\n\n**Worked examples first for anything multi-step.** Flash appears in verified end-to-end\npaths — [03 variant B (whisper endpoint via flash)](..\u002Frunpod\u002Fgolden-paths\u002F03-whisper-endpoint\u002Fvariant-b-flash.md)\nand [08 (fine-tune → serve)](..\u002Frunpod\u002Fgolden-paths\u002F08-finetune-to-serverless.md); the full\nindex is [runpod\u002Fgolden-paths\u002FREADME.md](..\u002Frunpod\u002Fgolden-paths\u002FREADME.md). Open the matching\npath before planning a deploy — it carries the ordering and the cost cleanup this skill only\nsummarizes.\n\n**Load on demand — this skill keeps the mental model + gotchas inline; details live in [`reference\u002F`](reference\u002F):**\n\n| Need | Read |\n|------|------|\n| Install, auth, `flash init`, and the full `flash` command list | [reference\u002Fsetup-and-cli.md](reference\u002Fsetup-and-cli.md) |\n| `Endpoint(...)` constructor params, `NetworkVolume`\u002F`PodTemplate`\u002F`EndpointJob`, GPU & CPU enum tables | [reference\u002Fapi.md](reference\u002Fapi.md) |\n| Worked patterns — choosing a model, warm-worker model loading, CPU→GPU pipeline, parallel calls | [reference\u002Fpatterns.md](reference\u002Fpatterns.md) |\n\nQuick start: `uv tool install runpod-flash` → `flash login` (or `export RUNPOD_API_KEY=...`) → `flash init my-project` → `flash dev`. Details in [reference\u002Fsetup-and-cli.md](reference\u002Fsetup-and-cli.md).\n\n## Dev vs Deploy\n\n- `flash dev` — **iterate.** Local server at `:8888`, but your decorated functions\n  execute on **remote GPU\u002FCPU workers**. Hot-reloads on save and **streams the worker's\n  logs live** to the terminal. No build\u002Fupload\u002Fdeploy wait — use this the whole time you\n  develop.\n- `flash deploy` — **ship.** Builds an artifact and deploys a stable endpoint. Slow\n  (build + upload + provision); only do this once the code works under `flash dev`.\n\n`flash dev` ships **only the function body** to the worker, so a `NameError` for a\nmodule-level name surfaces immediately here. `flash deploy` imports the whole module and\ncan mask that bug (see Gotcha #1). Develop against `flash dev` and you catch it first.\n\n## Autonomous Dev Loop\n\n`flash dev` is a long-running server. Three rules:\n- **Run it in the background** — don't block on it.\n- **Capture its output** to a log file.\n- **Drive it over HTTP.**\n\nThe captured log is the remote worker's live stream (cold start, model load, `print`s,\ntracebacks) — read it to debug.\n\n```bash\nflash dev > \u002Ftmp\u002Fflash-dev.log 2>&1 &                          # background; never run it blocking\nfor i in $(seq 1 60); do grep -q \"flash dev  localhost:\" \u002Ftmp\u002Fflash-dev.log && break; sleep 2; done  # bounded ~2min; if it never appears, check the log for errors\nURL=$(grep -o \"localhost:[0-9]*\" \u002Ftmp\u002Fflash-dev.log | head -1)               # actual port (8888 bumps if taken)\ncurl -s \"$URL\u002Fmain\u002Fpredict\" -d '{\"data\": {...}}'               # dispatches to the remote worker\n```\n\n- **Read the real URL from the log** — flash auto-bumps the port if 8888 is in use, and\n  prints `✓ flash dev  localhost:\u003Cport>` plus the route table.\n- **Routes are namespaced by file**: `main.py`'s `\u002Fpredict` is served at `\u002Fmain\u002Fpredict`.\n- **Two route shapes, two body shapes** (mismatch → `422` naming the missing field in `loc`):\n  - **Load-balanced** (`@api.post(\"\u002Fpredict\")`) → `POST \u002Fmain\u002Fpredict`, body is the arg\n    at top level: a handler `def predict(data: dict)` wants `{\"data\": {...}}` (not the bare object).\n  - **Queue-based** (bare `@Endpoint` decorator) → `POST \u002Fmain\u002Frunsync` (the local dev\n    server only generates `\u002Frunsync`; production also exposes `\u002Frun`),\n    body is **double-wrapped** in `input`: a handler `def synthesize(data: dict)` wants\n    `{\"input\": {\"data\": {...}}}`. The outer `input` is the queue envelope; the inner key is\n    the handler's param name.\n- Edit a handler and save — hot-reload re-syncs the body; just re-send the request, no\n  redeploy. Add `--auto-provision` to skip the first-call cold start. `kill %1` when done.\n\n## Endpoint: Three Modes\n\nFull constructor params and the GPU\u002FCPU enum tables are in [reference\u002Fapi.md](reference\u002Fapi.md).\n\n### Mode 1: Your Code (Queue-Based Decorator)\n\nOne function = one endpoint with its own workers.\n\n```python\nfrom runpod_flash import Endpoint, GpuGroup\n\n@Endpoint(name=\"my-worker\", gpu=GpuGroup.AMPERE_80, workers=5, dependencies=[\"torch\"])\nasync def compute(data):\n    import torch  # MUST import inside function (cloudpickle)\n    return {\"sum\": torch.tensor(data, device=\"cuda\").sum().item()}\n\nresult = await compute([1, 2, 3])\n```\n\n### Mode 2: Your Code (Load-Balanced Routes)\n\nMultiple HTTP routes share one pool of workers.\n\n```python\nfrom runpod_flash import Endpoint, GpuGroup\n\napi = Endpoint(name=\"my-api\", gpu=GpuGroup.ADA_24, workers=(1, 5), dependencies=[\"torch\"])\n\n@api.post(\"\u002Fpredict\")\nasync def predict(data: list[float]):\n    import torch\n    return {\"result\": torch.tensor(data, device=\"cuda\").sum().item()}\n\n@api.get(\"\u002Fhealth\")\nasync def health():\n    return {\"status\": \"ok\"}\n```\n\n### Mode 3: External Image (Client)\n\nDeploy a pre-built Docker image and call it via HTTP.\n\n```python\nfrom runpod_flash import Endpoint, GpuGroup, PodTemplate\n\nserver = Endpoint(\n    name=\"my-server\",\n    image=\"my-org\u002Fmy-image:latest\",\n    gpu=GpuGroup.AMPERE_80,\n    workers=1,\n    env={\"HF_TOKEN\": \"xxx\"},\n    template=PodTemplate(containerDiskInGb=100),\n)\n\n# LB-style\nresult = await server.post(\"\u002Fv1\u002Fcompletions\", {\"prompt\": \"hello\"})\nmodels = await server.get(\"\u002Fv1\u002Fmodels\")\n\n# QB-style\njob = await server.run({\"prompt\": \"hello\"})        # optional: webhook=\"https:\u002F\u002F...\" for completion callback\nawait job.wait()\nprint(job.output)\n```\n\nConnect to an existing endpoint by ID (no provisioning):\n\n```python\nep = Endpoint(id=\"abc123\")\njob = await ep.runsync({\"prompt\": \"hello\"})  # runsync wraps this as {\"input\": {\"prompt\": \"hello\"}}\nprint(job.output)\n```\n\n## How Mode Is Determined\n\n| Parameters | Mode |\n|-----------|------|\n| `name=` only | Decorator (your code) |\n| `image=` set | Client (deploys image, then HTTP calls) |\n| `id=` set | Client (connects to existing, no provisioning) |\n\nThe table above is *how* the mode is picked from params. *When* to reach for `image=`:\n\n### When to use `image=` (custom container) vs your own code\n\nDefault to writing Python (decorator \u002F routes) — it runs arbitrary code with\n`dependencies=[...]`\u002F`system_dependencies=[...]` and needs no Dockerfile. Even large\nHuggingFace models stay in decorator mode (weights stream at runtime — see\n[reference\u002Fpatterns.md → Loading ML models](reference\u002Fpatterns.md#loading-ml-models-warm-workers)).\nReach for `image=` **only** when you need:\n\n- **a pre-built inference server** — vLLM, TensorRT-LLM (`image=\"vllm\u002Fvllm-openai:latest\"`, or `runpod\u002Fworker-vllm`, `runpod\u002Fworker-comfy`)\n- **system-level deps not pip-installable** — a specific CUDA\u002FcuDNN, OS libraries\n- **models baked into the image** — to skip the runtime download entirely\n- **an existing Runpod Serverless worker** — you already have a working image\n\nTrade-off: `image=` mode **can't run arbitrary Python** (the image owns all logic) and the\nimage must implement a Runpod Serverless handler. Full list + examples:\nhttps:\u002F\u002Fdocs.runpod.io\u002Fflash\u002Fcustom-docker-images\n\n## Gotchas\n\n1. **Only the function body ships to the worker** -- most common error. Put imports *and* any module-level constants\u002Fhelpers the function uses *inside* the decorated body. `flash deploy` imports the whole module so module globals happen to work; `flash dev` ships just the body, so a module-level name raises `NameError`. A handler that works deployed can break under dev — fix it by moving everything inside.\n2. **Forgetting await** -- all decorated functions and client methods need `await`.\n3. **Missing dependencies** -- must list in `dependencies=[]`.\n4. **gpu\u002Fcpu are exclusive** -- pick one per Endpoint.\n5. **idle_timeout is seconds** -- default 60s, not minutes.\n6. **10MB payload limit** -- pass URLs, not large objects. Return binary (audio\u002Fimages\u002Ffiles) as base64 in the JSON (`{\"audio_b64\": ...}`) and decode client-side; for larger outputs write to a NetworkVolume or upload to storage and return a URL.\n7. **Client vs decorator** -- `image=`\u002F`id=` = client. Otherwise = decorator.\n8. **Auto GPU switching requires workers >= 5** -- pass a list of GPU types (e.g. `gpu=[GpuGroup.ADA_24, GpuGroup.AMPERE_80]`) and set `workers=5` or higher. The platform only auto-switches GPU types based on supply when max workers is at least 5.\n9. **`runsync` timeout is 60s** -- cold starts can exceed 60s. Use `ep.runsync(data, timeout=120)` for first requests or use `ep.run()` + `job.wait()` instead.\n10. **Request body shape (raw\u002Fexternal HTTP callers only)** -- match the request shape to the endpoint type:\n    - **LB routes** (`@api.post(...)`): send the handler arg at the top level — `{\"data\": {...}}`.\n    - **QB endpoints** (bare `@Endpoint`, hit via `...\u002Frun` or `...\u002Frunsync`): the worker calls\n      **`handler(**job_input)`**, so the request's `input` keys must match the handler's parameter\n      names — `def transcribe(input_data: dict)` wants `{\"input\": {\"input_data\": {...}}}`, and\n      `def read(input: dict)` wants `{\"input\": {\"input\": {...}}}`. A mismatch fails with\n      `got an unexpected keyword argument …`. Use `**kwargs` if the handler ignores the payload.\n    - **Never send an empty `input`.** A QB request with `{\"input\": {}}` is rejected by the\n      worker SDK as `Job has missing field(s): id or input` — always include at least one key.\n    - *Context:* the flash client (`ep.runsync(x)`, `api.post(...)`) hides the spreading, so this\n      only bites raw HTTP\u002Fexternal callers (mismatch behavior verified 2026-07-10 via worker logs).\n      See *Autonomous Dev Loop*.\n11. **Load a model once per worker (not per call)** -- for real inference use a class `@Endpoint` whose `__init__` loads the model once per worker (see [reference\u002Fpatterns.md → Loading ML models](reference\u002Fpatterns.md#loading-ml-models-warm-workers)). In function-form, reconcile with #1 by caching in a module global *inside* the body so it works under both `flash dev` and `deploy`:\n    ```python\n    global _MODEL\n    try: _MODEL\n    except NameError: _MODEL = load_model()   # runs once per worker, reused across calls\n    ```\n12. **Native CUDA libs go in `dependencies=[]` too** -- e.g. CTranslate2\u002Ffaster-whisper needs `nvidia-cublas-cu12` + `nvidia-cudnn-cu12` or it silently falls back to CPU. Add them alongside the Python package.\n13. **Silent 401 auth failure** -- a set `RUNPOD_API_KEY` env var overrides the `flash login` token, so a bad\u002Fexpired key wins. The failure is quiet: provisioning logs `GraphQL request failed: 401`, but `flash dev` still prints its normal ready line (\"failed endpoints deploy on-demand\"), so it *looks* healthy. When endpoints fail to provision:\n    1. Check the provisioning log for `GraphQL request failed: 401`.\n    2. Verify the current key independently: `curl -s -o \u002Fdev\u002Fnull -w '%{http_code}' https:\u002F\u002Frest.runpod.io\u002Fv1\u002Fendpoints -H \"Authorization: Bearer $RUNPOD_API_KEY\"` (200 = good, 401 = bad).\n    3. Fix it: `unset RUNPOD_API_KEY` to fall back to the `flash login` token, or `export` a valid key.\n14. **`system_dependencies=` adds to cold start** -- apt packages (e.g. `[\"ffmpeg\", \"espeak-ng\"]`) install on the worker before first use, so the initial call is slower (on top of any model download); warm calls are unaffected.\n15. **Teardown a deployed app with `flash app delete \u003Capp>`** -- `flash undeploy list` may show \"no endpoints\" for an app that is deployed and serving; `flash app delete` (or `runpodctl serverless delete \u003Cid>`) reliably removes it.\n\n## Resources\n\n- Setup & CLI: [reference\u002Fsetup-and-cli.md](reference\u002Fsetup-and-cli.md) · API & compute enums: [reference\u002Fapi.md](reference\u002Fapi.md) · Patterns: [reference\u002Fpatterns.md](reference\u002Fpatterns.md)\n- Flash source: https:\u002F\u002Fgithub.com\u002Frunpod\u002Fflash\n- Runnable examples: https:\u002F\u002Fgithub.com\u002Frunpod\u002Fflash-examples — clone and adapt the closest one\n- Package (PyPI): https:\u002F\u002Fpypi.org\u002Fproject\u002Frunpod-flash\u002F\n- Docs: https:\u002F\u002Fdocs.runpod.io\u002Fflash\u002Foverview\n  - Custom Docker images (when + how): https:\u002F\u002Fdocs.runpod.io\u002Fflash\u002Fcustom-docker-images\n  - Storage \u002F network volumes: https:\u002F\u002Fdocs.runpod.io\u002Fflash\u002Fconfiguration\u002Fstorage\n",{"name":5,"license":15,"metadata":24,"description":7,"user-invocable":27},{"author":25,"version":26},"runpod","1.2.0",true,"main","7540bbccf0c1ded6156a467b02c95b61ad62413f",".claude\u002Fskills\u002Fflash","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena","Currently exploring the intersection of tech","2026-09-11 03:02:31",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":27},[37,40,43],{"tool":38,"command":39},"npx","npx skills add NeelakshSaxena\u002FVayu --skill flash",{"tool":41,"command":42},"bunx","bunx skills add NeelakshSaxena\u002FVayu --skill flash",{"tool":44,"command":45},"pnpm","pnpm dlx skills add NeelakshSaxena\u002FVayu --skill flash","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflash\u002FSKILL.md",[48,54,58,62,66,72,76,80,84,88],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"evals\u002Fclient-external-image.eval.md","REFERENCE","参考文档",1012,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflash\u002Fevals\u002Fclient-external-image.eval.md",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"evals\u002Fconnect-existing-endpoint.eval.md",932,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflash\u002Fevals\u002Fconnect-existing-endpoint.eval.md",{"path":59,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":60,"sourceHtmlUrl":61},"evals\u002Fcpu-gpu-pipeline.eval.md",1058,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflash\u002Fevals\u002Fcpu-gpu-pipeline.eval.md",{"path":63,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":64,"sourceHtmlUrl":65},"evals\u002Fdev-loop-iteration.eval.md",3484,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflash\u002Fevals\u002Fdev-loop-iteration.eval.md",{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"evals\u002Ffixtures\u002Fdev-loop\u002Fmain.py","SCRIPT","脚本",786,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflash\u002Fevals\u002Ffixtures\u002Fdev-loop\u002Fmain.py",{"path":73,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":74,"sourceHtmlUrl":75},"evals\u002Flb-multi-route-api.eval.md",1067,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflash\u002Fevals\u002Flb-multi-route-api.eval.md",{"path":77,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":78,"sourceHtmlUrl":79},"evals\u002Fqb-gpu-function.eval.md",966,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflash\u002Fevals\u002Fqb-gpu-function.eval.md",{"path":81,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":82,"sourceHtmlUrl":83},"reference\u002Fapi.md",6196,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflash\u002Freference\u002Fapi.md",{"path":85,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":86,"sourceHtmlUrl":87},"reference\u002Fpatterns.md",4837,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflash\u002Freference\u002Fpatterns.md",{"path":89,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":90,"sourceHtmlUrl":91},"reference\u002Fsetup-and-cli.md",3209,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fflash\u002Freference\u002Fsetup-and-cli.md",[93,100,106,113,120,127],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7ACCCVNCFKMA9X6D15X6G98","runpodctl","Runpod CLI for managing GPU\u002FCPU workloads from the terminal — pods, serverless endpoints, templates, network volumes, Hub deploys, models, SSH, and file transfer (send\u002Freceive). Use for terminal\u002FCI\u002Fscripting, Hub browse\u002Fdeploy, SSH setup, `doctor`, or when the Runpod MCP tools are not connected. For structured tool calls in an MCP-enabled session, prefer runpod-mcp.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpodctl\u002FSKILL.md",[],[],{"skillNo":101,"name":25,"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":105,"publishedAt":19},"01M7ACC63SRHEA5KMCHSMZK2TC","Start here for any Runpod task — running GPU\u002FCPU pods, deploying serverless endpoints, templates, network volumes, building images, or understanding how Runpod works. Routes to the right skill (runpod-mcp, runpodctl, flash, companion-clis, runpod-usage, runpod-templates, runpod-migrate) and indexes two dozen live-verified end-to-end examples (golden paths) — use it when the lane is unclear, and for any multi-step or provisioning task even when it is not.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M7ACC0Q1C89N9BZBV91CTQTF","runpod-usage","How Runpod works and how to work it — pods vs serverless, GPU\u002FVRAM selection, storage, building a container, networking, plus the agentic pod development loop (provision → ssh-exec → set up → poll readiness) and on-pod install hygiene (uv\u002Fapt). Use to answer \"how does X work\", \"which GPU\", \"how do I build a container\", or \"how do I stand up a workload on a pod\". Guidance, not a tool — execute with runpodctl, runpod-mcp, or flash.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-usage\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":19},"01M7ACBRPE345GF5GM5B8P8RRC","runpod-templates","Runpod's official prebuilt pod templates (ComfyUI, PyTorch, and others): what each image ships, which ports and paths it uses, how to pick one, how to pin a version, and what is missing on first boot. Use when a task says \"run \u003CX> on a pod\" and an official template already covers it, instead of building an image — and when a user needs help with or wants to fix something about a Runpod template they are already running (won't boot, can't reach the UI, missing models, wrong CUDA line, broken ComfyUI workflow metadata on imported workflows): start here and route onward. Deploy with runpodctl or runpod-mcp; end-to-end walkthroughs live in the runpod router's golden paths.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-templates\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":19},"01M7ACBJATHKVX1TWES2F44GY8","runpod-migrate","Migrate a codebase from the Runpod GraphQL API or REST v1 to REST v2 — inventory which parts use which API version, rewrite the call sites, flag breaking changes, and verify. Use when someone asks to move to v2, asks what v2 would change, or asks which Runpod API their code is on. For managing infrastructure rather than migrating code, use runpod-mcp or runpodctl.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-migrate\u002FSKILL.md",[],[],{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":19},"01M7ACBC7GHVH6T9YEAPCG2AP8","runpod-mcp","Manage Runpod infrastructure — pods, serverless endpoints, jobs, templates, network volumes, container-registry auth, GPU\u002FCPU catalog, and billing — via the Runpod MCP server's structured tool calls. Use when the Runpod MCP tools (create-pod, list-endpoints, …) are connected in this session, or to connect them (hosted OAuth or local npx). Prefer this over runpodctl for plain infra CRUD when MCP is available; use runpodctl for the terminal, file transfer, or SSH setup.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-mcp\u002FSKILL.md",[],[]]