Python client for the Vast.ai cloud rent service.
Project description
vastai-client
Python client for the Vast.ai cloud rent service. This package provides a Python client, that allows to list, create, destroy GPU instances programmaticaly, using Python.
There is an official Vast.ai CLI, however it can only be used through the command line.
Installation
pip install vastai-client
Example
With the package you can list offers and run selected machines:
from vastai_client import VastClient
client = VastClient(api_key=<your_api_key>)
available_machines = client.search_offers(search_query='reliability > 0.98 num_gpus=1 gpu_name=RTX_3090', sort_order='dph-')
print(available_machines)
selected_machine = available_machines[0]
client.create_instance(id=selected_machine.id, image='pytorch/pytorch', ssh=True)
For more details, watch documentation.
License
Credits
This project was generated with wemake-python-package
. Current template version is: 9899cb192f754a566da703614227e6d63227b933. See what is updated since then.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vastai_client-0.1.1.tar.gz
(13.4 kB
view hashes)
Built Distribution
Close
Hashes for vastai_client-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1da805f36c1ea4de46830f4055f269dbbd89ce4fdbfa5fef1d44fdaeb24a18d5 |
|
MD5 | 5e0fd54b3b96b2a2d0d5c0f9e5a828bc |
|
BLAKE2b-256 | d410b2c3a989044e2e36304ea7b26213f9a57b2317ef4b472dd2b498f781c509 |