Skip to main content

LearnML Python SDK 0.1.4

HTTP(S) URLs select the website API; bare host:port addresses retain direct gRPC.

from getpass import getpass
from learnml import LearnMLClient

with LearnMLClient("https://your-learnml-server.example") as client:
    client.login("you@example.com", getpass("LearnML password: "))
    universe = next(u for u in client.list_universes() if u["name"] == "My experiments")
    uid = universe["id"]
    run = client.create_training_run(uid, "my-experiment", model_name="my-model")
    client.log_metrics(uid, run["id"], step=1, loss=0.42, accuracy=0.91)
    client.upload_data(uid, "experiment-data", "CUSTOM", "experiment.csv")
    client.end_training_run(uid, run["id"])

Install with python -m pip install --upgrade learnml-sdk, or install a local checkout with python -m pip install ./sdk. Restart a notebook kernel after upgrading an already-imported package. HTTP support requires version 0.1.3 or later.

HTTP mode preserves the existing public methods and camelCase response dictionaries. token and refresh state work in both modes. Requests have connection/read timeouts; API and network errors use the SDK exception classes. HTTP multipart uploads stream from the client file; the current gateway still buffers uploads in server memory. chunk_size controls gRPC chunks; the HTTP transport controls its own multipart read sizes. HTTP collection batching uses paginated API calls.

The existing gateway cannot accept custom checkpoint metadata; HTTP save_checkpoint(metadata=...) raises an explicit error if nonempty metadata is supplied. Empty metadata and the normal checkpoint upload/download flow are supported.

Run regression tests with python -m unittest discover -s sdk/tests from the repository root after installing the SDK.

API tokens for Colab and long-running jobs

Sign in to the website, open API Tokens, and select Generate token. Give the token a name and choose No expiry — until revoked, or a fixed expiry. Copy the full token immediately: it is shown only once. Token hashes, names, prefixes and timestamps are stored on the server; full secrets cannot be retrieved later.

Save it in Colab Secrets as LEARNML_API_TOKEN, enable notebook access, and use:

from google.colab import userdata
from learnml import LearnMLClient

client = LearnMLClient(
    "your-learnml-server.example:50051",
    token=userdata.get("LEARNML_API_TOKEN"),
)
# No login or token-refresh loop is required.
print(client.list_universes())

HTTP clients also accept the same token. The token= argument works in older SDK versions; SDK 0.1.4 adds the explicit api_token= alias. Pass one of these arguments, not both.

To manage tokens from SDK 0.1.4, first sign in using client.login(...), then call:

  • create_api_token(name, expires_in_days=0) returns { "apiToken": {...}, "token": "lml_..." } once. Zero days means no automatic expiry; 1–3650 days sets an expiry.
  • list_api_tokens() returns metadata and token prefixes, never full secrets.
  • revoke_api_token(token_id) disables an owned token on its next request.

API tokens inherit your current workspace permissions; removing membership removes access. They cannot create, list, or revoke credentials. Use a password-based login session to manage tokens. Store tokens like passwords; their presence does not add encryption to a plaintext HTTP/gRPC connection.

Release files for learnml-sdk 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for learnml-sdk 0.1.4
File Size Uploaded
learnml_sdk-0.1.4.tar.gz 27.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for learnml-sdk 0.1.4
File Interpreter ABI Platform
learnml_sdk-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 60.2 kB

Release files / learnml_sdk-0.1.4.tar.gz

Download URL learnml_sdk-0.1.4.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2167030fdb0da81df06707d1a2b48be68b81424fb91c3e506ba85c9da08a9687
BLAKE2b-256 checksum
How to use checksums
395a6103a3246384df40bdf82c650f705a2d46b973cf7bf68b9fd0a9a8b30998
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

Release files / learnml_sdk-0.1.4-py3-none-any.whl

Download URL learnml_sdk-0.1.4-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3fc17c570a3e6dac92b9bec49e7187105ab67a8ebc1f2fc2001002037374721
BLAKE2b-256 checksum
How to use checksums
026d58497adfc3a8401dd02db144acf67590dc90a99c1edf201f0da04d80a1d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page