Skip to main content

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

lossy-0.1.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lossy-0.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file lossy-0.1.0.tar.gz.

File metadata

  • Download URL: lossy-0.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lossy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8aff554edfe8a2274f45e25c9808afd15cfe44162b4df993a7bc24ddd2934488
MD5 0c66b85a3754aedd2e6fe13f46959285
BLAKE2b-256 ea1cd3ecd7f4170dbdf16a5e1e9a210ea0e20d4114ca4497ebaaac9882681fc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for lossy-0.1.0.tar.gz:

Publisher: publish-sdk.yml on benrio0923/lossy-

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lossy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lossy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lossy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4978caf517b754d132b80be51cadd3c20a77e8be9a382fbc009b1b0ae4a3b5d
MD5 e3c06386a8c95c7bd576457ed0e232f1
BLAKE2b-256 2229e4e1107fad7a773000fbdf24f4d4b57779e2d0ed3a7e878b61a103f235d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for lossy-0.1.0-py3-none-any.whl:

Publisher: publish-sdk.yml on benrio0923/lossy-

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page