Metadata-Version: 2.4
Name: yarn-sdk
Version: 0.1.0
Summary: Python SDK for Yarn — sovereign GPU compute for Australian researchers
Project-URL: Homepage, https://prosodylabs.com.au
Project-URL: Repository, https://github.com/prosodylabs/yarn
Author-email: Prosody Labs <jordan@prosodylabs.com.au>
License: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: requests>=2.28
Description-Content-Type: text/markdown

# Yarn SDK

Python SDK for [Yarn](https://prosodylabs.com.au) -- sovereign GPU compute for Australian researchers.

## Install

```bash
pip install yarn-sdk
```

## Quick Start

```python
import yarn

client = yarn.Client(
    api_key="yarn_...",  # from Account Portal -> API Keys
    base_url="https://api.yarn.prosodylabs.com.au",
)

# Submit a training job (single file)
job = client.jobs.submit(
    "my-experiment",
    script="train.py",
    gpu_count=1,
    pip_packages=["torch", "wandb"],
)

# Submit a multi-file project
job = client.jobs.submit(
    "kairos-phase1",
    directory="./my_project/",  # bundles all .py, .yaml, .json, etc.
    pip_packages=["torch", "wandb"],
)

# Wait for results
result = client.jobs.wait(job["job_id"])

# Stream logs
for line in client.jobs.stream_logs(job["job_id"]):
    print(line)
```

## Interactive Sessions

```python
with client.sessions.session("my-session", gpu_count=1) as session:
    print(session.ray_address)  # Connect Ray client
    print(session.dashboard_url)
```

## Features

- **Jobs**: Submit training code, poll status, stream logs, retrieve results
- **Sessions**: Interactive GPU sessions with Ray
- **Notebooks**: JupyterLab workloads
- **Storage**: Upload/download datasets and checkpoints
- **Billing**: Check credit balance, view usage
- **Secrets**: Manage API keys and tokens for training jobs
- **Chat**: SSE streaming inference

## Authentication

Get an API key from the Account Portal at `account.yarn.prosodylabs.com.au` -> API Keys.

```python
client = yarn.Client(api_key="yarn_...")
```

## License

MIT
