[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M796X27JSB2XFRNK7MA9BV6F":3,"skill-same:01M796X27JSB2XFRNK7MA9BV6F":56},{"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":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":6,"ownerHtmlUrl":38,"ownerBlogUrl":39,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"01M796X27JSB2XFRNK7MA9BV6F","vastai-webhooks-events",null,"Build event-driven workflows around Vast.ai instance lifecycle events.\nUse when monitoring instance status changes, implementing auto-recovery,\nor building event-driven GPU orchestration.\nTrigger with phrases like \"vastai events\", \"vastai instance monitoring\",\n\"vastai status changes\", \"vastai lifecycle events\".","jukeyman\u002Fjukeyman-skills","jukeyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142960420?v=4","01M78FR4Y3DHMMCBCC0GXXNB3F","RICK JEFFERSON","01M78FR4Z8RVQRAD31Y5J7V6EB",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--vastai-pack--vastai-webhooks-events\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: vastai-webhooks-events\ndescription: |\n  Build event-driven workflows around Vast.ai instance lifecycle events.\n  Use when monitoring instance status changes, implementing auto-recovery,\n  or building event-driven GPU orchestration.\n  Trigger with phrases like \"vastai events\", \"vastai instance monitoring\",\n  \"vastai status changes\", \"vastai lifecycle events\".\nallowed-tools: Read, Write, Edit, Bash(vastai:*), Bash(curl:*)\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ncompatible-with: claude-code, codex, openclaw\ntags: [saas, vast-ai, webhooks]\n---\n# Vast.ai Webhooks & Events\n\n## Overview\nBuild event-driven workflows around Vast.ai GPU instance lifecycle. Vast.ai does not provide traditional webhooks, so event detection relies on polling the REST API at `cloud.vast.ai\u002Fapi\u002Fv0` and reacting to instance status transitions (loading, running, exited, error, offline).\n\n## Prerequisites\n- Vast.ai CLI authenticated\n- Understanding of instance lifecycle states\n- Python 3.8+ for event loop implementation\n\n## Instructions\n\n### Step 1: Instance Status Poller\n\n```python\nimport time, json, subprocess\nfrom typing import Callable, Dict, List\n\nclass InstanceEventPoller:\n    \"\"\"Poll Vast.ai API and emit events on status transitions.\"\"\"\n\n    def __init__(self, api_key: str, poll_interval: int = 30):\n        self.api_key = api_key\n        self.poll_interval = poll_interval\n        self.previous_states: Dict[int, str] = {}\n        self.handlers: Dict[str, List[Callable]] = {}\n\n    def on(self, event: str, handler: Callable):\n        self.handlers.setdefault(event, []).append(handler)\n\n    def poll_once(self):\n        result = subprocess.run(\n            [\"vastai\", \"show\", \"instances\", \"--raw\"],\n            capture_output=True, text=True)\n        instances = json.loads(result.stdout)\n\n        for inst in instances:\n            inst_id = inst[\"id\"]\n            status = inst.get(\"actual_status\", \"unknown\")\n            prev = self.previous_states.get(inst_id)\n\n            if prev and prev != status:\n                event = f\"{prev}_to_{status}\"\n                for handler in self.handlers.get(event, []):\n                    handler(inst)\n                for handler in self.handlers.get(\"any_change\", []):\n                    handler(inst, prev, status)\n\n            self.previous_states[inst_id] = status\n\n    def run(self):\n        print(f\"Polling every {self.poll_interval}s...\")\n        while True:\n            self.poll_once()\n            time.sleep(self.poll_interval)\n```\n\n### Step 2: Event Handlers\n\n```python\ndef on_instance_running(instance):\n    print(f\"Instance {instance['id']} is RUNNING\")\n    print(f\"  SSH: ssh -p {instance['ssh_port']} root@{instance['ssh_host']}\")\n    # Trigger: start training job, send notification, etc.\n\ndef on_instance_exited(instance):\n    print(f\"Instance {instance['id']} EXITED\")\n    # Trigger: collect results, check for errors, notify team\n\ndef on_spot_preemption(instance, old_status, new_status):\n    if old_status == \"running\" and new_status in (\"exited\", \"offline\"):\n        print(f\"ALERT: Instance {instance['id']} may have been preempted\")\n        # Trigger: auto-recovery, provision replacement\n\n# Wire up handlers\npoller = InstanceEventPoller(api_key)\npoller.on(\"loading_to_running\", on_instance_running)\npoller.on(\"running_to_exited\", on_instance_exited)\npoller.on(\"any_change\", on_spot_preemption)\npoller.run()\n```\n\n### Step 3: Auto-Recovery on Preemption\n\n```python\ndef auto_recover(instance, old_status, new_status):\n    \"\"\"Automatically replace preempted instances.\"\"\"\n    if old_status != \"running\" or new_status not in (\"exited\", \"offline\", \"error\"):\n        return\n\n    gpu_name = instance.get(\"gpu_name\", \"RTX_4090\")\n    image = instance.get(\"image_uuid\", \"pytorch\u002Fpytorch:latest\")\n\n    print(f\"Auto-recovering {instance['id']} ({gpu_name})...\")\n\n    # Search for replacement\n    offers = json.loads(subprocess.run(\n        [\"vastai\", \"search\", \"offers\",\n         f\"gpu_name={gpu_name} reliability>0.98 rentable=true\",\n         \"--order\", \"dph_total\", \"--raw\", \"--limit\", \"3\"],\n        capture_output=True, text=True, check=True).stdout)\n\n    if offers:\n        new_id = json.loads(subprocess.run(\n            [\"vastai\", \"create\", \"instance\", str(offers[0][\"id\"]),\n             \"--image\", image, \"--disk\", \"50\", \"--raw\"],\n            capture_output=True, text=True, check=True).stdout)[\"new_contract\"]\n        print(f\"Replacement instance: {new_id}\")\n```\n\n### Step 4: Cost Event Tracking\n\n```python\ndef track_costs(instance, old_status, new_status):\n    \"\"\"Log cost events for billing tracking.\"\"\"\n    if new_status == \"running\":\n        print(f\"BILLING START: Instance {instance['id']} \"\n              f\"at ${instance.get('dph_total', 0):.3f}\u002Fhr\")\n    elif old_status == \"running\":\n        print(f\"BILLING STOP: Instance {instance['id']}\")\n```\n\n## Output\n- Polling-based event detection for instance status changes\n- Event handlers for running, exited, preempted states\n- Auto-recovery on spot preemption\n- Cost tracking event logger\n\n## Error Handling\n| Error | Cause | Solution |\n|-------|-------|----------|\n| Missed status transition | Poll interval too long | Reduce to 15-30s for critical instances |\n| False preemption alert | Instance restarted intentionally | Track expected state changes |\n| Auto-recovery loops | Same host keeps failing | Exclude failed host IDs from search |\n| API timeout during poll | Network or rate limiting | Retry with backoff; continue polling |\n\n## Resources\n- [Vast.ai REST API](https:\u002F\u002Fvast.ai\u002Fdevelopers\u002Fapi)\n- [Instance Management](https:\u002F\u002Fdocs.vast.ai\u002Fapi-reference\u002Finstances\u002Fcreate-instance)\n\n## Next Steps\nFor performance optimization, see `vastai-performance-tuning`.\n\n## Examples\n\n**Slack notifications**: Wire `on_instance_running` to send a Slack message with SSH connection details. Wire `on_spot_preemption` to alert the team.\n\n**Training monitor**: Track `running_to_exited` events. If exit was expected (job complete), collect results. If unexpected, trigger auto-recovery with checkpoint resume.\n","# Vast.ai Webhooks & Events\n\n## Overview\nBuild event-driven workflows around Vast.ai GPU instance lifecycle. Vast.ai does not provide traditional webhooks, so event detection relies on polling the REST API at `cloud.vast.ai\u002Fapi\u002Fv0` and reacting to instance status transitions (loading, running, exited, error, offline).\n\n## Prerequisites\n- Vast.ai CLI authenticated\n- Understanding of instance lifecycle states\n- Python 3.8+ for event loop implementation\n\n## Instructions\n\n### Step 1: Instance Status Poller\n\n```python\nimport time, json, subprocess\nfrom typing import Callable, Dict, List\n\nclass InstanceEventPoller:\n    \"\"\"Poll Vast.ai API and emit events on status transitions.\"\"\"\n\n    def __init__(self, api_key: str, poll_interval: int = 30):\n        self.api_key = api_key\n        self.poll_interval = poll_interval\n        self.previous_states: Dict[int, str] = {}\n        self.handlers: Dict[str, List[Callable]] = {}\n\n    def on(self, event: str, handler: Callable):\n        self.handlers.setdefault(event, []).append(handler)\n\n    def poll_once(self):\n        result = subprocess.run(\n            [\"vastai\", \"show\", \"instances\", \"--raw\"],\n            capture_output=True, text=True)\n        instances = json.loads(result.stdout)\n\n        for inst in instances:\n            inst_id = inst[\"id\"]\n            status = inst.get(\"actual_status\", \"unknown\")\n            prev = self.previous_states.get(inst_id)\n\n            if prev and prev != status:\n                event = f\"{prev}_to_{status}\"\n                for handler in self.handlers.get(event, []):\n                    handler(inst)\n                for handler in self.handlers.get(\"any_change\", []):\n                    handler(inst, prev, status)\n\n            self.previous_states[inst_id] = status\n\n    def run(self):\n        print(f\"Polling every {self.poll_interval}s...\")\n        while True:\n            self.poll_once()\n            time.sleep(self.poll_interval)\n```\n\n### Step 2: Event Handlers\n\n```python\ndef on_instance_running(instance):\n    print(f\"Instance {instance['id']} is RUNNING\")\n    print(f\"  SSH: ssh -p {instance['ssh_port']} root@{instance['ssh_host']}\")\n    # Trigger: start training job, send notification, etc.\n\ndef on_instance_exited(instance):\n    print(f\"Instance {instance['id']} EXITED\")\n    # Trigger: collect results, check for errors, notify team\n\ndef on_spot_preemption(instance, old_status, new_status):\n    if old_status == \"running\" and new_status in (\"exited\", \"offline\"):\n        print(f\"ALERT: Instance {instance['id']} may have been preempted\")\n        # Trigger: auto-recovery, provision replacement\n\n# Wire up handlers\npoller = InstanceEventPoller(api_key)\npoller.on(\"loading_to_running\", on_instance_running)\npoller.on(\"running_to_exited\", on_instance_exited)\npoller.on(\"any_change\", on_spot_preemption)\npoller.run()\n```\n\n### Step 3: Auto-Recovery on Preemption\n\n```python\ndef auto_recover(instance, old_status, new_status):\n    \"\"\"Automatically replace preempted instances.\"\"\"\n    if old_status != \"running\" or new_status not in (\"exited\", \"offline\", \"error\"):\n        return\n\n    gpu_name = instance.get(\"gpu_name\", \"RTX_4090\")\n    image = instance.get(\"image_uuid\", \"pytorch\u002Fpytorch:latest\")\n\n    print(f\"Auto-recovering {instance['id']} ({gpu_name})...\")\n\n    # Search for replacement\n    offers = json.loads(subprocess.run(\n        [\"vastai\", \"search\", \"offers\",\n         f\"gpu_name={gpu_name} reliability>0.98 rentable=true\",\n         \"--order\", \"dph_total\", \"--raw\", \"--limit\", \"3\"],\n        capture_output=True, text=True, check=True).stdout)\n\n    if offers:\n        new_id = json.loads(subprocess.run(\n            [\"vastai\", \"create\", \"instance\", str(offers[0][\"id\"]),\n             \"--image\", image, \"--disk\", \"50\", \"--raw\"],\n            capture_output=True, text=True, check=True).stdout)[\"new_contract\"]\n        print(f\"Replacement instance: {new_id}\")\n```\n\n### Step 4: Cost Event Tracking\n\n```python\ndef track_costs(instance, old_status, new_status):\n    \"\"\"Log cost events for billing tracking.\"\"\"\n    if new_status == \"running\":\n        print(f\"BILLING START: Instance {instance['id']} \"\n              f\"at ${instance.get('dph_total', 0):.3f}\u002Fhr\")\n    elif old_status == \"running\":\n        print(f\"BILLING STOP: Instance {instance['id']}\")\n```\n\n## Output\n- Polling-based event detection for instance status changes\n- Event handlers for running, exited, preempted states\n- Auto-recovery on spot preemption\n- Cost tracking event logger\n\n## Error Handling\n| Error | Cause | Solution |\n|-------|-------|----------|\n| Missed status transition | Poll interval too long | Reduce to 15-30s for critical instances |\n| False preemption alert | Instance restarted intentionally | Track expected state changes |\n| Auto-recovery loops | Same host keeps failing | Exclude failed host IDs from search |\n| API timeout during poll | Network or rate limiting | Retry with backoff; continue polling |\n\n## Resources\n- [Vast.ai REST API](https:\u002F\u002Fvast.ai\u002Fdevelopers\u002Fapi)\n- [Instance Management](https:\u002F\u002Fdocs.vast.ai\u002Fapi-reference\u002Finstances\u002Fcreate-instance)\n\n## Next Steps\nFor performance optimization, see `vastai-performance-tuning`.\n\n## Examples\n\n**Slack notifications**: Wire `on_instance_running` to send a Slack message with SSH connection details. Wire `on_spot_preemption` to alert the team.\n\n**Training monitor**: Track `running_to_exited` events. If exit was expected (job complete), collect results. If unexpected, trigger auto-recovery with checkpoint resume.\n",{"name":5,"tags":24,"author":28,"license":15,"version":29,"description":30,"allowed-tools":31,"compatible-with":32},[25,26,27],"saas","vast-ai","webhooks","Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Build event-driven workflows around Vast.ai instance lifecycle events.\nUse when monitoring instance status changes, implementing auto-recovery,\nor building event-driven GPU orchestration.\nTrigger with phrases like \"vastai events\", \"vastai instance monitoring\",\n\"vastai status changes\", \"vastai lifecycle events\".\n","Read, Write, Edit, Bash(vastai:*), Bash(curl:*)","claude-code, codex, openclaw","main","99825ad3f3bcc6597ddcc7294a14e6e922f2b67b","skills\u002Fsaas-packs--vastai-pack--vastai-webhooks-events",0,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills","https:\u002F\u002Fgithub.com\u002Fjukeyman","https:\u002F\u002FRJBUSINESSSOLUTIONS.ORG","Credit and Finance Expert | Developer\r\n\r\nI'm Rick Jefferson, a seasoned credit and finance expert with over a decade of experience in financial literacy,","2026-07-13 07:03:29",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add jukeyman\u002Fjukeyman-skills --skill vastai-webhooks-events",{"tool":48,"command":49},"bunx","bunx skills add jukeyman\u002Fjukeyman-skills --skill vastai-webhooks-events",{"tool":51,"command":52},"pnpm","pnpm dlx skills add jukeyman\u002Fjukeyman-skills --skill vastai-webhooks-events","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--vastai-pack--vastai-webhooks-events\u002FSKILL.md",true,[],[57,64,71,78,85,93],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M79ANS2SM329NEP5ZCX106RR","zustand-store-creator","Create zustand store creator operations. Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like \"zustand store creator\", \"zustand creator\", \"zustand\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M79AMZKP4YDEZ7EHG1Y7PP74","zero-trust-config-helper","Configure with zero trust config helper operations. Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like \"zero trust config helper\", \"zero helper\", \"zero\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M79AMJSBCEJQNBTYNAHYN5HM","zapier-integration-helper","Assist with zapier integration helper operations. Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like \"zapier integration helper\", \"zapier helper\", \"zapier\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M79AHJZGVMARS13VFQYRR1MP","yaml-config-validator","Validate yaml config validator operations. Auto-activating skill for DevOps Basics.\nTriggers on: yaml config validator, yaml config validator\nPart of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like \"yaml config validator\", \"yaml validator\", \"yaml\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fyaml-config-validator\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M79AHGDZRN0020RDQSQDPAM8","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FSKILL.md",[],[],{"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},"01M79AHCYJ9FV9RMHQ24HDRN33","xss-vulnerability-scanner","Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals.\nTriggers on: xss vulnerability scanner, xss vulnerability scanner\nPart of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like \"xss vulnerability scanner\", \"xss scanner\", \"xss\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxss-vulnerability-scanner\u002FSKILL.md",[],[]]