Metadata-Version: 2.4
Name: voltagegpu-cli
Version: 1.1.0
Summary: VoltageGPU CLI - Manage GPU pods, confidential compute, and fine-tuning jobs from the command line. Deploy, train, and scale AI workloads on voltagegpu.com.
Project-URL: Homepage, https://voltagegpu.com
Project-URL: Documentation, https://docs.voltagegpu.com
Project-URL: Repository, https://github.com/voltagegpu/voltagegpu-cli
Project-URL: Issues, https://github.com/voltagegpu/voltagegpu-cli/issues
Author-email: VoltageGPU <support@voltagegpu.com>
License-File: LICENSE
Keywords: ai,cli,cloud,confidential-compute,deep-learning,fine-tuning,gpu,machine-learning,voltagegpu
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: System :: Distributed Computing
Requires-Python: >=3.9
Requires-Dist: click>=8.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: rich>=13.0
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: wheel; extra == 'dev'
Provides-Extra: docs
Requires-Dist: sphinx-rtd-theme>=1.3; extra == 'docs'
Requires-Dist: sphinx>=7.3; extra == 'docs'
Description-Content-Type: text/markdown

# VoltageGPU CLI

Command-line interface and Python SDK for VoltageGPU - affordable GPU cloud computing for AI/ML workloads.

## Installation

```bash
pip install voltagegpu-cli
```

Or install from source:

```bash
git clone https://github.com/voltagegpu/voltagegpu-cli.git
cd voltagegpu-cli
pip install -e .
```

## Quick Start

### 1. Configure your API key

Set the environment variable:

```bash
export VOLT_API_KEY="your_api_key_here"
```

Or create a config file at `~/.volt/config.ini`:

```ini
[api]
api_key = your_api_key_here
```

### 2. List available templates

```bash
volt templates list
```

### 3. Create a pod

```bash
volt pods create --template <template_id> --name my-gpu-pod
```

### 4. SSH into your pod

```bash
volt pods ssh <pod_id>
```

## CLI Commands

### Pods

```bash
# List all pods
volt pods list
volt pods list --json

# Get pod details
volt pods get <pod_id>

# Create a new pod
volt pods create --template <template_id> --name <name> [--gpu-count 1] [--ssh-key <key_id>]

# Start/Stop/Delete pods
volt pods start <pod_id>
volt pods stop <pod_id>
volt pods delete <pod_id> [--yes]

# Get SSH command
volt pods ssh <pod_id>
```

### Templates

```bash
# List available templates
volt templates list
volt templates list --category llm
volt templates list --json

# Get template details
volt templates get <template_id>
```

### SSH Keys

```bash
# List SSH keys
volt ssh-keys list

# Add a new SSH key
volt ssh-keys add --name "my-key" --file ~/.ssh/id_ed25519.pub
volt ssh-keys add --name "my-key" --key "ssh-ed25519 AAAA..."

# Delete an SSH key
volt ssh-keys delete <key_id>
```

### Machines

```bash
# List available machines
volt machines list
volt machines list --gpu RTX4090
volt machines list --json
```

### Account

```bash
# Check balance
volt account balance

# Get account info
volt account info
```

### Configuration

```bash
# Show current configuration
volt config
```

## Python SDK

You can also use VoltageGPU as a Python library:

```python
from volt import VoltageGPUClient

# Initialize client (uses VOLT_API_KEY env var or ~/.volt/config.ini)
client = VoltageGPUClient()

# List pods
pods = client.list_pods()
for pod in pods:
    print(f"{pod.name}: {pod.status} ({pod.gpu_type})")

# Create a pod
pod = client.create_pod(
    template_id="template-123",
    name="my-training-pod",
    gpu_count=2
)
print(f"Created pod: {pod.id}")

# Get SSH connection info
pod = client.get_pod(pod.id)
print(f"SSH: ssh -p {pod.ssh_port} root@{pod.ssh_host}")

# Stop and delete
client.stop_pod(pod.id)
client.delete_pod(pod.id)
```

### Context Manager

```python
from volt import VoltageGPUClient

with VoltageGPUClient() as client:
    templates = client.list_templates()
    for t in templates:
        print(f"{t.name}: ${t.hourly_price}/hr")
```

### Custom Configuration

```python
from volt.sdk import Config, VoltageGPUClient

config = Config(
    api_key="your_api_key",
    base_url="https://voltagegpu.com/api"
)
client = VoltageGPUClient(config=config)
```

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `VOLT_API_KEY` | Your VoltageGPU API key | - |
| `VOLT_BASE_URL` | API base URL | `https://voltagegpu.com/api` |
| `LIUM_API_KEY` | Legacy API key (fallback) | - |

## Configuration File

Create `~/.volt/config.ini`:

```ini
[api]
api_key = your_api_key_here
```

## Output Formats

Most list commands support `--json` flag for machine-readable output:

```bash
volt pods list --json | jq '.[] | select(.status == "running")'
```

## Examples

### Launch a training job

```bash
# Find a suitable template
volt templates list --category ml

# Create pod with SSH key
volt pods create \
  --template pytorch-cuda12 \
  --name training-job \
  --gpu-count 4 \
  --ssh-key my-key-id

# Get SSH command
volt pods ssh <pod_id>
```

### Monitor costs

```bash
# Check balance
volt account balance

# List running pods with costs
volt pods list | grep running
```

### Batch operations with jq

```bash
# Stop all running pods
volt pods list --json | jq -r '.[] | select(.status == "running") | .id' | xargs -I {} volt pods stop {}
```

## Support

- Website: https://voltagegpu.com
- Documentation: https://docs.voltagegpu.com
- Email: support@voltagegpu.com

## License

MIT License - see LICENSE file for details.
