[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FEC86Z33BDCMRPD0WK6SZ7":3,"skill-same:01M7FEC86Z33BDCMRPD0WK6SZ7":48},{"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":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7FEC86Z33BDCMRPD0WK6SZ7","vast-gpu",null,"Rent, manage, and destroy GPU instances on vast.ai. Use when user says \"rent gpu\", \"vast.ai\", \"rent a server\", \"cloud gpu\", or needs on-demand GPU without owning hardware.","CZX-LBJ\u002Fdeepseek-science","CZX-LBJ","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F204594689?v=4","01M7FC59WQ9PFXT04MKGJDCFFT","czx","01M7FC59XB2GW0BKWN9JTDBQS7",1,"MIT","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Faris\u002Fskills\u002Fvast-gpu\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: vast-gpu\ndescription: \"Rent, manage, and destroy GPU instances on vast.ai. Use when user says \\\"rent gpu\\\", \\\"vast.ai\\\", \\\"rent a server\\\", \\\"cloud gpu\\\", or needs on-demand GPU without owning hardware.\"\nargument-hint: \"[task-description or action]\"\nallowed-tools: Bash(*), Read, Write, Edit, Grep, Glob\n---\n\n# Vast.ai GPU Management\n\nManage vast.ai GPU instance: $ARGUMENTS\n\n## Overview\n\nRent cheap, capable GPUs from vast.ai on demand. This skill **analyzes the training task** to determine GPU requirements, searches for the best-value offers, presents options with estimated total cost, and handles the full lifecycle: rent → setup → run → destroy.\n\nUsers do NOT specify GPU models or hardware. They describe the task — the skill figures out what to rent.\n\n**Prerequisites:** The `vastai` CLI must be installed (requires **Python ≥ 3.10**) and authenticated:\n```bash\npip install vastai\nvastai set api-key YOUR_API_KEY\n```\n\n> If your system Python is \u003C 3.10, create a virtual environment with Python ≥ 3.10 (e.g., `conda create`, `pyenv`, `uv venv`, etc.) and install `vastai` there.\n\nSSH public key **must be uploaded at https:\u002F\u002Fcloud.vast.ai\u002Fmanage-keys\u002F BEFORE creating any instance**. Keys are baked into instances at creation time — if you add a key after renting, you must destroy and re-create the instance.\n\n## State File\n\nAll active vast.ai instances are tracked in `vast-instances.json` at the project root:\n```json\n[\n  {\n    \"instance_id\": 33799165,\n    \"offer_id\": 25831376,\n    \"gpu_name\": \"RTX_3060\",\n    \"num_gpus\": 1,\n    \"dph\": 0.0414,\n    \"ssh_url\": \"ssh:\u002F\u002Froot@1.208.108.242:58955\",\n    \"ssh_host\": \"1.208.108.242\",\n    \"ssh_port\": 58955,\n    \"created_at\": \"2026-03-29T21:12:00Z\",\n    \"status\": \"running\",\n    \"experiment\": \"exp01_baseline\",\n    \"estimated_hours\": 4.0,\n    \"estimated_cost\": 0.17\n  }\n]\n```\n\nThis file is the source of truth for `\u002Frun-experiment` and `\u002Fmonitor-experiment` to connect to vast.ai instances.\n\n## Workflow\n\n### Action: Provision (default)\n\nAnalyze the task, find the best GPU, and present cost-optimized options. This is the main entry point — called directly or automatically by `\u002Frun-experiment` when `gpu: vast` is set.\n\n**Step 1: Analyze Task Requirements**\n\nRead available context to determine what the task needs:\n\n1. **From the experiment plan** (`refine-logs\u002FEXPERIMENT_PLAN.md`):\n   - Compute budget (total GPU-hours)\n   - Hardware hints (e.g., \"4x RTX 3090\")\n   - Model architecture and dataset size\n   - Run order and per-milestone cost estimates\n\n2. **From experiment scripts** (if already written):\n   - Model size — scan for model class, `num_parameters`, config files\n   - Batch size, sequence length — estimate VRAM from these\n   - Dataset — estimate training time from dataset size + epochs\n   - Multi-GPU — check for `DataParallel`, `DistributedDataParallel`, `accelerate`, `deepspeed`\n\n3. **From user description** (if no plan\u002Fscripts exist):\n   - Model name\u002Fsize (e.g., \"fine-tune LLaMA-7B\", \"train ResNet-50\")\n   - Dataset scale (e.g., \"ImageNet\", \"10k samples\")\n   - Estimated duration (e.g., \"about 2 hours\")\n\n**Step 2: Determine GPU Requirements**\n\nBased on the task analysis, determine:\n\n| Factor | How to estimate |\n|--------|----------------|\n| **Min VRAM** | Model params × 4 bytes (fp32) or × 2 (fp16\u002Fbf16) + optimizer states + activations. Rules of thumb: 7B model ≈ 16 GB (fp16), 13B ≈ 28 GB, 70B ≈ 140 GB (needs multi-GPU). ResNet\u002FViT ≈ 4-8 GB. Add 20% headroom. |\n| **Num GPUs** | 1 unless: model doesn't fit in single GPU VRAM, or scripts use DDP\u002FFSDP\u002FDeepSpeed, or plan specifies multi-GPU |\n| **Est. hours** | From experiment plan's cost column, or: (dataset_size × epochs) \u002F (throughput × batch_size). Default to user estimate if available. Add 30% buffer for setup + unexpected slowdowns |\n| **Min disk** | 20 GB base + model checkpoint size + dataset size. Default: 50 GB |\n| **CUDA version** | Match PyTorch version. PyTorch 2.x needs CUDA ≥ 11.8. Default: 12.1 |\n\n**Step 3: Search Offers**\n\nSearch across multiple GPU tiers to find the best value. Always search broadly — do NOT limit to one GPU model:\n\n```bash\n# Tier 1: Budget GPUs (good for small models, fine-tuning, ablations)\nvastai search offers \"gpu_ram>=\u003CMIN_VRAM> num_gpus>=\u003CN> reliability>0.95 inet_down>100\" -o 'dph+' --storage \u003CDISK> --limit 10\n\n# Tier 2: If VRAM > 24 GB, also search high-VRAM cards specifically\nvastai search offers \"gpu_ram>=48 num_gpus>=\u003CN> reliability>0.95\" -o 'dph+' --storage \u003CDISK> --limit 5\n```\n\nThe output is a table with columns: `ID`, `CUDA`, `N` (GPU count), `Model`, `PCIE`, `cpu_ghz`, `vCPUs`, `RAM`, `Disk`, `$\u002Fhr`, `DLP` (deep learning perf), `score`, `NV Driver`, `Net_up`, `Net_down`, `R` (reliability %), `Max_Days`, `mach_id`, `status`, `host_id`, `ports`, `country`.\n\nThe **first column (`ID`)** is the offer ID needed for `vastai create instance`.\n\n**Step 4: Present Cost-Optimized Options**\n\nPresent **3 options** to the user, ranked by estimated total cost:\n\n```\nTask analysis:\n- Model: [model name\u002Fsize] → estimated VRAM: ~[X] GB\n- Training: ~[Y] hours estimated\n- Requirements: [N] GPU(s), ≥[X] GB VRAM, ~[Z] GB disk\n\nRecommended options (sorted by estimated total cost):\n\n| # | GPU          | VRAM  | $\u002Fhr   | Est. Hours | Est. Total | Reliability | Offer ID  |\n|---|-------------|-------|--------|------------|------------|-------------|-----------|\n| 1 | RTX 3060    | 12 GB | $0.04  | ~6h        | ~$0.25     | 99.4%       | 25831376  |  ← cheapest\n| 2 | RTX 4090    | 24 GB | $0.28  | ~4h        | ~$1.12     | 99.2%       | 6995713   |  ← best value\n| 3 | A100 SXM    | 80 GB | $0.95  | ~2h        | ~$1.90     | 99.5%       | 7023456   |  ← fastest\n\nOption 1 is cheapest overall. Option 3 finishes fastest.\nPick a number (or type a different offer ID):\n```\n\n**Key presentation rules:**\n- Always show **estimated total cost** ($\u002Fhr × estimated hours), not just $\u002Fhr\n- Faster GPUs have shorter estimated hours (scale by relative FLOPS)\n- Flag if a cheap option has reliability \u003C 0.97 (\"budget pick — 3% chance of interruption\")\n- If task is small (\u003C1 hour), recommend interruptible pricing for even lower cost\n- If no offers meet VRAM requirements, explain why and suggest alternatives (e.g., multi-GPU, quantization)\n\n**Relative speed scaling (approximate, for estimating hours across GPU tiers):**\n\n| GPU | Relative Speed (FP16) |\n|-----|-----------------------:|\n| RTX 3060 | 0.5× |\n| RTX 3090 | 1.0× |\n| RTX 4090 | 1.6× |\n| A5000 | 0.9× |\n| A6000 | 1.1× |\n| L40S | 1.5× |\n| A100 SXM | 2.0× |\n| H100 SXM | 3.3× |\n\nUse these to scale the base estimated hours across offers.\n\n### Action: Rent\n\nCreate an instance from a user-selected offer.\n\n**Step 1: Create Instance**\n\n```bash\nvastai create instance \u003COFFER_ID> \\\n  --image \u003CDOCKER_IMAGE> \\\n  --disk \u003CDISK_GB> \\\n  --ssh \\\n  --direct \\\n  --onstart-cmd \"apt-get update && apt-get install -y git screen rsync\"\n```\n\nDefault Docker image: `pytorch\u002Fpytorch:2.1.0-cuda12.1-cudnn8-devel` (override via `CLAUDE.md` `image:` field if set).\n\nThe output looks like:\n```\nStarted. {'success': True, 'new_contract': 33799165, 'instance_api_key': '...'}\n```\n\nThe **`new_contract` value is the instance ID** — save this for all subsequent commands.\n\n**Step 2: Wait for Instance Ready**\n\nPoll instance status every 20 seconds until it's running (typically takes 30-60 seconds, max ~5 minutes):\n```bash\nvastai show instances --raw | python3 -c \"\nimport sys, json\ninstances = json.load(sys.stdin)\nfor inst in instances:\n    if inst['id'] == \u003CINSTANCE_ID>:\n        print(inst['actual_status'])\n\"\n```\n\nWait states: `loading` → `running`. If stuck in `loading` for >5 minutes, warn the user — the host may be slow or the image may be large.\n\n**Step 3: Get SSH Connection Details**\n\n```bash\nvastai ssh-url \u003CINSTANCE_ID>\n```\n\nThis returns a URL in the format: `ssh:\u002F\u002Froot@\u003CHOST>:\u003CPORT>`\n\nParse out host and port from this URL. Example:\n- Input: `ssh:\u002F\u002Froot@1.208.108.242:58955`\n- Host: `1.208.108.242`, Port: `58955`\n\n> **Important:** Always use `vastai ssh-url` to get connection details — do NOT rely on `ssh_host`\u002F`ssh_port` from `vastai show instances`, as those may point to proxy servers that differ from the direct connection endpoint.\n\n**Step 4: Verify SSH Connectivity**\n\n```bash\nssh -o StrictHostKeyChecking=no -o ConnectTimeout=15 -p \u003CPORT> root@\u003CHOST> \"nvidia-smi && echo 'CONNECTION_OK'\"\n```\n\nIf SSH fails with \"Permission denied (publickey)\":\n- The user's SSH key was not uploaded to https:\u002F\u002Fcloud.vast.ai\u002Fmanage-keys\u002F **before** the instance was created\n- **Fix:** Destroy this instance, have user upload their key, then create a new instance. Keys are baked in at creation time — there is no way to add keys to a running instance.\n\nIf SSH fails with \"Connection refused\":\n- The instance may still be initializing. Retry up to 3 times with 15-second intervals.\n\n**Step 5: Update State File**\n\nWrite\u002Fupdate `vast-instances.json` with the new instance details including the `ssh_url` from Step 3, estimated hours and cost.\n\n**Step 6: Report**\n\n```\nVast.ai instance ready:\n- Instance ID: \u003CID>\n- GPU: \u003CGPU_NAME> x \u003CNUM_GPUS>\n- Cost: $\u003CDPH>\u002Fhr (estimated total: ~$\u003CTOTAL>)\n- SSH: ssh -p \u003CPORT> root@\u003CHOST>\n- Docker: \u003CIMAGE>\n\nTo deploy: \u002Frun-experiment (will auto-detect this instance)\nTo destroy when done: \u002Fvast-gpu destroy \u003CID>\n```\n\n### Action: Setup\n\nSet up the rented instance for a specific experiment. Called automatically by `\u002Frun-experiment` when targeting a vast.ai instance.\n\n> Follow `..\u002Fshared-references\u002Fcompute-env-contract.md`: write\u002Freuse the\n> declarative env spec (ordered `pip_phases`, not one big install), record the\n> `env:\u003Cname>@\u003CspecHash>` block in `.aris\u002Fcompute\u002Fvast.md`, and run the seeded\n> kernel witness before launching the real experiment — a fresh instance whose\n> `import torch` succeeds can still have the wrong-SM wheel.\n\n**Step 1: Install Dependencies (render the env spec, phase by phase)**\n\nRender the project's env spec as ORDERED phases — one `pip install` per phase,\nso an earlier phase's pin can't be dragged by a later package:\n\n```bash\n# phase 1: the fought-over pins first (torch\u002Fcuda wheel)\nssh -p \u003CPORT> root@\u003CHOST> \"pip install -q torch==\u003Cpinned>\"\n# phase 2+: everything that must respect those pins\nssh -p \u003CPORT> root@\u003CHOST> \"pip install -q wandb tensorboard scipy scikit-learn pandas\"\n```\n\nLegacy fallback — if the project only has a `requirements.txt` and no env spec,\ninstall it as a single phase, then treat any version fight it causes as the\nsignal to convert it into ordered phases:\n```bash\nscp -P \u003CPORT> requirements.txt root@\u003CHOST>:\u002Fworkspace\u002F\nssh -p \u003CPORT> root@\u003CHOST> \"pip install -q -r \u002Fworkspace\u002Frequirements.txt\"\n```\n\n> Note: `scp` uses uppercase `-P` for port, while `ssh` uses lowercase `-p`.\n\n**Step 2: Sync Code**\n\n```bash\nrsync -avz -e \"ssh -p \u003CPORT>\" \\\n  --include='*.py' --include='*.yaml' --include='*.yml' --include='*.json' \\\n  --include='*.txt' --include='*.sh' --include='*\u002F' \\\n  --exclude='*.pt' --exclude='*.pth' --exclude='*.ckpt' \\\n  --exclude='__pycache__' --exclude='.git' --exclude='data\u002F' \\\n  --exclude='wandb\u002F' --exclude='outputs\u002F' \\\n  .\u002F root@\u003CHOST>:\u002Fworkspace\u002Fproject\u002F\n```\n\n**Step 3: Verify Setup**\n\n```bash\nssh -p \u003CPORT> root@\u003CHOST> \"cd \u002Fworkspace\u002Fproject && python -c 'import torch; print(f\\\"PyTorch {torch.__version__}, CUDA: {torch.cuda.is_available()}, GPUs: {torch.cuda.device_count()}\\\")'\"\n```\n\nExpected output: `PyTorch 2.1.0, CUDA: True, GPUs: 1` (or more GPUs if multi-GPU instance).\n\n### Action: Destroy\n\nTear down a vast.ai instance to stop billing.\n\n**Step 1: Confirm Results Collected**\n\nBefore destroying, check if there are experiment results to download:\n```bash\nssh -p \u003CPORT> root@\u003CHOST> \"ls \u002Fworkspace\u002Fproject\u002Fresults\u002F 2>\u002Fdev\u002Fnull || echo 'NO_RESULTS_DIR'\"\n```\n\nIf results exist, download them first:\n```bash\nrsync -avz -e \"ssh -p \u003CPORT>\" root@\u003CHOST>:\u002Fworkspace\u002Fproject\u002Fresults\u002F .\u002Fresults\u002F\n```\n\nAlso download logs:\n```bash\nscp -P \u003CPORT> root@\u003CHOST>:\u002Fworkspace\u002F*.log .\u002Flogs\u002F 2>\u002Fdev\u002Fnull\n```\n\n**Step 2: Destroy Instance**\n\n```bash\nvastai destroy instance \u003CINSTANCE_ID>\n```\n\nOutput: `destroying instance \u003CINSTANCE_ID>.`\n\n> Destruction is **irreversible** — all data on the instance is permanently deleted.\n\n**Step 3: Update State File**\n\nRemove the instance from `vast-instances.json` or mark its status as `destroyed`.\n\n**Step 4: Report Cost**\n\nCalculate actual cost based on creation time and $\u002Fhr:\n```\nInstance \u003CID> destroyed.\n- Duration: ~X.X hours\n- Actual cost: ~$X.XX (estimated was $Y.YY)\n- Results downloaded to: .\u002Fresults\u002F\n```\n\n### Action: List\n\nShow all active vast.ai instances:\n```bash\nvastai show instances\n```\n\nCross-reference with `vast-instances.json` for experiment associations.\n\n### Action: Destroy All\n\nTear down all active instances (use after all experiments complete):\n\n1. Download results from each instance\n2. Destroy all instances\n3. Clear `vast-instances.json`\n4. Report total cost\n\n## Key Rules\n\n- **Task-driven selection** — NEVER ask users to pick GPU models. Analyze the task, estimate requirements, present cost-optimized options with total price\n- **ALWAYS destroy instances when experiments are done** — vast.ai bills per second, leaving instances running wastes money\n- **Download results before destroying** — data is lost permanently on destroy\n- **Prefer on-demand pricing** for short experiments (\u003C2 hours). Suggest interruptible\u002Fbid pricing for long runs (>4 hours) with checkpointing\n- **Check reliability > 0.95** — unreliable hosts may crash mid-training\n- **Use `--direct` SSH** when creating instances — faster than proxy SSH\n- **Always use `vastai ssh-url \u003CID>`** to get connection details — the host\u002Fport from `show instances` may differ\n- **SSH keys must be uploaded BEFORE creating instances** — keys are baked in at creation time. If SSH fails with \"Permission denied\", destroy and recreate after adding the key\n- **Default Docker image**: `pytorch\u002Fpytorch:2.1.0-cuda12.1-cudnn8-devel` unless user specifies otherwise\n- **Working directory on instance**: `\u002Fworkspace\u002F` (Docker default). Code syncs to `\u002Fworkspace\u002Fproject\u002F`\n- **State file `vast-instances.json` must stay up to date** — other skills depend on it\n- **Show estimated total cost, not just $\u002Fhr** — a $0.90\u002Fhr GPU that finishes in 2h ($1.80) beats a $0.30\u002Fhr GPU that takes 8h ($2.40)\n- **`vastai` CLI requires Python ≥ 3.10** — if system Python is older, use a conda env\n\n## CLAUDE.md Example\n\nUsers only need to set `gpu: vast` — no hardware preferences required:\n\n```markdown\n## Vast.ai\n- gpu: vast                  # tells run-experiment to use vast.ai\n- auto_destroy: true         # auto-destroy after experiment completes (default: true)\n- max_budget: 5.00           # optional: max total $ to spend (skill warns if estimate exceeds this)\n- image: pytorch\u002Fpytorch:2.1.0-cuda12.1-cudnn8-devel  # optional: override Docker image\n```\n\nThe skill analyzes experiment scripts and plans to determine what GPU to rent. No need to specify GPU model, VRAM, or instance count.\n\n## Composing with Other Skills\n\n```\n\u002Frun-experiment \"train model\"       ← detects gpu: vast, calls \u002Fvast-gpu provision\n  ↳ \u002Fvast-gpu provision             ← analyzes task, presents options with cost\n  ↳ user picks option               ← rent + setup + deploy\n  ↳ \u002Fvast-gpu destroy               ← auto-destroy when done (if auto_destroy: true)\n\n\u002Fvast-gpu provision                 ← manual: analyze task + show options\n\u002Fvast-gpu rent \u003Coffer_id>           ← manual: rent a specific offer\n\u002Fvast-gpu list                      ← show active instances\n\u002Fvast-gpu destroy \u003Cinstance_id>     ← tear down, stop billing\n\u002Fvast-gpu destroy-all               ← tear down everything\n```\n","# Vast.ai GPU Management\n\nManage vast.ai GPU instance: $ARGUMENTS\n\n## Overview\n\nRent cheap, capable GPUs from vast.ai on demand. This skill **analyzes the training task** to determine GPU requirements, searches for the best-value offers, presents options with estimated total cost, and handles the full lifecycle: rent → setup → run → destroy.\n\nUsers do NOT specify GPU models or hardware. They describe the task — the skill figures out what to rent.\n\n**Prerequisites:** The `vastai` CLI must be installed (requires **Python ≥ 3.10**) and authenticated:\n```bash\npip install vastai\nvastai set api-key YOUR_API_KEY\n```\n\n> If your system Python is \u003C 3.10, create a virtual environment with Python ≥ 3.10 (e.g., `conda create`, `pyenv`, `uv venv`, etc.) and install `vastai` there.\n\nSSH public key **must be uploaded at https:\u002F\u002Fcloud.vast.ai\u002Fmanage-keys\u002F BEFORE creating any instance**. Keys are baked into instances at creation time — if you add a key after renting, you must destroy and re-create the instance.\n\n## State File\n\nAll active vast.ai instances are tracked in `vast-instances.json` at the project root:\n```json\n[\n  {\n    \"instance_id\": 33799165,\n    \"offer_id\": 25831376,\n    \"gpu_name\": \"RTX_3060\",\n    \"num_gpus\": 1,\n    \"dph\": 0.0414,\n    \"ssh_url\": \"ssh:\u002F\u002Froot@1.208.108.242:58955\",\n    \"ssh_host\": \"1.208.108.242\",\n    \"ssh_port\": 58955,\n    \"created_at\": \"2026-03-29T21:12:00Z\",\n    \"status\": \"running\",\n    \"experiment\": \"exp01_baseline\",\n    \"estimated_hours\": 4.0,\n    \"estimated_cost\": 0.17\n  }\n]\n```\n\nThis file is the source of truth for `\u002Frun-experiment` and `\u002Fmonitor-experiment` to connect to vast.ai instances.\n\n## Workflow\n\n### Action: Provision (default)\n\nAnalyze the task, find the best GPU, and present cost-optimized options. This is the main entry point — called directly or automatically by `\u002Frun-experiment` when `gpu: vast` is set.\n\n**Step 1: Analyze Task Requirements**\n\nRead available context to determine what the task needs:\n\n1. **From the experiment plan** (`refine-logs\u002FEXPERIMENT_PLAN.md`):\n   - Compute budget (total GPU-hours)\n   - Hardware hints (e.g., \"4x RTX 3090\")\n   - Model architecture and dataset size\n   - Run order and per-milestone cost estimates\n\n2. **From experiment scripts** (if already written):\n   - Model size — scan for model class, `num_parameters`, config files\n   - Batch size, sequence length — estimate VRAM from these\n   - Dataset — estimate training time from dataset size + epochs\n   - Multi-GPU — check for `DataParallel`, `DistributedDataParallel`, `accelerate`, `deepspeed`\n\n3. **From user description** (if no plan\u002Fscripts exist):\n   - Model name\u002Fsize (e.g., \"fine-tune LLaMA-7B\", \"train ResNet-50\")\n   - Dataset scale (e.g., \"ImageNet\", \"10k samples\")\n   - Estimated duration (e.g., \"about 2 hours\")\n\n**Step 2: Determine GPU Requirements**\n\nBased on the task analysis, determine:\n\n| Factor | How to estimate |\n|--------|----------------|\n| **Min VRAM** | Model params × 4 bytes (fp32) or × 2 (fp16\u002Fbf16) + optimizer states + activations. Rules of thumb: 7B model ≈ 16 GB (fp16), 13B ≈ 28 GB, 70B ≈ 140 GB (needs multi-GPU). ResNet\u002FViT ≈ 4-8 GB. Add 20% headroom. |\n| **Num GPUs** | 1 unless: model doesn't fit in single GPU VRAM, or scripts use DDP\u002FFSDP\u002FDeepSpeed, or plan specifies multi-GPU |\n| **Est. hours** | From experiment plan's cost column, or: (dataset_size × epochs) \u002F (throughput × batch_size). Default to user estimate if available. Add 30% buffer for setup + unexpected slowdowns |\n| **Min disk** | 20 GB base + model checkpoint size + dataset size. Default: 50 GB |\n| **CUDA version** | Match PyTorch version. PyTorch 2.x needs CUDA ≥ 11.8. Default: 12.1 |\n\n**Step 3: Search Offers**\n\nSearch across multiple GPU tiers to find the best value. Always search broadly — do NOT limit to one GPU model:\n\n```bash\n# Tier 1: Budget GPUs (good for small models, fine-tuning, ablations)\nvastai search offers \"gpu_ram>=\u003CMIN_VRAM> num_gpus>=\u003CN> reliability>0.95 inet_down>100\" -o 'dph+' --storage \u003CDISK> --limit 10\n\n# Tier 2: If VRAM > 24 GB, also search high-VRAM cards specifically\nvastai search offers \"gpu_ram>=48 num_gpus>=\u003CN> reliability>0.95\" -o 'dph+' --storage \u003CDISK> --limit 5\n```\n\nThe output is a table with columns: `ID`, `CUDA`, `N` (GPU count), `Model`, `PCIE`, `cpu_ghz`, `vCPUs`, `RAM`, `Disk`, `$\u002Fhr`, `DLP` (deep learning perf), `score`, `NV Driver`, `Net_up`, `Net_down`, `R` (reliability %), `Max_Days`, `mach_id`, `status`, `host_id`, `ports`, `country`.\n\nThe **first column (`ID`)** is the offer ID needed for `vastai create instance`.\n\n**Step 4: Present Cost-Optimized Options**\n\nPresent **3 options** to the user, ranked by estimated total cost:\n\n```\nTask analysis:\n- Model: [model name\u002Fsize] → estimated VRAM: ~[X] GB\n- Training: ~[Y] hours estimated\n- Requirements: [N] GPU(s), ≥[X] GB VRAM, ~[Z] GB disk\n\nRecommended options (sorted by estimated total cost):\n\n| # | GPU          | VRAM  | $\u002Fhr   | Est. Hours | Est. Total | Reliability | Offer ID  |\n|---|-------------|-------|--------|------------|------------|-------------|-----------|\n| 1 | RTX 3060    | 12 GB | $0.04  | ~6h        | ~$0.25     | 99.4%       | 25831376  |  ← cheapest\n| 2 | RTX 4090    | 24 GB | $0.28  | ~4h        | ~$1.12     | 99.2%       | 6995713   |  ← best value\n| 3 | A100 SXM    | 80 GB | $0.95  | ~2h        | ~$1.90     | 99.5%       | 7023456   |  ← fastest\n\nOption 1 is cheapest overall. Option 3 finishes fastest.\nPick a number (or type a different offer ID):\n```\n\n**Key presentation rules:**\n- Always show **estimated total cost** ($\u002Fhr × estimated hours), not just $\u002Fhr\n- Faster GPUs have shorter estimated hours (scale by relative FLOPS)\n- Flag if a cheap option has reliability \u003C 0.97 (\"budget pick — 3% chance of interruption\")\n- If task is small (\u003C1 hour), recommend interruptible pricing for even lower cost\n- If no offers meet VRAM requirements, explain why and suggest alternatives (e.g., multi-GPU, quantization)\n\n**Relative speed scaling (approximate, for estimating hours across GPU tiers):**\n\n| GPU | Relative Speed (FP16) |\n|-----|-----------------------:|\n| RTX 3060 | 0.5× |\n| RTX 3090 | 1.0× |\n| RTX 4090 | 1.6× |\n| A5000 | 0.9× |\n| A6000 | 1.1× |\n| L40S | 1.5× |\n| A100 SXM | 2.0× |\n| H100 SXM | 3.3× |\n\nUse these to scale the base estimated hours across offers.\n\n### Action: Rent\n\nCreate an instance from a user-selected offer.\n\n**Step 1: Create Instance**\n\n```bash\nvastai create instance \u003COFFER_ID> \\\n  --image \u003CDOCKER_IMAGE> \\\n  --disk \u003CDISK_GB> \\\n  --ssh \\\n  --direct \\\n  --onstart-cmd \"apt-get update && apt-get install -y git screen rsync\"\n```\n\nDefault Docker image: `pytorch\u002Fpytorch:2.1.0-cuda12.1-cudnn8-devel` (override via `CLAUDE.md` `image:` field if set).\n\nThe output looks like:\n```\nStarted. {'success': True, 'new_contract': 33799165, 'instance_api_key': '...'}\n```\n\nThe **`new_contract` value is the instance ID** — save this for all subsequent commands.\n\n**Step 2: Wait for Instance Ready**\n\nPoll instance status every 20 seconds until it's running (typically takes 30-60 seconds, max ~5 minutes):\n```bash\nvastai show instances --raw | python3 -c \"\nimport sys, json\ninstances = json.load(sys.stdin)\nfor inst in instances:\n    if inst['id'] == \u003CINSTANCE_ID>:\n        print(inst['actual_status'])\n\"\n```\n\nWait states: `loading` → `running`. If stuck in `loading` for >5 minutes, warn the user — the host may be slow or the image may be large.\n\n**Step 3: Get SSH Connection Details**\n\n```bash\nvastai ssh-url \u003CINSTANCE_ID>\n```\n\nThis returns a URL in the format: `ssh:\u002F\u002Froot@\u003CHOST>:\u003CPORT>`\n\nParse out host and port from this URL. Example:\n- Input: `ssh:\u002F\u002Froot@1.208.108.242:58955`\n- Host: `1.208.108.242`, Port: `58955`\n\n> **Important:** Always use `vastai ssh-url` to get connection details — do NOT rely on `ssh_host`\u002F`ssh_port` from `vastai show instances`, as those may point to proxy servers that differ from the direct connection endpoint.\n\n**Step 4: Verify SSH Connectivity**\n\n```bash\nssh -o StrictHostKeyChecking=no -o ConnectTimeout=15 -p \u003CPORT> root@\u003CHOST> \"nvidia-smi && echo 'CONNECTION_OK'\"\n```\n\nIf SSH fails with \"Permission denied (publickey)\":\n- The user's SSH key was not uploaded to https:\u002F\u002Fcloud.vast.ai\u002Fmanage-keys\u002F **before** the instance was created\n- **Fix:** Destroy this instance, have user upload their key, then create a new instance. Keys are baked in at creation time — there is no way to add keys to a running instance.\n\nIf SSH fails with \"Connection refused\":\n- The instance may still be initializing. Retry up to 3 times with 15-second intervals.\n\n**Step 5: Update State File**\n\nWrite\u002Fupdate `vast-instances.json` with the new instance details including the `ssh_url` from Step 3, estimated hours and cost.\n\n**Step 6: Report**\n\n```\nVast.ai instance ready:\n- Instance ID: \u003CID>\n- GPU: \u003CGPU_NAME> x \u003CNUM_GPUS>\n- Cost: $\u003CDPH>\u002Fhr (estimated total: ~$\u003CTOTAL>)\n- SSH: ssh -p \u003CPORT> root@\u003CHOST>\n- Docker: \u003CIMAGE>\n\nTo deploy: \u002Frun-experiment (will auto-detect this instance)\nTo destroy when done: \u002Fvast-gpu destroy \u003CID>\n```\n\n### Action: Setup\n\nSet up the rented instance for a specific experiment. Called automatically by `\u002Frun-experiment` when targeting a vast.ai instance.\n\n> Follow `..\u002Fshared-references\u002Fcompute-env-contract.md`: write\u002Freuse the\n> declarative env spec (ordered `pip_phases`, not one big install), record the\n> `env:\u003Cname>@\u003CspecHash>` block in `.aris\u002Fcompute\u002Fvast.md`, and run the seeded\n> kernel witness before launching the real experiment — a fresh instance whose\n> `import torch` succeeds can still have the wrong-SM wheel.\n\n**Step 1: Install Dependencies (render the env spec, phase by phase)**\n\nRender the project's env spec as ORDERED phases — one `pip install` per phase,\nso an earlier phase's pin can't be dragged by a later package:\n\n```bash\n# phase 1: the fought-over pins first (torch\u002Fcuda wheel)\nssh -p \u003CPORT> root@\u003CHOST> \"pip install -q torch==\u003Cpinned>\"\n# phase 2+: everything that must respect those pins\nssh -p \u003CPORT> root@\u003CHOST> \"pip install -q wandb tensorboard scipy scikit-learn pandas\"\n```\n\nLegacy fallback — if the project only has a `requirements.txt` and no env spec,\ninstall it as a single phase, then treat any version fight it causes as the\nsignal to convert it into ordered phases:\n```bash\nscp -P \u003CPORT> requirements.txt root@\u003CHOST>:\u002Fworkspace\u002F\nssh -p \u003CPORT> root@\u003CHOST> \"pip install -q -r \u002Fworkspace\u002Frequirements.txt\"\n```\n\n> Note: `scp` uses uppercase `-P` for port, while `ssh` uses lowercase `-p`.\n\n**Step 2: Sync Code**\n\n```bash\nrsync -avz -e \"ssh -p \u003CPORT>\" \\\n  --include='*.py' --include='*.yaml' --include='*.yml' --include='*.json' \\\n  --include='*.txt' --include='*.sh' --include='*\u002F' \\\n  --exclude='*.pt' --exclude='*.pth' --exclude='*.ckpt' \\\n  --exclude='__pycache__' --exclude='.git' --exclude='data\u002F' \\\n  --exclude='wandb\u002F' --exclude='outputs\u002F' \\\n  .\u002F root@\u003CHOST>:\u002Fworkspace\u002Fproject\u002F\n```\n\n**Step 3: Verify Setup**\n\n```bash\nssh -p \u003CPORT> root@\u003CHOST> \"cd \u002Fworkspace\u002Fproject && python -c 'import torch; print(f\\\"PyTorch {torch.__version__}, CUDA: {torch.cuda.is_available()}, GPUs: {torch.cuda.device_count()}\\\")'\"\n```\n\nExpected output: `PyTorch 2.1.0, CUDA: True, GPUs: 1` (or more GPUs if multi-GPU instance).\n\n### Action: Destroy\n\nTear down a vast.ai instance to stop billing.\n\n**Step 1: Confirm Results Collected**\n\nBefore destroying, check if there are experiment results to download:\n```bash\nssh -p \u003CPORT> root@\u003CHOST> \"ls \u002Fworkspace\u002Fproject\u002Fresults\u002F 2>\u002Fdev\u002Fnull || echo 'NO_RESULTS_DIR'\"\n```\n\nIf results exist, download them first:\n```bash\nrsync -avz -e \"ssh -p \u003CPORT>\" root@\u003CHOST>:\u002Fworkspace\u002Fproject\u002Fresults\u002F .\u002Fresults\u002F\n```\n\nAlso download logs:\n```bash\nscp -P \u003CPORT> root@\u003CHOST>:\u002Fworkspace\u002F*.log .\u002Flogs\u002F 2>\u002Fdev\u002Fnull\n```\n\n**Step 2: Destroy Instance**\n\n```bash\nvastai destroy instance \u003CINSTANCE_ID>\n```\n\nOutput: `destroying instance \u003CINSTANCE_ID>.`\n\n> Destruction is **irreversible** — all data on the instance is permanently deleted.\n\n**Step 3: Update State File**\n\nRemove the instance from `vast-instances.json` or mark its status as `destroyed`.\n\n**Step 4: Report Cost**\n\nCalculate actual cost based on creation time and $\u002Fhr:\n```\nInstance \u003CID> destroyed.\n- Duration: ~X.X hours\n- Actual cost: ~$X.XX (estimated was $Y.YY)\n- Results downloaded to: .\u002Fresults\u002F\n```\n\n### Action: List\n\nShow all active vast.ai instances:\n```bash\nvastai show instances\n```\n\nCross-reference with `vast-instances.json` for experiment associations.\n\n### Action: Destroy All\n\nTear down all active instances (use after all experiments complete):\n\n1. Download results from each instance\n2. Destroy all instances\n3. Clear `vast-instances.json`\n4. Report total cost\n\n## Key Rules\n\n- **Task-driven selection** — NEVER ask users to pick GPU models. Analyze the task, estimate requirements, present cost-optimized options with total price\n- **ALWAYS destroy instances when experiments are done** — vast.ai bills per second, leaving instances running wastes money\n- **Download results before destroying** — data is lost permanently on destroy\n- **Prefer on-demand pricing** for short experiments (\u003C2 hours). Suggest interruptible\u002Fbid pricing for long runs (>4 hours) with checkpointing\n- **Check reliability > 0.95** — unreliable hosts may crash mid-training\n- **Use `--direct` SSH** when creating instances — faster than proxy SSH\n- **Always use `vastai ssh-url \u003CID>`** to get connection details — the host\u002Fport from `show instances` may differ\n- **SSH keys must be uploaded BEFORE creating instances** — keys are baked in at creation time. If SSH fails with \"Permission denied\", destroy and recreate after adding the key\n- **Default Docker image**: `pytorch\u002Fpytorch:2.1.0-cuda12.1-cudnn8-devel` unless user specifies otherwise\n- **Working directory on instance**: `\u002Fworkspace\u002F` (Docker default). Code syncs to `\u002Fworkspace\u002Fproject\u002F`\n- **State file `vast-instances.json` must stay up to date** — other skills depend on it\n- **Show estimated total cost, not just $\u002Fhr** — a $0.90\u002Fhr GPU that finishes in 2h ($1.80) beats a $0.30\u002Fhr GPU that takes 8h ($2.40)\n- **`vastai` CLI requires Python ≥ 3.10** — if system Python is older, use a conda env\n\n## CLAUDE.md Example\n\nUsers only need to set `gpu: vast` — no hardware preferences required:\n\n```markdown\n## Vast.ai\n- gpu: vast                  # tells run-experiment to use vast.ai\n- auto_destroy: true         # auto-destroy after experiment completes (default: true)\n- max_budget: 5.00           # optional: max total $ to spend (skill warns if estimate exceeds this)\n- image: pytorch\u002Fpytorch:2.1.0-cuda12.1-cudnn8-devel  # optional: override Docker image\n```\n\nThe skill analyzes experiment scripts and plans to determine what GPU to rent. No need to specify GPU model, VRAM, or instance count.\n\n## Composing with Other Skills\n\n```\n\u002Frun-experiment \"train model\"       ← detects gpu: vast, calls \u002Fvast-gpu provision\n  ↳ \u002Fvast-gpu provision             ← analyzes task, presents options with cost\n  ↳ user picks option               ← rent + setup + deploy\n  ↳ \u002Fvast-gpu destroy               ← auto-destroy when done (if auto_destroy: true)\n\n\u002Fvast-gpu provision                 ← manual: analyze task + show options\n\u002Fvast-gpu rent \u003Coffer_id>           ← manual: rent a specific offer\n\u002Fvast-gpu list                      ← show active instances\n\u002Fvast-gpu destroy \u003Cinstance_id>     ← tear down, stop billing\n\u002Fvast-gpu destroy-all               ← tear down everything\n```\n",{"name":5,"description":7,"allowed-tools":24,"argument-hint":25},"Bash(*), Read, Write, Edit, Grep, Glob","[task-description or action]","main","18193d71ea3441d7c033dbf195b8a7c75ac96f75","packages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Faris\u002Fskills\u002Fvast-gpu",0,"https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science","https:\u002F\u002Fgithub.com\u002FCZX-LBJ","一个没事喜欢随便写点代码的小菜鸡\r\n","2026-10-22 09:48:04",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add CZX-LBJ\u002Fdeepseek-science --skill vast-gpu",{"tool":40,"command":41},"bunx","bunx skills add CZX-LBJ\u002Fdeepseek-science --skill vast-gpu",{"tool":43,"command":44},"pnpm","pnpm dlx skills add CZX-LBJ\u002Fdeepseek-science --skill vast-gpu","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Faris\u002Fskills\u002Fvast-gpu\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7FEEKSNMRMKW6JEK93PFDFY","bio-free-energy-calculations","Performs alchemical free-energy calculations including relative binding free energy (RBFE \u002F FEP+) and absolute binding free energy (ABFE) via OpenFE, FEP+, GROMACS, AMBER pmemd, and OpenMM with explicit lambda scheduling, soft-core potentials, MBAR\u002FBAR analysis, cycle-closure validation, and protocol-appropriate enhanced sampling. Compares ML alternatives (Boltz-2 affinity, DeepDock). Use when ranking analogs by binding affinity beyond docking accuracy, performing prospective lead optimization, or validating SAR predictions.","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Fbioskills\u002Fchemoinformatics\u002Ffree-energy-calculations\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7FEE5CTE5QK55CEMXNNVWY9","bio-conformer-generation","Generates 3D conformer ensembles using RDKit ETKDGv3 with knowledge-enhanced distance geometry, MMFF94\u002FUFF force-field optimization, CREST + GFN2-xTB semi-empirical refinement, and macrocycle-aware torsion preferences. Provides explicit decision rules for single vs ensemble conformer use, RMSD pruning, energy windows, conformer count, and force-field choice. Use when preparing 3D ligands for docking, generating descriptor input for 3D QSAR, or sampling macrocycle\u002Fpeptide conformational ensembles.","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Fbioskills\u002Fchemoinformatics\u002Fconformer-generation\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7FEDNGFEMFWD1MSEDR5H7CY","bio-admet-prediction","Predicts ADMET properties using ADMETlab 3.0 (119 platform features, including 77 prediction models with modeled-endpoint uncertainty), ADMET-AI, DeepChem MolNet, and chemprop D-MPNN with explicit handling of OECD QSAR principles, applicability domain assessment, calibration, hERG\u002FCYP\u002FAMES endpoints, and PAINS \u002F Lipinski \u002F Ro5 \u002F Veber \u002F BBB druglikeness filters. Use when filtering compounds for drug-likeness, prioritizing leads by predicted safety, or building an in-house ADMET QSAR model.","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Fbioskills\u002Fchemoinformatics\u002Fadmet-prediction\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7FED69GFB54FRF7AV5066DN","writing-systems-papers","Paragraph-level structural blueprint for 10-12 page systems papers targeting OSDI, SOSP, ASPLOS, NSDI, and EuroSys. Provides page allocation, paragraph templates, and writing patterns. Use when user says \"写系统论文\", \"systems paper structure\", \"OSDI paper\", \"SOSP paper\", or wants fine-grained structural guidance for a systems conference submission.","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Faris\u002Fskills\u002Fwriting-systems-papers\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7FECVVDWZ0X0VEDTCE4B4DZ","wiki-enrich","Fill in the per-paper TODO sections of research-wiki\u002Fpapers\u002F\u003Cslug>.md pages that literature-ingest skills leave as bare scaffolds. Use when user says 'enrich wiki', 'fill paper TODOs', 'wiki body 補完', '把 paper 摘要寫進 wiki', 'research-wiki 自動填', or after a batch ingest that left papers\u002F as TODO scaffolds.","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Faris\u002Fskills\u002Fwiki-enrich\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7FECD4BCJ2MTSBDDSE3ZAJ5","web-debug-search","Search GitHub, Stack Exchange, Chinese technical communities, official documentation, and general developer web sources for software errors, compatibility problems, API usage questions, and real-world workarounds. Use for debugging and discovery only; results are not paper-citation evidence.","https:\u002F\u002Fgithub.com\u002FCZX-LBJ\u002Fdeepseek-science\u002Fblob\u002Fmain\u002Fpackages\u002Fskill\u002Fskill-science\u002Fassets\u002Fsources\u002Faris\u002Fskills\u002Fweb-debug-search\u002FSKILL.md",[],[]]