DEPRECATED — use 'pip install vastai' instead. This package is a compatibility wrapper that installs vastai.
Project Links
Meta
Author: Chris McKenzie
Requires Python: >=3.9
Classifiers
Programming Language
- Python :: 3
- Python :: 3.9
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
- Python :: 3.14
Vast.ai Python SDK
This package is deprecated. It has been merged into vast-ai/vast-cli.
pip install vastainow installs both the SDK and CLI in a single package.pip install vastai-sdkstill works and installs the same package. For issues and PRs, go to vast-ai/vast-cli.
Install
pip install vastai-sdk
Quickstart
-
Get your API key from https://cloud.vast.ai/manage-keys/
-
Set your API key:
from vastai_sdk import VastAI
vast = VastAI(api_key="YOUR_API_KEY")
Or set the VAST_API_KEY environment variable and just use:
vast = VastAI()
SDK Usage
Both of these work identically:
from vastai_sdk import VastAI
from vastai import VastAI
Both of these also work identically:
from vastai import Serverless
from vastai_sdk.serverless.client.client import Serverless
vast = VastAI()
vast.search_offers(query='gpu_name=RTX_4090 num_gpus>=4')
vast.show_instances()
vast.start_instance(id=12345)
vast.stop_instance(id=12345)
Use help(vast.search_offers) to view documentation for any method.
Using the Serverless Client
- Create the client
from vastai import Serverless
serverless = Serverless() # or, Serverless("YOUR_API_KEY")
- Get an endpoint
endpoint = await serverless.get_endpoint("my-endpoint")
- Make a request
request_body = {
"model": "Qwen/Qwen3-8B",
"prompt" : "Who are you?",
"max_tokens" : 100,
"temperature" : 0.7
}
response = await serverless.request("/v1/completions", request_body)
- Read the response
text = response["response"]["choices"][0]["text"]
print(text)
Find more examples in the examples/ directory.
Contributing
This repo is deprecated. For issues, PRs, and documentation, go to vast-ai/vast-cli.
1.5.1
Jul 27, 2026
1.5.0
Jul 24, 2026
1.4.4
Jul 24, 2026
1.4.3
Jul 21, 2026
1.4.2
Jul 17, 2026
1.4.1
Jul 17, 2026
1.4.0
Jul 14, 2026
1.3.0
Jul 08, 2026
1.2.2
Jul 07, 2026
1.2.1
Jul 06, 2026
1.2.0
Jul 02, 2026
1.1.3
Jun 25, 2026
1.1.2
Jun 23, 2026
1.1.1
Jun 19, 2026
1.1.0
Jun 18, 2026
1.0.13
May 14, 2026
1.0.12
May 08, 2026
1.0.11
May 07, 2026
1.0.10
May 06, 2026
1.0.9
May 04, 2026
1.0.8
Apr 29, 2026
1.0.7
Apr 24, 2026
1.0.6
Apr 22, 2026
1.0.5
Apr 22, 2026
1.0.4
Apr 21, 2026
1.0.3
Apr 14, 2026
1.0.2
Apr 14, 2026
1.0.1
Apr 10, 2026
1.0.0
Apr 09, 2026
1.0.0.dev2
Mar 24, 2026
1.0.0.dev1
Mar 24, 2026
0.6.0
Apr 02, 2026
0.5.2
Mar 31, 2026
0.5.1
Feb 28, 2026
0.5.0
Feb 20, 2026
0.4.5
Feb 13, 2026
0.4.4
Jan 29, 2026
0.4.3
Jan 27, 2026
0.4.3.dev4
Jan 27, 2026
0.4.3.dev2
Jan 26, 2026
0.4.3.dev1
Jan 23, 2026
0.4.2
Jan 21, 2026
0.4.2.dev3
Jan 14, 2026
0.4.2.dev2
Jan 14, 2026
0.4.2.dev1
Dec 31, 2025
0.4.1.dev1
Dec 18, 2025
0.3.6.dev1
Dec 19, 2025
0.3.4.dev2
Dec 19, 2025
0.3.4.dev1
Dec 19, 2025
0.3.3.dev4
Dec 20, 2025
0.3.3.dev3
Dec 20, 2025
0.3.3.dev2
Dec 19, 2025
0.3.3.dev1
Dec 18, 2025
0.3.1
Dec 16, 2025
0.3.0
Dec 16, 2025
0.2.6
Dec 11, 2025
0.2.5
Nov 19, 2025
0.2.4
Nov 12, 2025
0.2.3
Nov 12, 2025
0.2.2
Oct 31, 2025
0.2.1
Oct 29, 2025
0.2.0
Oct 29, 2025
0.1.20
Jul 28, 2025
0.1.19
Apr 30, 2025
0.1.18
Apr 30, 2025
0.1.17
Apr 29, 2025
0.1.16
Feb 19, 2025
0.1.15
Feb 18, 2025
0.1.14
Feb 18, 2025
0.1.13
Jan 30, 2025
0.1.12
Jan 29, 2025
0.1.11
Jan 29, 2025
0.1.10
Jan 29, 2025
0.1.9
Jan 29, 2025
0.1.8
Jan 27, 2025
0.1.7
Jan 17, 2025
0.1.6
Jan 17, 2025
0.1.5
Jan 16, 2025
0.1.4
Jan 16, 2025
0.1.3
Dec 12, 2024
0.1.2
Nov 21, 2024
0.1.1
Nov 21, 2024
0.1.0
Nov 16, 2024
Wheel compatibility matrix
Files in release
Extras:
None
Dependencies:
vastai
(==1.5.1)