losscape Python SDK
Install it with pip install losscape-sdk, and import it as lsc. The package named plain
losscape is an unrelated project.
import lsc
with lsc.init(project="mnist", config={"lr": 1e-3, "batch_size": 64}) as run:
for step in range(10_000):
loss = train_step()
run.log({"train/loss": loss, "lr": scheduler.get_last_lr()[0]})
if step % 1000 == 0:
run.log({"val": {"loss": val_loss, "acc": val_acc}}, step=step) # -> val/loss, val/acc
run.summary["best_acc"] = best_acc
The API follows Weights & Biases: init, log (with step / commit), config,
summary, finish, context manager, lsc.log(...) on the current run.
The project must exist: create it in the web UI (New project) and be its owner or an editor.
A run logged to an unknown project is refused by the server; its data stays in the local log,
so losscape sync uploads it once the project is created.
How it works
log()appends to an in-memory buffer (~1 µs for 20 metrics) and never touches the network.- A Rust background thread writes the buffer every 100 ms as one batch to a local log
(
.losscape/runs/<run id>/) and uploads from there, retrying until the server confirms. - Killed process, server down, offline mode: the data stays in the local log.
losscape syncuploads it. At most ~100 ms of logging is lost onkill -9.
Also recorded with every run: console output (what the process and its subprocesses
print, progress bars kept as one line), system metrics, and the environment (git commit
and uncommitted diff, packages, OS, CPU, GPUs and driver, Slurm job, container). Values
that look like secrets are hidden: config strings under names like api_key or
hf_token, and strings shaped like known tokens.
Settings
| Argument | Environment | Default |
|---|---|---|
project |
LOSSCAPE_PROJECT |
uncategorized |
mode |
LOSSCAPE_MODE |
online (offline, disabled) |
dir |
LOSSCAPE_DIR |
./.losscape |
server |
LOSSCAPE_SERVER |
http://localhost:8080 |
api_key |
LOSSCAPE_API_KEY |
required online: create one in the web UI, Settings > API keys |
console |
LOSSCAPE_CONSOLE |
on: stdout and stderr are recorded (off on Windows and in Jupyter) |
system_metrics |
LOSSCAPE_SYSTEM_METRICS |
on: CPU, memory, disk, network, NVIDIA GPUs |
LOSSCAPE_SYSTEM_INTERVAL |
5 s | |
finish(timeout=) |
LOSSCAPE_FINISH_TIMEOUT |
60 s |
LOSSCAPE_SILENT=1 |
print nothing |
Other things
lsc.utils.random_name()->brave-falcon-42(not affected byrandom.seed).lsc.init(id=..., resume=True)continues a run where it stopped.- Forked children (e.g. DataLoader workers) can't log to the parent's run; their calls are ignored with a warning.
Development
uv sync # builds the Rust core in place
uv run pytest # unit tests
uv run python benchmarks/bench_log.py # log() latency
Metadata
Release files for losscape-sdk 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| losscape_sdk-0.1.2-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for losscape_sdk-0.1.2-cp310-abi3-win_amd64.whl |
| losscape_sdk-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details for losscape_sdk-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl |
| losscape_sdk-0.1.2-cp310-abi3-manylinux_2_28_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ ARM64 | Details for losscape_sdk-0.1.2-cp310-abi3-manylinux_2_28_aarch64.whl |
| losscape_sdk-0.1.2-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for losscape_sdk-0.1.2-cp310-abi3-macosx_11_0_arm64.whl |
Total release size: 13.3 MB
Release files / losscape_sdk-0.1.2-cp310-abi3-win_amd64.whl
| Download URL | losscape_sdk-0.1.2-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
bedd21fc1bf57a697f0af20c7a8b6776a02636bba13e8b7c96c3cb1d343afc20
|
|
BLAKE2b-256 checksum How to use checksums |
57cebe728d19c3d8570255c8d9372e878c657fe231a7429c2c87b53b9b04e550
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logRelease files / losscape_sdk-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | losscape_sdk-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ce0119e0e815d818bfc3ffb1fe60e2d1ba0a656e36df6e8094a632a84417b552
|
|
BLAKE2b-256 checksum How to use checksums |
c3e5a51b75392544369a5e22c00ff53e3dd0cd43ae6a8d3d566012405ae78bed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logRelease files / losscape_sdk-0.1.2-cp310-abi3-manylinux_2_28_aarch64.whl
| Download URL | losscape_sdk-0.1.2-cp310-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
62fc58baa01850e9b28c9fbfabc21524cef83167b4014259850e3c7d704274eb
|
|
BLAKE2b-256 checksum How to use checksums |
99c8ba3bb7f1fa227070ca690074622edbee62b9498303bcf876342006f19621
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logRelease files / losscape_sdk-0.1.2-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | losscape_sdk-0.1.2-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
dfbd52189d18e025fb7532b6df1db2427af002af8b343b4fd0fb9704de1b7f16
|
|
BLAKE2b-256 checksum How to use checksums |
d98bb2c63c3987429bdc1b6281491cad1e561c73a09960ae16c93ec45147c91b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logSecurity for losscape-sdk 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for losscape_sdk-0.1.2-cp310-abi3-win_amd64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.