Python SDK for the Yarn sovereign AI platform
Project description
yarn-au
Python SDK and CLI for Yarn, a sovereign AI compute platform with Australian data residency.
Install
pip install yarn-au
yarn login
Training script
Yarn uses three decorators to turn a standard PyTorch script into a submittable job. The same file runs locally with no changes.
import torch.nn as nn
from torch.optim import Adam
from torch.utils.data import TensorDataset
import yarn.train as yt
@yt.model
def create_model():
return nn.Sequential(nn.Linear(784, 256), nn.ReLU(), nn.Linear(256, 10))
@yt.dataset(batch_size=128, shuffle=True)
def load_data():
return {"train": TensorDataset(...), "val": TensorDataset(...)}
@yt.job
def train(model, data):
model = yt.prepare(model)
opt = Adam(model.parameters(), lr=1e-3)
loss_fn = nn.CrossEntropyLoss()
for epoch in range(yt.start_epoch, 10):
for x, y in data["train"]:
loss_fn(model(x), y).backward()
opt.step(); opt.zero_grad()
yt.report(epoch=epoch)
yt.checkpoint(model, opt, epoch=epoch)
Pre-flight check
--dry-run analyses your script without submitting:
$ yarn job submit train.py --gpu rtx-4090 --dry-run
Model 3 layers, 203,530 params
Memory weights 0.78 MB | grads 0.78 MB | optimizer 1.55 MB | activations ~2.1 MB
Total ~5.2 MB (RTX 4090: 24,576 MB available)
Fit YES — 0.02% VRAM utilised
Cost ~$0.12/hr × 10 epochs ≈ $0.03 estimated
CLI quickstart
yarn login # authenticate
yarn job submit train.py --gpu rtx-4090 # submit a job
yarn job submit train.py --dry-run # analyse without submitting
yarn job logs <job-id> # stream logs
yarn job list # list all jobs
yarn session create --gpu rtx-4090 # interactive GPU session
yarn models # available models
yarn gpus # GPU types and pricing
yarn balance # credit balance
yarn storage upload data/ /datasets/ # upload data
yarn storage download /results/ ./ # download results
yarn storage list /datasets/ # list remote files
Both yarn and yarn-au work as CLI entry points.
Decorator API
| Decorator / function | Purpose |
|---|---|
@yt.model |
Wraps a function returning nn.Module |
@yt.dataset(batch_size, shuffle) |
Wraps a function returning dict[str, Dataset] |
@yt.job(epochs=N) |
Wraps the training function; receives (model, data) |
yt.prepare(model) |
Device placement and distributed wrapping (DDP/FSDP) |
yt.data(loader) |
Prepare DataLoader for distributed training |
yt.report(**metrics) |
Log metrics to Yarn |
yt.checkpoint(model, opt, epoch=N) |
Save a resumable checkpoint |
yt.load_checkpoint(model, opt) |
Restore from latest checkpoint |
yt.start_epoch |
Epoch to resume from (0 if fresh) |
Requirements
- Python >= 3.10
- Dependencies:
requests,click
Documentation
Full docs at docs.yarn.prosodylabs.com.au.
License
Proprietary. Copyright 2025-2026 Prosody Labs Pty Ltd.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yarn_au-0.1.8.tar.gz.
File metadata
- Download URL: yarn_au-0.1.8.tar.gz
- Upload date:
- Size: 103.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad62a038595c6901898b32e5d2c22053c6cfe4440e65e7554e9572ced40bd209
|
|
| MD5 |
4d699bb05a73fd6eda7a4103a34ad92b
|
|
| BLAKE2b-256 |
06d228d0054f236d5533b1df27efaef3c0716da076c18fcb32d8f87290fa8876
|
File details
Details for the file yarn_au-0.1.8-py3-none-any.whl.
File metadata
- Download URL: yarn_au-0.1.8-py3-none-any.whl
- Upload date:
- Size: 58.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32fbaa3cbe42ae459c296a074e589d62cfb83ecb645996725605a1e61beddb24
|
|
| MD5 |
8246c046e5f5ad46501950f94f3b7ba9
|
|
| BLAKE2b-256 |
364608ab7820eecda1b91cf5484168364b295146b28c66a57f9e595776940f4c
|