vastai 1.0.0.dev1__tar.gz → 1.0.0.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/PKG-INFO +72 -19
- vastai-1.0.0.dev2/README.md +110 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/pyproject.toml +1 -1
- vastai-1.0.0.dev1/README.md +0 -57
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/LICENSE +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/__init__.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/__init__.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/auth.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/billing.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/client.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/clusters.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/deployments.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/endpoints.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/instances.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/keys.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/machines.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/offers.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/query.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/storage.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/api/teams.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/__init__.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/commands/__init__.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/commands/auth.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/commands/billing.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/commands/clusters.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/commands/deployments.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/commands/endpoints.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/commands/instances.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/commands/keys.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/commands/machines.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/commands/misc.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/commands/offers.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/commands/storage.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/commands/teams.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/display.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/main.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/parser.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/util.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/cli/utils.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/sdk.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/__init__.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/client/__init__.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/client/client.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/client/connection.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/client/endpoint.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/client/session.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/client/worker.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/server/__init__.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/server/lib/__init__.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/server/lib/backend.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/server/lib/data_types.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/server/lib/metrics.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/server/lib/server.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/serverless/server/worker.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai/utils.py +0 -0
- {vastai-1.0.0.dev1 → vastai-1.0.0.dev2}/vastai_sdk/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vastai
|
|
3
|
-
Version: 1.0.0.
|
|
3
|
+
Version: 1.0.0.dev2
|
|
4
4
|
Summary: SDK for Vast.ai GPU Cloud Service
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Author: Chris McKenzie
|
|
@@ -44,36 +44,71 @@ Project-URL: Repository, https://github.com/vast-ai/vast-sdk
|
|
|
44
44
|
Project-URL: Source, https://github.com/vast-ai/vast-sdk
|
|
45
45
|
Description-Content-Type: text/markdown
|
|
46
46
|
|
|
47
|
-
# Vast.ai Python SDK
|
|
48
|
-
[](https://badge.fury.io/py/vastai)
|
|
49
49
|
|
|
50
|
-
The official Vast.ai SDK
|
|
50
|
+
The official Vast.ai Python package — provides both the CLI and SDK for managing Vast.ai GPU cloud resources, plus a serverless client for endpoint inference.
|
|
51
51
|
|
|
52
52
|
## Install
|
|
53
|
+
|
|
53
54
|
```bash
|
|
54
|
-
pip install vastai
|
|
55
|
+
pip install vastai
|
|
55
56
|
```
|
|
56
|
-
## Examples
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
> **Note:** `pip install vastai-sdk` also works and installs the same package. Both package names are supported for backward compatibility.
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
## Quickstart
|
|
61
61
|
|
|
62
|
-
1.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
1. Get your API key from [https://cloud.vast.ai/manage-keys/](https://cloud.vast.ai/manage-keys/)
|
|
63
|
+
|
|
64
|
+
2. Set your API key:
|
|
65
|
+
```bash
|
|
66
|
+
vastai set api-key YOUR_API_KEY
|
|
66
67
|
```
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
|
|
69
|
+
3. Test a search:
|
|
70
|
+
```bash
|
|
71
|
+
vastai search offers --limit 3
|
|
72
|
+
```
|
|
73
|
+
You should see a short list of available GPU offers.
|
|
74
|
+
|
|
75
|
+
## CLI Usage
|
|
76
|
+
|
|
77
|
+
The `vastai` command provides full access to the Vast.ai platform from your terminal:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
vastai search offers 'gpu_name=RTX_4090 num_gpus>=4'
|
|
81
|
+
vastai create instance 12345 --image pytorch/pytorch --disk 32 --ssh --direct
|
|
82
|
+
vastai show instances
|
|
83
|
+
vastai stop instance 12345
|
|
84
|
+
vastai destroy instance 12345
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Run `vastai --help` for a full list of commands. You can also use `--help` on any subcommand:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
vastai search offers --help
|
|
91
|
+
vastai create instance --help
|
|
70
92
|
```
|
|
71
|
-
|
|
93
|
+
|
|
94
|
+
## SDK Usage
|
|
95
|
+
|
|
72
96
|
```python
|
|
73
|
-
|
|
97
|
+
from vastai import VastAI
|
|
98
|
+
|
|
99
|
+
vast = VastAI() # uses VAST_API_KEY env var, or pass api_key="..."
|
|
100
|
+
|
|
101
|
+
vast.search_offers(query='gpu_name=RTX_4090 num_gpus>=4')
|
|
102
|
+
vast.show_instances()
|
|
103
|
+
vast.start_instance(id=12345)
|
|
104
|
+
vast.stop_instance(id=12345)
|
|
74
105
|
```
|
|
75
106
|
|
|
76
|
-
|
|
107
|
+
Use `help(vast.search_offers)` to view documentation for any method.
|
|
108
|
+
|
|
109
|
+
> **Migrating from `vastai-sdk`?** The old import still works: `from vastai_sdk import VastAI`
|
|
110
|
+
|
|
111
|
+
## Using the Serverless Client
|
|
77
112
|
|
|
78
113
|
1. Create the client
|
|
79
114
|
```python
|
|
@@ -100,5 +135,23 @@ text = response["response"]["choices"][0]["text"]
|
|
|
100
135
|
print(text)
|
|
101
136
|
```
|
|
102
137
|
|
|
103
|
-
Find more examples in the `examples
|
|
138
|
+
Find more examples in the `examples/` directory.
|
|
139
|
+
|
|
140
|
+
## Tab Completion
|
|
141
|
+
|
|
142
|
+
Tab completion is supported in Bash and Zsh via [argcomplete](https://github.com/kislyuk/argcomplete) (installed automatically). To enable it:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
activate-global-python-argcomplete
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Or for a single session:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
eval "$(register-python-argcomplete vastai)"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Contributing
|
|
155
|
+
|
|
156
|
+
This [repository](https://github.com/vast-ai/vast-sdk) is open source. If you find a bug, please [open an issue](https://github.com/vast-ai/vast-sdk/issues). PRs are welcome.
|
|
104
157
|
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Vast.ai Python SDK & CLI
|
|
2
|
+
[](https://badge.fury.io/py/vastai)
|
|
3
|
+
|
|
4
|
+
The official Vast.ai Python package — provides both the CLI and SDK for managing Vast.ai GPU cloud resources, plus a serverless client for endpoint inference.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pip install vastai
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
> **Note:** `pip install vastai-sdk` also works and installs the same package. Both package names are supported for backward compatibility.
|
|
13
|
+
|
|
14
|
+
## Quickstart
|
|
15
|
+
|
|
16
|
+
1. Get your API key from [https://cloud.vast.ai/manage-keys/](https://cloud.vast.ai/manage-keys/)
|
|
17
|
+
|
|
18
|
+
2. Set your API key:
|
|
19
|
+
```bash
|
|
20
|
+
vastai set api-key YOUR_API_KEY
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
3. Test a search:
|
|
24
|
+
```bash
|
|
25
|
+
vastai search offers --limit 3
|
|
26
|
+
```
|
|
27
|
+
You should see a short list of available GPU offers.
|
|
28
|
+
|
|
29
|
+
## CLI Usage
|
|
30
|
+
|
|
31
|
+
The `vastai` command provides full access to the Vast.ai platform from your terminal:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
vastai search offers 'gpu_name=RTX_4090 num_gpus>=4'
|
|
35
|
+
vastai create instance 12345 --image pytorch/pytorch --disk 32 --ssh --direct
|
|
36
|
+
vastai show instances
|
|
37
|
+
vastai stop instance 12345
|
|
38
|
+
vastai destroy instance 12345
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Run `vastai --help` for a full list of commands. You can also use `--help` on any subcommand:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
vastai search offers --help
|
|
45
|
+
vastai create instance --help
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## SDK Usage
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from vastai import VastAI
|
|
52
|
+
|
|
53
|
+
vast = VastAI() # uses VAST_API_KEY env var, or pass api_key="..."
|
|
54
|
+
|
|
55
|
+
vast.search_offers(query='gpu_name=RTX_4090 num_gpus>=4')
|
|
56
|
+
vast.show_instances()
|
|
57
|
+
vast.start_instance(id=12345)
|
|
58
|
+
vast.stop_instance(id=12345)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Use `help(vast.search_offers)` to view documentation for any method.
|
|
62
|
+
|
|
63
|
+
> **Migrating from `vastai-sdk`?** The old import still works: `from vastai_sdk import VastAI`
|
|
64
|
+
|
|
65
|
+
## Using the Serverless Client
|
|
66
|
+
|
|
67
|
+
1. Create the client
|
|
68
|
+
```python
|
|
69
|
+
from vastai import Serverless
|
|
70
|
+
serverless = Serverless() # or, Serverless("YOUR_API_KEY")
|
|
71
|
+
```
|
|
72
|
+
2. Get an endpoint
|
|
73
|
+
```python
|
|
74
|
+
endpoint = await serverless.get_endpoint("my-endpoint")
|
|
75
|
+
```
|
|
76
|
+
3. Make a request
|
|
77
|
+
```python
|
|
78
|
+
request_body = {
|
|
79
|
+
"model": "Qwen/Qwen3-8B",
|
|
80
|
+
"prompt" : "Who are you?",
|
|
81
|
+
"max_tokens" : 100,
|
|
82
|
+
"temperature" : 0.7
|
|
83
|
+
}
|
|
84
|
+
response = await serverless.request("/v1/completions", request_body)
|
|
85
|
+
```
|
|
86
|
+
4. Read the response
|
|
87
|
+
```python
|
|
88
|
+
text = response["response"]["choices"][0]["text"]
|
|
89
|
+
print(text)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Find more examples in the `examples/` directory.
|
|
93
|
+
|
|
94
|
+
## Tab Completion
|
|
95
|
+
|
|
96
|
+
Tab completion is supported in Bash and Zsh via [argcomplete](https://github.com/kislyuk/argcomplete) (installed automatically). To enable it:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
activate-global-python-argcomplete
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Or for a single session:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
eval "$(register-python-argcomplete vastai)"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Contributing
|
|
109
|
+
|
|
110
|
+
This [repository](https://github.com/vast-ai/vast-sdk) is open source. If you find a bug, please [open an issue](https://github.com/vast-ai/vast-sdk/issues). PRs are welcome.
|
vastai-1.0.0.dev1/README.md
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# Vast.ai Python SDK
|
|
2
|
-
[](https://badge.fury.io/py/vastai-sdk)
|
|
3
|
-
|
|
4
|
-
The official Vast.ai SDK pip package.
|
|
5
|
-
|
|
6
|
-
## Install
|
|
7
|
-
```bash
|
|
8
|
-
pip install vastai-sdk
|
|
9
|
-
```
|
|
10
|
-
## Examples
|
|
11
|
-
|
|
12
|
-
NOTE: Ensure your Vast.ai API key is set in your working environment as `VAST_API_KEY`. Alternatively, you may pass the API key in as a parameter to either client.
|
|
13
|
-
|
|
14
|
-
### Using the VastAI CLI client
|
|
15
|
-
|
|
16
|
-
1. Create the client
|
|
17
|
-
```python
|
|
18
|
-
from vastai import VastAI
|
|
19
|
-
vastai = VastAI() # or, VastAI("YOUR_API_KEY")
|
|
20
|
-
```
|
|
21
|
-
2. Run commands
|
|
22
|
-
```python
|
|
23
|
-
vastai.search_offers()
|
|
24
|
-
```
|
|
25
|
-
3. Get help
|
|
26
|
-
```python
|
|
27
|
-
help(v.create_instances)
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### Using the Serverless client
|
|
31
|
-
|
|
32
|
-
1. Create the client
|
|
33
|
-
```python
|
|
34
|
-
from vastai import Serverless
|
|
35
|
-
serverless = Serverless() # or, Serverless("YOUR_API_KEY")
|
|
36
|
-
```
|
|
37
|
-
2. Get an endpoint
|
|
38
|
-
```python
|
|
39
|
-
endpoint = await serverless.get_endpoint("my-endpoint")
|
|
40
|
-
```
|
|
41
|
-
3. Make a request
|
|
42
|
-
```python
|
|
43
|
-
request_body = {
|
|
44
|
-
"model": "Qwen/Qwen3-8B",
|
|
45
|
-
"prompt" : "Who are you?",
|
|
46
|
-
"max_tokens" : 100,
|
|
47
|
-
"temperature" : 0.7
|
|
48
|
-
}
|
|
49
|
-
response = await serverless.request("/v1/completions", request_body)
|
|
50
|
-
```
|
|
51
|
-
4. Read the response
|
|
52
|
-
```python
|
|
53
|
-
text = response["response"]["choices"][0]["text"]
|
|
54
|
-
print(text)
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Find more examples in the `examples` directory
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|