create_instance
Rent a GPU instance from a Vast.ai offer by specifying offer ID and hourly spend cap. Optionally attach or create a volume; returns contract ID once price is verified.
Instructions
Create (rent) a new instance on a specific machine offer (ask id from search_offers), optionally creating and attaching a new volume. Returns the new contract/instance id. Requires max_hourly_price as a spend guardrail: the offer's live price is checked against it and the rental is refused if the price exceeds the cap or can't be verified.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Docker flags, e.g. '-e HF_TOKEN=hf_xxx -p 8000:8000'. | |
| image | No | Docker image (default: vastai/base-image). | |
| label | No | Friendly instance name. | |
| volume | No | Volume to attach, created on the fly if volume_id is omitted. | |
| disk_gb | No | Local disk in GB (min 8). | |
| runtype | No | Run type (default: ssh). | |
| offer_id | Yes | Offer/ask id returned by search_offers. | |
| target_state | No | State to bring the instance to (default: running). | |
| max_hourly_price | Yes | Required spend cap in $/hr. The offer's current dph_total is checked against this before renting; if it exceeds the cap (or can't be fetched), the request is refused. |