Two lines to hatch a life - lightweight training-run logger for Lossy (wandb-shaped, zero deps)
Project description
lossy
Two lines to hatch a life. A tiny, zero-dependency training-run logger that feeds the Lossy pet — a wandb-shaped API with none of the weight.
import lossy
run = lossy.init(project="my-project", name="run-1", config={"lr": 3e-4})
for step in range(1, 301):
loss = train_step()
lossy.log({"train/loss": loss}, step=step)
run.finish()
Setup
Pair with the Lossy app (Settings → Lossy SDK) to get your token, then:
export LOSSY_TOKEN=lossy_xxxxx # pairing token from the app
export LOSSY_API=https://your-deployment.vercel.app # optional; defaults to prod
No token? Your script still runs exactly as before — the SDK goes inert with a single warning. It never raises, never blocks, never slows a training loop: logging is a lock-guarded append to a bounded in-memory queue (oldest points drop past 10k), a background thread ships batches (≥50 points or every 5s) with retries and backoff, and every network failure is a stderr warning, not an exception.
Crash honesty
Uncaught exceptions are reported as crashed with an exception summary
(sys.excepthook); a clean finish() — or a clean exit without one
(atexit) — reports finished. Hard kills (OOM/SIGKILL) can't run hooks;
the server's liveness sweep covers those.
Ctrl-C currently reports crashed too (distinguishable downstream via
exitInfo.type == "KeyboardInterrupt"); a distinct "interrupted" state is a
recorded product decision for later.
Environment knobs (mostly for tests)
LOSSY_TOKEN, LOSSY_API, LOSSY_FLUSH_INTERVAL, LOSSY_BATCH_SIZE,
LOSSY_QUEUE_MAX, LOSSY_MAX_RETRIES, LOSSY_BACKOFF_BASE,
LOSSY_HTTP_TIMEOUT, LOSSY_FINISH_TIMEOUT.
Tests
cd sdk && uv run --with pytest pytest
Fully offline — an in-process stub server plays the S1 ingest API.
Project details
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 lossy-0.2.0.tar.gz.
File metadata
- Download URL: lossy-0.2.0.tar.gz
- Upload date:
- Size: 28.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
992edd7c353d251715bbeebd49baab00ba7f7017d1ff65bb8acf17b7a5c2df65
|
|
| MD5 |
8b83b067bb9a3969c8a3923b5965e3f6
|
|
| BLAKE2b-256 |
4ccc5f45fdc6a5b03c06839c16fa03788fc40a1c7cef1c266071293ab605fb5e
|
Provenance
The following attestation bundles were made for lossy-0.2.0.tar.gz:
Publisher:
publish-sdk.yml on benrio0923/lossy-
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lossy-0.2.0.tar.gz -
Subject digest:
992edd7c353d251715bbeebd49baab00ba7f7017d1ff65bb8acf17b7a5c2df65 - Sigstore transparency entry: 2138241580
- Sigstore integration time:
-
Permalink:
benrio0923/lossy-@d12c9a8d41d25c816a630415e8022b2e93bd0272 -
Branch / Tag:
refs/tags/sdk-v0.2.0 - Owner: https://github.com/benrio0923
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@d12c9a8d41d25c816a630415e8022b2e93bd0272 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lossy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: lossy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9660d6244e137c8b040079c8897ab5eef0f8097195d570332da00739ab5dfb80
|
|
| MD5 |
4988ee8457d367a92049f3a7d7109bd5
|
|
| BLAKE2b-256 |
4ec2dae76fb4da094671e792aca13564cfb447273f01803ca2c82002419f9ceb
|
Provenance
The following attestation bundles were made for lossy-0.2.0-py3-none-any.whl:
Publisher:
publish-sdk.yml on benrio0923/lossy-
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lossy-0.2.0-py3-none-any.whl -
Subject digest:
9660d6244e137c8b040079c8897ab5eef0f8097195d570332da00739ab5dfb80 - Sigstore transparency entry: 2138241585
- Sigstore integration time:
-
Permalink:
benrio0923/lossy-@d12c9a8d41d25c816a630415e8022b2e93bd0272 -
Branch / Tag:
refs/tags/sdk-v0.2.0 - Owner: https://github.com/benrio0923
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@d12c9a8d41d25c816a630415e8022b2e93bd0272 -
Trigger Event:
push
-
Statement type: