vast-ai/vast-cli / vastai
vastai
FlaggedVast.ai CLI to manage GPU instances, volumes, serverless endpoints, and billing.
async_/results.py
View on GitHubfrom __future__ import annotations
from typing import TYPE_CHECKING, Optional, Union
from vastai.data.offer import Offer
from vastai.data.instance import InstanceConfig
if TYPE_CHECKING:
from vastai.async_.client import AsyncClient
from vastai.data.instance import Instance
class AsyncOffer:
def __init__(self, data: Offer, client: AsyncClient):
self._data = data
self._client = client
async def create_instance(self, config: InstanceConfig) -> AsyncInstance:
"""Create an instance from this offer. Synonym for AsyncClient.create_instance(self.id, config)."""
return await self._client.create_instance(self._data.id, config)
def __getattr__(self, name: str):
return getattr(self._data, name)
def __repr__(self) -> str:
return f"AsyncOffer({self._data!r})"
class AsyncInstance:
def __init__(self, data: Instance, client: AsyncClient):
self._data = data
self._client = client
async def destroy(self) -> None:
"""Synonym for AsyncClient.destroy_instance(self)."""
return await self._client.destroy_instance(self._data.id)
def __getattr__(self, name: str):
return getattr(self._data, name)
def __repr__(self) -> str:
return f"AsyncInstance({self._data!r})"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |