[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EDYHXTQ27J73E4DFG1Q4NJ":3,"skill-same:01M7EDYHXTQ27J73E4DFG1Q4NJ":97},{"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":32,"commitSha":33,"skillDirectory":34,"forksCount":35,"repositoryHtmlUrl":36,"repositoryHomepageUrl":6,"ownerHtmlUrl":37,"ownerBlogUrl":6,"ownerDescription":38,"updatedAt":39,"install":40,"resources":52},"01M7EDYHXTQ27J73E4DFG1Q4NJ","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.","sanjeevafk\u002Fagent-skills","sanjeevafk","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F230678117?v=4","01M7C540EFY46ETG1NNWKS5X3Q","Sanjeev","01M7C540F366J5C1D587BMKH9Q",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\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.7.1\" # x-release-please-version\n  concepts: [flash, serverless-endpoint, serverless-handler, worker]\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\u002Fapi.runpod.io\u002Fv2\u002Fserverless -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\u002Fapi.runpod.io\u002Fv2\u002Fserverless -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":31},{"author":25,"version":26,"concepts":27},"runpod","1.7.1",[5,28,29,30],"serverless-endpoint","serverless-handler","worker",true,"main","4e084e84eb42fc53e144c89c0f7f48b39c8a4b0f","skills\u002Fflash",1,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills","https:\u002F\u002Fgithub.com\u002Fsanjeevafk","First make it work. Then make it right. Then make it fast.","2026-11-14 13:36:16",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":31},[42,45,48],{"tool":43,"command":44},"npx","npx skills add sanjeevafk\u002Fagent-skills --skill flash",{"tool":46,"command":47},"bunx","bunx skills add sanjeevafk\u002Fagent-skills --skill flash",{"tool":49,"command":50},"pnpm","pnpm dlx skills add sanjeevafk\u002Fagent-skills --skill flash","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fflash\u002FSKILL.md",[53,59,63,67,71,77,81,85,89,93],{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"evals\u002Fclient-external-image.eval.md","REFERENCE","参考文档",1012,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fflash\u002Fevals\u002Fclient-external-image.eval.md",{"path":60,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":61,"sourceHtmlUrl":62},"evals\u002Fconnect-existing-endpoint.eval.md",932,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fflash\u002Fevals\u002Fconnect-existing-endpoint.eval.md",{"path":64,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":65,"sourceHtmlUrl":66},"evals\u002Fcpu-gpu-pipeline.eval.md",1058,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fflash\u002Fevals\u002Fcpu-gpu-pipeline.eval.md",{"path":68,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":69,"sourceHtmlUrl":70},"evals\u002Fdev-loop-iteration.eval.md",3484,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fflash\u002Fevals\u002Fdev-loop-iteration.eval.md",{"path":72,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":75,"sourceHtmlUrl":76},"evals\u002Ffixtures\u002Fdev-loop\u002Fmain.py","SCRIPT","脚本",786,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fflash\u002Fevals\u002Ffixtures\u002Fdev-loop\u002Fmain.py",{"path":78,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":79,"sourceHtmlUrl":80},"evals\u002Flb-multi-route-api.eval.md",1067,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fflash\u002Fevals\u002Flb-multi-route-api.eval.md",{"path":82,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":83,"sourceHtmlUrl":84},"evals\u002Fqb-gpu-function.eval.md",966,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fflash\u002Fevals\u002Fqb-gpu-function.eval.md",{"path":86,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":87,"sourceHtmlUrl":88},"reference\u002Fapi.md",6228,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fflash\u002Freference\u002Fapi.md",{"path":90,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":91,"sourceHtmlUrl":92},"reference\u002Fpatterns.md",4837,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fflash\u002Freference\u002Fpatterns.md",{"path":94,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":95,"sourceHtmlUrl":96},"reference\u002Fsetup-and-cli.md",3209,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fflash\u002Freference\u002Fsetup-and-cli.md",[98,106,114,122,130,137],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":102,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M7EFHX67M3KKXT1BXVPA5ADT","zarr-python","Chunked N-D arrays for cloud storage (Zarr-Python 3). Compressed arrays, parallel I\u002FO, S3\u002FGCS via fsspec, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","MIT","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzarr-python\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":102,"licenseFileUrl":110,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":19},"01M7EFFQGM51TZBGRENXY50ZYM","whiteboard-diagrams","Create accurate, simple, hand-drawn whiteboard diagrams from a user's process, system, architecture, learning workflow, comparison, or causal explanation. Use when the user asks for a scribbly whiteboard visual, educational workflow graphic, hand-drawn explainer, or diagram like the bundled reference; ask one focused clarification question when the subject or relationships are missing, then generate and visually verify the final image.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwhiteboard-diagrams\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwhiteboard-diagrams\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":118,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":19},"01M7EFF1CSQNTDMHFK4ZGY6NYK","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":126,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":19},"01M7EFE8106X6C28FT8PA74427","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-artifacts-builder\u002FSKILL.md",[],[],{"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":102,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":136,"publishedAt":19},"01M7EFCSNZM9G7ZHS6F127Q71X","verification-loop","A comprehensive verification system for Claude Code sessions.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[],{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":102,"licenseFileUrl":141,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":19},"01M7EFCE7EZMKPRYDDNKBQ9EEH","vercel-deploy","Deploy applications and websites to Vercel. Use when the user requests deployment actions like \"deploy my app\", \"deploy and give me the link\", \"push this live\", or \"create a preview deployment\".","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-deploy\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-deploy\u002FSKILL.md",[],[]]