vast-ai/vast-cli / vastai
vastai
FlaggedVast.ai CLI to manage GPU instances, volumes, serverless endpoints, and billing.
data/endpoint.py
View on GitHubimport dataclasses
from dataclasses import dataclass
from typing import Optional
@dataclass
class EndpointConfig:
"""Configuration for creating or updating an endpoint job.
Only endpoint_name is required. All other fields default to None,
meaning the server will use its own defaults.
"""
endpoint_name: str
cold_workers: Optional[int] = None
max_workers: Optional[int] = None
min_load: Optional[float] = None
min_cold_load: Optional[float] = None
target_util: Optional[float] = None
cold_mult: Optional[float] = None
max_queue_time: Optional[float] = None
target_queue_time: Optional[float] = None
autoscaler_instance: Optional[str] = None
endpoint_state: Optional[str] = None
inactivity_timeout: Optional[float] = None
def to_dict(self) -> dict:
return {k: v for k, v in dataclasses.asdict(self).items() if v is not None}
@dataclass
class EndpointData:
"""Full endpoint entity as returned by the API."""
id: int
config: EndpointConfig
api_key: str
user_id: int
created_at: float
auto_delete_in_seconds: Optional[float]
auto_delete_due_24h: bool
@classmethod
def from_dict(cls, d: dict) -> "EndpointData":
config = EndpointConfig(
endpoint_name=d["endpoint_name"],
cold_workers=d.get("cold_workers"),
max_workers=d.get("max_workers"),
min_load=d.get("min_load"),
min_cold_load=d.get("min_cold_load"),
target_util=d.get("target_util"),
cold_mult=d.get("cold_mult"),
max_queue_time=d.get("max_queue_time"),
target_queue_time=d.get("target_queue_time"),
endpoint_state=d.get("endpoint_state"),
inactivity_timeout=d.get("inactivity_timeout"),
)
return cls(
id=d["id"],
config=config,
api_key=d["api_key"],
user_id=d["user_id"],
created_at=d["created_at"],
auto_delete_in_seconds=d.get("auto_delete_in_seconds"),
auto_delete_due_24h=d.get("auto_delete_due_24h", False),
)
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 |