voltagegpu-cli 1.0.0__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.
- voltagegpu_cli-1.0.0/.gitignore +181 -0
- voltagegpu_cli-1.0.0/PKG-INFO +288 -0
- voltagegpu_cli-1.0.0/README.md +254 -0
- voltagegpu_cli-1.0.0/pyproject.toml +57 -0
- voltagegpu_cli-1.0.0/volt/__init__.py +6 -0
- voltagegpu_cli-1.0.0/volt/cli/__init__.py +3 -0
- voltagegpu_cli-1.0.0/volt/cli/cli.py +417 -0
- voltagegpu_cli-1.0.0/volt/sdk/__init__.py +7 -0
- voltagegpu_cli-1.0.0/volt/sdk/client.py +270 -0
- voltagegpu_cli-1.0.0/volt/sdk/config.py +62 -0
- voltagegpu_cli-1.0.0/volt/sdk/decorators.py +200 -0
- voltagegpu_cli-1.0.0/volt/sdk/exceptions.py +29 -0
- voltagegpu_cli-1.0.0/volt/sdk/models.py +132 -0
- voltagegpu_cli-1.0.0/volt/sdk/utils.py +94 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
|
|
110
|
+
# pdm
|
|
111
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
112
|
+
#pdm.lock
|
|
113
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
114
|
+
# in version control.
|
|
115
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
116
|
+
.pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
121
|
+
__pypackages__/
|
|
122
|
+
|
|
123
|
+
# Celery stuff
|
|
124
|
+
celerybeat-schedule
|
|
125
|
+
celerybeat.pid
|
|
126
|
+
|
|
127
|
+
# SageMath parsed files
|
|
128
|
+
*.sage.py
|
|
129
|
+
|
|
130
|
+
# Environments
|
|
131
|
+
.env
|
|
132
|
+
.venv
|
|
133
|
+
env/
|
|
134
|
+
venv/
|
|
135
|
+
ENV/
|
|
136
|
+
env.bak/
|
|
137
|
+
venv.bak/
|
|
138
|
+
|
|
139
|
+
# Spyder project settings
|
|
140
|
+
.spyderproject
|
|
141
|
+
.spyproject
|
|
142
|
+
|
|
143
|
+
# Rope project settings
|
|
144
|
+
.ropeproject
|
|
145
|
+
|
|
146
|
+
# mkdocs documentation
|
|
147
|
+
/site
|
|
148
|
+
|
|
149
|
+
# mypy
|
|
150
|
+
.mypy_cache/
|
|
151
|
+
.dmypy.json
|
|
152
|
+
dmypy.json
|
|
153
|
+
|
|
154
|
+
# Pyre type checker
|
|
155
|
+
.pyre/
|
|
156
|
+
|
|
157
|
+
# pytype static type analyzer
|
|
158
|
+
.pytype/
|
|
159
|
+
|
|
160
|
+
# Cython debug symbols
|
|
161
|
+
cython_debug/
|
|
162
|
+
|
|
163
|
+
# PyCharm
|
|
164
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
165
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
166
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
167
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
168
|
+
#.idea/
|
|
169
|
+
|
|
170
|
+
# Ruff stuff:
|
|
171
|
+
.ruff_cache/
|
|
172
|
+
|
|
173
|
+
# PyPI configuration file
|
|
174
|
+
.pypirc
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
notebooks/
|
|
178
|
+
|
|
179
|
+
# Claude Code configuration
|
|
180
|
+
CLAUDE.md
|
|
181
|
+
.python-version
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: voltagegpu-cli
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: VoltageGPU CLI - Command-line interface for managing GPU cloud resources on voltagegpu.com. Deploy, manage, and scale your GPU workloads with ease.
|
|
5
|
+
Project-URL: Homepage, https://voltagegpu.com
|
|
6
|
+
Project-URL: Documentation, https://docs.voltagegpu.com
|
|
7
|
+
Project-URL: Repository, https://github.com/voltagegpu/voltagegpu-cli
|
|
8
|
+
Project-URL: Issues, https://github.com/voltagegpu/voltagegpu-cli/issues
|
|
9
|
+
Author-email: VoltageGPU <support@voltagegpu.com>
|
|
10
|
+
Keywords: ai,cli,cloud,deep-learning,gpu,machine-learning,voltagegpu
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Classifier: Topic :: System :: Distributed Computing
|
|
23
|
+
Requires-Python: >=3.9
|
|
24
|
+
Requires-Dist: click>=8.0
|
|
25
|
+
Requires-Dist: httpx>=0.24.0
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: black; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
29
|
+
Requires-Dist: wheel; extra == 'dev'
|
|
30
|
+
Provides-Extra: docs
|
|
31
|
+
Requires-Dist: sphinx-rtd-theme>=1.3; extra == 'docs'
|
|
32
|
+
Requires-Dist: sphinx>=7.3; extra == 'docs'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# VoltageGPU CLI
|
|
36
|
+
|
|
37
|
+
Command-line interface and Python SDK for VoltageGPU - affordable GPU cloud computing for AI/ML workloads.
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install voltagegpu-cli
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Or install from source:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git clone https://github.com/voltagegpu/voltagegpu-cli.git
|
|
49
|
+
cd voltagegpu-cli
|
|
50
|
+
pip install -e .
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Quick Start
|
|
54
|
+
|
|
55
|
+
### 1. Configure your API key
|
|
56
|
+
|
|
57
|
+
Set the environment variable:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
export VOLT_API_KEY="your_api_key_here"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Or create a config file at `~/.volt/config.ini`:
|
|
64
|
+
|
|
65
|
+
```ini
|
|
66
|
+
[api]
|
|
67
|
+
api_key = your_api_key_here
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 2. List available templates
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
volt templates list
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3. Create a pod
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
volt pods create --template <template_id> --name my-gpu-pod
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 4. SSH into your pod
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
volt pods ssh <pod_id>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## CLI Commands
|
|
89
|
+
|
|
90
|
+
### Pods
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# List all pods
|
|
94
|
+
volt pods list
|
|
95
|
+
volt pods list --json
|
|
96
|
+
|
|
97
|
+
# Get pod details
|
|
98
|
+
volt pods get <pod_id>
|
|
99
|
+
|
|
100
|
+
# Create a new pod
|
|
101
|
+
volt pods create --template <template_id> --name <name> [--gpu-count 1] [--ssh-key <key_id>]
|
|
102
|
+
|
|
103
|
+
# Start/Stop/Delete pods
|
|
104
|
+
volt pods start <pod_id>
|
|
105
|
+
volt pods stop <pod_id>
|
|
106
|
+
volt pods delete <pod_id> [--yes]
|
|
107
|
+
|
|
108
|
+
# Get SSH command
|
|
109
|
+
volt pods ssh <pod_id>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Templates
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# List available templates
|
|
116
|
+
volt templates list
|
|
117
|
+
volt templates list --category llm
|
|
118
|
+
volt templates list --json
|
|
119
|
+
|
|
120
|
+
# Get template details
|
|
121
|
+
volt templates get <template_id>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### SSH Keys
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# List SSH keys
|
|
128
|
+
volt ssh-keys list
|
|
129
|
+
|
|
130
|
+
# Add a new SSH key
|
|
131
|
+
volt ssh-keys add --name "my-key" --file ~/.ssh/id_ed25519.pub
|
|
132
|
+
volt ssh-keys add --name "my-key" --key "ssh-ed25519 AAAA..."
|
|
133
|
+
|
|
134
|
+
# Delete an SSH key
|
|
135
|
+
volt ssh-keys delete <key_id>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Machines
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# List available machines
|
|
142
|
+
volt machines list
|
|
143
|
+
volt machines list --gpu RTX4090
|
|
144
|
+
volt machines list --json
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Account
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Check balance
|
|
151
|
+
volt account balance
|
|
152
|
+
|
|
153
|
+
# Get account info
|
|
154
|
+
volt account info
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Configuration
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Show current configuration
|
|
161
|
+
volt config
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Python SDK
|
|
165
|
+
|
|
166
|
+
You can also use VoltageGPU as a Python library:
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
from volt import VoltageGPUClient
|
|
170
|
+
|
|
171
|
+
# Initialize client (uses VOLT_API_KEY env var or ~/.volt/config.ini)
|
|
172
|
+
client = VoltageGPUClient()
|
|
173
|
+
|
|
174
|
+
# List pods
|
|
175
|
+
pods = client.list_pods()
|
|
176
|
+
for pod in pods:
|
|
177
|
+
print(f"{pod.name}: {pod.status} ({pod.gpu_type})")
|
|
178
|
+
|
|
179
|
+
# Create a pod
|
|
180
|
+
pod = client.create_pod(
|
|
181
|
+
template_id="template-123",
|
|
182
|
+
name="my-training-pod",
|
|
183
|
+
gpu_count=2
|
|
184
|
+
)
|
|
185
|
+
print(f"Created pod: {pod.id}")
|
|
186
|
+
|
|
187
|
+
# Get SSH connection info
|
|
188
|
+
pod = client.get_pod(pod.id)
|
|
189
|
+
print(f"SSH: ssh -p {pod.ssh_port} root@{pod.ssh_host}")
|
|
190
|
+
|
|
191
|
+
# Stop and delete
|
|
192
|
+
client.stop_pod(pod.id)
|
|
193
|
+
client.delete_pod(pod.id)
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Context Manager
|
|
197
|
+
|
|
198
|
+
```python
|
|
199
|
+
from volt import VoltageGPUClient
|
|
200
|
+
|
|
201
|
+
with VoltageGPUClient() as client:
|
|
202
|
+
templates = client.list_templates()
|
|
203
|
+
for t in templates:
|
|
204
|
+
print(f"{t.name}: ${t.hourly_price}/hr")
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Custom Configuration
|
|
208
|
+
|
|
209
|
+
```python
|
|
210
|
+
from volt.sdk import Config, VoltageGPUClient
|
|
211
|
+
|
|
212
|
+
config = Config(
|
|
213
|
+
api_key="your_api_key",
|
|
214
|
+
base_url="https://voltagegpu.com/api"
|
|
215
|
+
)
|
|
216
|
+
client = VoltageGPUClient(config=config)
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Environment Variables
|
|
220
|
+
|
|
221
|
+
| Variable | Description | Default |
|
|
222
|
+
|----------|-------------|---------|
|
|
223
|
+
| `VOLT_API_KEY` | Your VoltageGPU API key | - |
|
|
224
|
+
| `VOLT_BASE_URL` | API base URL | `https://voltagegpu.com/api` |
|
|
225
|
+
| `LIUM_API_KEY` | Legacy API key (fallback) | - |
|
|
226
|
+
|
|
227
|
+
## Configuration File
|
|
228
|
+
|
|
229
|
+
Create `~/.volt/config.ini`:
|
|
230
|
+
|
|
231
|
+
```ini
|
|
232
|
+
[api]
|
|
233
|
+
api_key = your_api_key_here
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Output Formats
|
|
237
|
+
|
|
238
|
+
Most list commands support `--json` flag for machine-readable output:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
volt pods list --json | jq '.[] | select(.status == "running")'
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Examples
|
|
245
|
+
|
|
246
|
+
### Launch a training job
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# Find a suitable template
|
|
250
|
+
volt templates list --category ml
|
|
251
|
+
|
|
252
|
+
# Create pod with SSH key
|
|
253
|
+
volt pods create \
|
|
254
|
+
--template pytorch-cuda12 \
|
|
255
|
+
--name training-job \
|
|
256
|
+
--gpu-count 4 \
|
|
257
|
+
--ssh-key my-key-id
|
|
258
|
+
|
|
259
|
+
# Get SSH command
|
|
260
|
+
volt pods ssh <pod_id>
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Monitor costs
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
# Check balance
|
|
267
|
+
volt account balance
|
|
268
|
+
|
|
269
|
+
# List running pods with costs
|
|
270
|
+
volt pods list | grep running
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Batch operations with jq
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
# Stop all running pods
|
|
277
|
+
volt pods list --json | jq -r '.[] | select(.status == "running") | .id' | xargs -I {} volt pods stop {}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Support
|
|
281
|
+
|
|
282
|
+
- Website: https://voltagegpu.com
|
|
283
|
+
- Documentation: https://docs.voltagegpu.com
|
|
284
|
+
- Email: support@voltagegpu.com
|
|
285
|
+
|
|
286
|
+
## License
|
|
287
|
+
|
|
288
|
+
MIT License - see LICENSE file for details.
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
# VoltageGPU CLI
|
|
2
|
+
|
|
3
|
+
Command-line interface and Python SDK for VoltageGPU - affordable GPU cloud computing for AI/ML workloads.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install voltagegpu-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or install from source:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git clone https://github.com/voltagegpu/voltagegpu-cli.git
|
|
15
|
+
cd voltagegpu-cli
|
|
16
|
+
pip install -e .
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
### 1. Configure your API key
|
|
22
|
+
|
|
23
|
+
Set the environment variable:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
export VOLT_API_KEY="your_api_key_here"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Or create a config file at `~/.volt/config.ini`:
|
|
30
|
+
|
|
31
|
+
```ini
|
|
32
|
+
[api]
|
|
33
|
+
api_key = your_api_key_here
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. List available templates
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
volt templates list
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3. Create a pod
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
volt pods create --template <template_id> --name my-gpu-pod
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 4. SSH into your pod
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
volt pods ssh <pod_id>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## CLI Commands
|
|
55
|
+
|
|
56
|
+
### Pods
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# List all pods
|
|
60
|
+
volt pods list
|
|
61
|
+
volt pods list --json
|
|
62
|
+
|
|
63
|
+
# Get pod details
|
|
64
|
+
volt pods get <pod_id>
|
|
65
|
+
|
|
66
|
+
# Create a new pod
|
|
67
|
+
volt pods create --template <template_id> --name <name> [--gpu-count 1] [--ssh-key <key_id>]
|
|
68
|
+
|
|
69
|
+
# Start/Stop/Delete pods
|
|
70
|
+
volt pods start <pod_id>
|
|
71
|
+
volt pods stop <pod_id>
|
|
72
|
+
volt pods delete <pod_id> [--yes]
|
|
73
|
+
|
|
74
|
+
# Get SSH command
|
|
75
|
+
volt pods ssh <pod_id>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Templates
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# List available templates
|
|
82
|
+
volt templates list
|
|
83
|
+
volt templates list --category llm
|
|
84
|
+
volt templates list --json
|
|
85
|
+
|
|
86
|
+
# Get template details
|
|
87
|
+
volt templates get <template_id>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### SSH Keys
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# List SSH keys
|
|
94
|
+
volt ssh-keys list
|
|
95
|
+
|
|
96
|
+
# Add a new SSH key
|
|
97
|
+
volt ssh-keys add --name "my-key" --file ~/.ssh/id_ed25519.pub
|
|
98
|
+
volt ssh-keys add --name "my-key" --key "ssh-ed25519 AAAA..."
|
|
99
|
+
|
|
100
|
+
# Delete an SSH key
|
|
101
|
+
volt ssh-keys delete <key_id>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Machines
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# List available machines
|
|
108
|
+
volt machines list
|
|
109
|
+
volt machines list --gpu RTX4090
|
|
110
|
+
volt machines list --json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Account
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Check balance
|
|
117
|
+
volt account balance
|
|
118
|
+
|
|
119
|
+
# Get account info
|
|
120
|
+
volt account info
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Configuration
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Show current configuration
|
|
127
|
+
volt config
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Python SDK
|
|
131
|
+
|
|
132
|
+
You can also use VoltageGPU as a Python library:
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
from volt import VoltageGPUClient
|
|
136
|
+
|
|
137
|
+
# Initialize client (uses VOLT_API_KEY env var or ~/.volt/config.ini)
|
|
138
|
+
client = VoltageGPUClient()
|
|
139
|
+
|
|
140
|
+
# List pods
|
|
141
|
+
pods = client.list_pods()
|
|
142
|
+
for pod in pods:
|
|
143
|
+
print(f"{pod.name}: {pod.status} ({pod.gpu_type})")
|
|
144
|
+
|
|
145
|
+
# Create a pod
|
|
146
|
+
pod = client.create_pod(
|
|
147
|
+
template_id="template-123",
|
|
148
|
+
name="my-training-pod",
|
|
149
|
+
gpu_count=2
|
|
150
|
+
)
|
|
151
|
+
print(f"Created pod: {pod.id}")
|
|
152
|
+
|
|
153
|
+
# Get SSH connection info
|
|
154
|
+
pod = client.get_pod(pod.id)
|
|
155
|
+
print(f"SSH: ssh -p {pod.ssh_port} root@{pod.ssh_host}")
|
|
156
|
+
|
|
157
|
+
# Stop and delete
|
|
158
|
+
client.stop_pod(pod.id)
|
|
159
|
+
client.delete_pod(pod.id)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Context Manager
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
from volt import VoltageGPUClient
|
|
166
|
+
|
|
167
|
+
with VoltageGPUClient() as client:
|
|
168
|
+
templates = client.list_templates()
|
|
169
|
+
for t in templates:
|
|
170
|
+
print(f"{t.name}: ${t.hourly_price}/hr")
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Custom Configuration
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
from volt.sdk import Config, VoltageGPUClient
|
|
177
|
+
|
|
178
|
+
config = Config(
|
|
179
|
+
api_key="your_api_key",
|
|
180
|
+
base_url="https://voltagegpu.com/api"
|
|
181
|
+
)
|
|
182
|
+
client = VoltageGPUClient(config=config)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Environment Variables
|
|
186
|
+
|
|
187
|
+
| Variable | Description | Default |
|
|
188
|
+
|----------|-------------|---------|
|
|
189
|
+
| `VOLT_API_KEY` | Your VoltageGPU API key | - |
|
|
190
|
+
| `VOLT_BASE_URL` | API base URL | `https://voltagegpu.com/api` |
|
|
191
|
+
| `LIUM_API_KEY` | Legacy API key (fallback) | - |
|
|
192
|
+
|
|
193
|
+
## Configuration File
|
|
194
|
+
|
|
195
|
+
Create `~/.volt/config.ini`:
|
|
196
|
+
|
|
197
|
+
```ini
|
|
198
|
+
[api]
|
|
199
|
+
api_key = your_api_key_here
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Output Formats
|
|
203
|
+
|
|
204
|
+
Most list commands support `--json` flag for machine-readable output:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
volt pods list --json | jq '.[] | select(.status == "running")'
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Examples
|
|
211
|
+
|
|
212
|
+
### Launch a training job
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
# Find a suitable template
|
|
216
|
+
volt templates list --category ml
|
|
217
|
+
|
|
218
|
+
# Create pod with SSH key
|
|
219
|
+
volt pods create \
|
|
220
|
+
--template pytorch-cuda12 \
|
|
221
|
+
--name training-job \
|
|
222
|
+
--gpu-count 4 \
|
|
223
|
+
--ssh-key my-key-id
|
|
224
|
+
|
|
225
|
+
# Get SSH command
|
|
226
|
+
volt pods ssh <pod_id>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Monitor costs
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# Check balance
|
|
233
|
+
volt account balance
|
|
234
|
+
|
|
235
|
+
# List running pods with costs
|
|
236
|
+
volt pods list | grep running
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Batch operations with jq
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Stop all running pods
|
|
243
|
+
volt pods list --json | jq -r '.[] | select(.status == "running") | .id' | xargs -I {} volt pods stop {}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Support
|
|
247
|
+
|
|
248
|
+
- Website: https://voltagegpu.com
|
|
249
|
+
- Documentation: https://docs.voltagegpu.com
|
|
250
|
+
- Email: support@voltagegpu.com
|
|
251
|
+
|
|
252
|
+
## License
|
|
253
|
+
|
|
254
|
+
MIT License - see LICENSE file for details.
|