Metadata-Version: 2.4
Name: swm-gpu
Version: 0.1.0
Summary: One CLI to search, provision, and manage cloud GPUs across 10 providers
Project-URL: Homepage, https://swmgpu.com
Project-URL: Repository, https://github.com/swm-gpu/swm
Project-URL: Documentation, https://swmgpu.com/overview/
Project-URL: Issues, https://github.com/swm-gpu/swm/issues
License: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: aws,azure,cli,cloud,coreweave,gcp,gpu,lambda,runpod,vastai
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.11
Requires-Dist: boto3>=1.34
Requires-Dist: click>=8.1
Requires-Dist: httpx>=0.27
Requires-Dist: rich>=13.0
Requires-Dist: tomli-w>=1.0
Provides-Extra: all
Requires-Dist: b2>=4.0; extra == 'all'
Requires-Dist: kubernetes>=29.0; extra == 'all'
Provides-Extra: b2
Requires-Dist: b2>=4.0; extra == 'b2'
Provides-Extra: coreweave
Requires-Dist: kubernetes>=29.0; extra == 'coreweave'
Provides-Extra: dev
Requires-Dist: nuitka; extra == 'dev'
Requires-Dist: ordered-set; extra == 'dev'
Requires-Dist: zstandard; extra == 'dev'
Description-Content-Type: text/markdown

<p align="center">
  <img src=".github/logo.svg" alt="swm" width="400" />
</p>

<p align="center">
  <a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" alt="License" /></a>
  <a href="https://pypi.org/project/swm/"><img src="https://img.shields.io/pypi/v/swm.svg" alt="PyPI" /></a>
  <a href="https://pypi.org/project/swm/"><img src="https://img.shields.io/pypi/pyversions/swm.svg" alt="Python" /></a>
</p>

<p align="center">
  <b>One CLI to rule all GPU clouds.</b><br/>
  Search pricing across 10 providers, spin up a GPU in seconds, sync your workspace, and track every dollar.
</p>

---

```
$ swm gpus -g h200 --max-price 4

  Live GPU Availability
┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃ Provider ┃ GPU              ┃ VRAM   ┃ $/hr     ┃ Stock   ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ vastai   │ NVIDIA H200      │ 141 GB │ $2.89/hr │ 12 avl  │
│ runpod   │ NVIDIA H200      │ 141 GB │ $3.49/hr │ High    │
│ lambda   │ NVIDIA H200      │ 141 GB │ $3.99/hr │ 4 avl   │
│ vultr    │ NVIDIA H200      │ 141 GB │ $3.88/hr │ 8 avl   │
└──────────┴──────────────────┴────────┴──────────┴─────────┘
```

## Install

```bash
# macOS (Homebrew)
brew tap swm-gpu/swm && brew install swm

# Python (3.11+)
pipx install swm

# From source
git clone https://github.com/swm-gpu/swm.git && cd swm && pip install -e .
```

## Quick Start

```bash
# 1. Add your API key
swm config set runpod.api_key <your-key>

# 2. Find a GPU
swm gpus -g h200

# 3. Create a pod
swm pod create -p runpod -g h200 -n my-session

# 4. Install a framework
swm setup install vllm runpod:<id>

# 5. Done — saves workspace and terminates
swm pod down runpod:<id>
```

## Or just ask your agent

Don't want to learn the CLI? Drop the [SKILL.md](SKILLS.md) into your project and your AI agent manages GPUs for you.

Works with **Cursor**, **Codex**, **Claude Code**, **Windsurf**, and any agent that can run shell commands.

## Supported Providers

| Provider | GPU Search | Provision | Stop/Resume | Billing API |
|----------|-----------|-----------|-------------|-------------|
| RunPod | Live | Yes | Yes | Full |
| Vast.ai | Live | Yes | Yes | Full |
| Lambda Labs | Live | Yes | — | — |
| Vultr | Live | Yes | Yes | — |
| TensorDock | Live | Yes | Yes | — |
| FluidStack | Live | Yes | Yes | — |
| AWS (EC2) | Live | Yes | Yes | — |
| GCP (Compute) | Live | Yes | Yes | — |
| Azure | Live | Yes | Yes | — |
| CoreWeave | Live | Yes | Yes | — |

