vastai-webhooks-events
Build event-driven workflows around Vast.ai instance lifecycle events. Use when monitoring instance status changes, implementing auto-recovery, or building event-driven GPU orchestration. Trigger with phrases like "vastai events", "vastai instance monitoring", "vastai status changes", "vastai lifecycle events". '
npx skills add jeremylongshore/claude-code-plugins-plus-skills --skill vastai-webhooks-events --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Vast.ai Webhooks & Events ## Overview Build 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/api/v0` and reacting to instance status transitions (loading, running, exited, error, offline). ## Prerequisites - Vast.ai CLI authenticated - Understanding of instance lifecycle states - Python 3.8+ for event loop implementation ## Instructions ### Step 1: Instance Status Poller ```python import time, json, subprocess from typing import Callable, Dict, List class InstanceEventPoller: """Poll Vast.ai API and emit events on status transitions.""" def __init__(self, api_key: str, poll_interval: int = 30): self.api_key = api_key self.poll_interval = poll_interval self.previous_states: Dict[int, str] = {} self.handlers: Dict[str, List[Callable]] = {} def on(self, event: str, handler: Callable): self.handlers.setdefault(event, []).append(handler) def poll_once(self): result = subprocess.run( ["vastai", "show", "instances", "--raw"], capture_output=True, text=True) instances = json.loads(result.stdout) for inst in instances: inst_id = inst["id"] status = inst.get("actu
- Overview
- Prerequisites
- Instructions
- Step 1: Instance Status Poller
- Step 2: Event Handlers
- Step 3: Auto-Recovery on Preemption
- Step 4: Cost Event Tracking
- Output
- Error Handling
- Resources
- Next Steps
- Examples
What does the vastai-webhooks-events skill do?
Build event-driven workflows around Vast.ai instance lifecycle events. Use when monitoring instance status changes, implementing auto-recovery, or building event-driven GPU orchestration. Trigger with phrases like "vastai events", "vastai instance monitoring", "vastai status changes", "vastai lifecycle events". '
How do I install it?
Run `npx skills add jeremylongshore/claude-code-plugins-plus-skills --skill vastai-webhooks-events --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From jeremylongshore/claude-code-plugins-plus-skills, a repository with 2,630 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.