Metadata-Version: 2.4
Name: velar-sdk
Version: 0.2.2
Summary: Velar Python SDK - Deploy ML models to GPUs with one command
Author-email: Velar Labs <hello@velar.run>
License: Apache-2.0
Project-URL: Homepage, https://velar.run
Project-URL: Documentation, https://velar.run/docs
Project-URL: Repository, https://github.com/velarrun/velar
Project-URL: Bug Tracker, https://github.com/velarrun/velar/issues
Keywords: gpu,ml,machine-learning,deployment,cloud
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
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
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.25.0
Requires-Dist: pydantic>=2.0
Requires-Dist: click>=8.0
Requires-Dist: docker>=7.0
Requires-Dist: rich>=13.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

# Velar Python SDK

Deploy ML models to GPUs with one command.

## Installation

```bash
pip install velar-sdk
```

## Authentication

```bash
velar login
```

This opens your browser, signs you in, and saves an API key to `~/.velar/token` automatically.

## Quick Start

```python
import velar

app = velar.App("my-model")

image = velar.Image.from_registry("pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime")
image = image.pip_install("transformers", "accelerate")

@app.function(gpu="A100", image=image)
def run_inference(prompt: str) -> str:
    from transformers import pipeline
    pipe = pipeline("text-generation", model="gpt2")
    return pipe(prompt)[0]["generated_text"]

@app.local_entrypoint()
def main():
    result = run_inference.remote("Hello, world!")
    print(result)
```

**Deploy:**

```bash
velar deploy app:app
```

**Run locally (calls the remote GPU):**

```bash
velar run app:app
```

## GPU Types

| Name | VRAM | Price/hr |
|------|------|----------|
| `A100` | 80 GB | $3.20 |
| `A10` | 24 GB | $1.40 |
| `L4` | 24 GB | $0.85 |

## Image Builder

```python
image = (
    velar.Image.from_registry("python:3.11-slim")
    .pip_install("torch", "transformers")
    .run_commands("apt-get update && apt-get install -y ffmpeg")
    .env(HF_HOME="/tmp/hf")
)
```

## CLI Reference

```bash
velar login              # Authenticate via browser
velar deploy app:app     # Deploy to GPU cloud
velar run app:app        # Run local entrypoint
velar status             # List deployments
velar balance            # Show credit balance
velar cancel <id>        # Cancel a deployment
velar token set <key>    # Set API key manually
velar whoami             # Show current user
```

## Links

- [velar.run](https://velar.run)
- [Dashboard](https://velar.run/dashboard)