## Key Features

### GPU Search & Provisioning

```bash
swm gpus                            # all GPUs, all providers
swm gpus -g h200 -c 4              # 4×H200 configs
swm gpus --max-price 4 --secure    # under $4/hr, certified clouds
swm pod create -p runpod -g h200 -n train
swm pod down runpod:<id>            # sync + terminate
```

### Workspace Sync

Your `/workspace` directory follows you across clouds via S3-compatible storage (Backblaze B2, Amazon S3, Google GCS).

```bash
swm sync push runpod:<id>           # pod → storage
swm sync pull runpod:<id>           # storage → pod
swm sync watch runpod:<id>          # auto-push on file changes
```

Three-tier smart sync: inotify watcher tracks changes, incremental push uploads only what changed, tar mode packs 600k small files into one S3 object.

### Frameworks

```bash
swm setup install vllm runpod:<id>       # vLLM inference server
swm setup install open-webui runpod:<id> # Open WebUI chat interface
swm setup install comfyui runpod:<id>    # ComfyUI image generation
swm setup install axolotl runpod:<id>    # Axolotl fine-tuning
swm setup install ollama runpod:<id>     # Ollama model runner
swm setup install swarmui runpod:<id>    # SwarmUI
swm setup install llm-studio runpod:<id> # H2O LLM Studio
```

Auto-detects GPU count for tensor parallelism, opens SSH tunnels for unexposed ports, probes health endpoints.

### Lifecycle Guard

Monitors SSH sessions, GPU utilization, filesystem writes, and active processes. If nothing's happening, it saves your workspace and terminates the pod.

```bash
swm guard enable runpod:<id> --policy auto-down --idle 30m
swm guard list
```

No more $96 overnight H100 bills.

### Cost Tracking

```bash
swm costs live                      # running cost right now
swm costs summary                   # spending breakdown
swm costs reconcile                 # verify against provider billing APIs
swm costs budget set 100            # $100/month alert
```

### Model Management

```bash
swm models search qwen3             # search HuggingFace Hub
swm models pull runpod:<id> Qwen/Qwen3-235B
swm models set runpod:<id> Qwen/Qwen3-235B  # hot-swap vLLM model
```

## How It Works

Everything happens over **SSH**. No agents on the pod. No custom images. No webhooks.

```
┌──────────┐       SSH        ┌─────────────┐       S3 API      ┌───────────┐
│ Your Mac │ ───────────────> │  GPU Pod    │ ────────────────> │ B2 / S3   │
│   swm    │  exec, scp      │  (any       │  s5cmd sync       │ / GCS     │
│          │ <─────────────── │   provider) │ <──────────────── │(workspace)│
└──────────┘                  └─────────────┘                   └───────────┘
```

Credentials are never stored on the pod. Storage keys are passed as transient environment variables per command.

## Security

- **SSH key authentication only** — no passwords stored anywhere
- **No credentials on pods** — storage keys passed transiently, never written to disk
- **Non-destructive syncs** — files are never deleted from your storage bucket
- **Secure cloud default** — `swm pod create` defaults to SOC 2 / HIPAA certified data centers

## Documentation

Full docs at **[swmgpu.com](https://swmgpu.com/overview/)**.

| Page | Description |
|------|-------------|
| [Getting Started (CLI)](https://swmgpu.com/getting-started/for-cli-users/) | Install and create your first pod in 5 minutes |
| [Getting Started (Agent)](https://swmgpu.com/getting-started/for-agent-users/) | Let your AI agent manage GPUs for you |
| [Configuration](https://swmgpu.com/getting-started/configuration/) | All config keys for providers and storage |
| [Command Reference](https://swmgpu.com/commands/gpus/) | Full reference for every swm command |
| [Core Concepts](https://swmgpu.com/concepts/providers/) | Providers, workspaces, frameworks, lifecycle guard |

## Requirements

- macOS or Linux
- Python 3.11+ (if not using Homebrew binary)
- SSH client (`ssh`, `scp`)
- An account with at least one GPU provider

## License

Licensed under the [Apache License, Version 2.0](LICENSE).
