vastai-webhooks-events

Solid

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".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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("actual_status", "unknown") prev = self.previous_states.get(inst_id) if prev and prev != status: event = f"{prev}_to_{status}"...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

vastai-observability

Monitor Vast.ai GPU instance health, utilization, and costs. Use when setting up monitoring dashboards, configuring alerts, or tracking GPU utilization and spending. Trigger with phrases like "vastai monitoring", "vastai metrics", "vastai observability", "monitor vastai", "vastai alerts".

2,266 Updated today
jeremylongshore
AI & Automation Solid

vastai-sdk

Vast.ai Python SDK — high-level API for GPU instances, volumes, serverless endpoints, and billing.

194 Updated yesterday
vast-ai
AI & Automation Solid

vastai-core-workflow-a

Execute Vast.ai primary workflow: GPU instance provisioning and job execution. Use when renting GPUs for training, searching offers by price and specs, or managing the full instance lifecycle from search to teardown. Trigger with phrases like "vastai rent gpu", "vastai training job", "vastai provision instance", "run job on vastai".

2,266 Updated today
jeremylongshore
AI & Automation Featured

instantly-webhooks-events

Implement Instantly.ai webhook event handling with real API v2 event types. Use when setting up webhook endpoints, processing email events, or building CRM sync pipelines from Instantly notifications. Trigger with phrases like "instantly webhook", "instantly events", "instantly webhook handler", "handle instantly events", "instantly notifications".

2,266 Updated today
jeremylongshore
AI & Automation Solid

vastai-sdk-patterns

Apply production-ready Vast.ai SDK patterns for Python and REST API. Use when implementing Vast.ai integrations, refactoring SDK usage, or establishing coding standards for GPU cloud operations. Trigger with phrases like "vastai SDK patterns", "vastai best practices", "vastai code patterns", "idiomatic vastai".

2,266 Updated today
jeremylongshore