Cybernetics Python SDK for hosted rollout, sampling, and training control
Project description
Cybernetics Python SDK
cybernetic-physics is the Python client for the hosted Cybernetics platform —
a Tinker-like API for rollout, sampling, and LoRA training on platform-managed
GPU compute leases.
pip install cybernetic-physics # distribution name; the import package is `cybernetics`
export CYBERNETICS_API_KEY="cp_live_..." # or run: cybernetics auth login
cybernetics doctor # read-only API/auth/SFT/RL readiness check
Install directly from GitHub when you want the current repo version:
uv add "cybernetic-physics @ git+https://github.com/cybernetic-physics/cybernetic.git"
pip install "cybernetic-physics @ git+https://github.com/cybernetic-physics/cybernetic.git"
For pyproject.toml:
dependencies = [
"cybernetic-physics @ git+https://github.com/cybernetic-physics/cybernetic.git",
]
import cybernetics
from cybernetics import types
service_client = cybernetics.ServiceClient(project_id="robotics-lab")
training_client = service_client.create_lora_training_client(base_model="dreamzero-droid")
tokenizer = training_client.get_tokenizer() # requires the [tokenizers] extra
datum = types.Datum(
model_input=types.ModelInput.from_ints(tokens=tokenizer.encode("example")),
loss_fn_inputs={
"target_tokens": types.TensorData(data=[1, 2, 3], dtype="int64", shape=[3]),
"weights": types.TensorData(data=[1.0, 1.0, 1.0], dtype="float32", shape=[3]),
},
)
training_client.forward_backward([datum], "cross_entropy").result()
training_client.optim_step(types.AdamParams(learning_rate=1e-4)).result()
Authentication
The SDK authenticates to the control plane with your cp_live_ key sent as
Authorization: Bearer .... Keys are resolved in this order:
- an explicit
api_key=argument, - the
CYBERNETICS_API_KEYenvironment variable, - the stored login written by
cybernetics auth login(~/.config/cybernetics/auth.json).
Readiness checks
Run cybernetics doctor before launching GPU work. It checks API reachability,
authentication, advertised training/sampling support, and DreamZero SFT/RL
capabilities without creating a Worldlines session, model, compute lease, or
future.
CYBERNETICS_BASE_URL=https://luc-api.cyberneticphysics.com cybernetics doctor
cybernetics doctor --require-rl
cybernetics --format json doctor
--require-rl exits nonzero unless the backend advertises the requested
DreamZero RL loss family (flow_rwr by default). This keeps SFT-only
deployments usable while making RL readiness explicit in CI and runbooks.
DreamZero examples
The repository ships an SDK-native DreamZero SFT smoke at
examples/dreamzero_sft_smoke.py. Its default mode is local-only and safe for
CI:
python examples/dreamzero_sft_smoke.py
python examples/dreamzero_rl_smoke.py
Run cybernetics doctor first, then add --remote-run only when you want the
example to create a hosted session/model, run forward_backward, apply
optim_step, and save a checkpoint. Remote examples cancel their session on
exit by default; pass --keep-lease only when you deliberately want to debug
inside the paid container. Use --timeout to bound cold-start/model-create
waits. During hosted startup, SDK queue logs surface sanitized provider progress
and worker-heartbeat waits when the control plane has that detail; once the
backend accepts work, a cold DreamZero create_model can also report active
register_model while Wan/DreamZero assets hydrate and load.
For RL readiness, use:
cybernetics doctor --require-rl
python examples/dreamzero_sft_smoke.py --remote-run --timeout 2400 --cleanup-timeout 300
python examples/dreamzero_rl_smoke.py --remote-run --timeout 2400 --cleanup-timeout 300
The RL smoke sends a tiny synthetic DreamZero trajectory through flow_rwr.
That validates the same Tinker-compatible TrainingClient.forward_backward
surface as SFT while exercising the DreamZero RL loss path. On a cold backend
image the first run may spend several minutes pulling and extracting the hosted
backend image before the worker heartbeat appears, then hydrate the
Wan/DreamZero asset cache and load sharded model weights. Use a timeout large
enough for that first run, and use cybernetics doctor --require-rl before
spending GPU time.
Optional dependencies
| Extra | Adds | Needed for |
|---|---|---|
tokenizers |
transformers |
get_tokenizer() |
aiohttp |
aiohttp |
the aiohttp transport |
torch |
torch |
local tensor interop |
all |
all of the above | everything |
numpy is a core dependency. transformers, aiohttp, and torch are not —
install the relevant extra (pip install 'cybernetic-physics[tokenizers]') when
you need them.
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 cybernetic_physics-0.16.1.tar.gz.
File metadata
- Download URL: cybernetic_physics-0.16.1.tar.gz
- Upload date:
- Size: 377.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 |
6c12ab65f64e2a4b251584d17e9a7e7f40c7b6d61659a51225696e8394dd8250
|
|
| MD5 |
41e5041d066bbb3892a15267fabc46e4
|
|
| BLAKE2b-256 |
1c2ef97806f01beaa9a54d64ecc2abdbc0648aa058217bcbff7fbc81fb926078
|
Provenance
The following attestation bundles were made for cybernetic_physics-0.16.1.tar.gz:
Publisher:
publish.yml on cybernetic-physics/cybernetic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cybernetic_physics-0.16.1.tar.gz -
Subject digest:
6c12ab65f64e2a4b251584d17e9a7e7f40c7b6d61659a51225696e8394dd8250 - Sigstore transparency entry: 2124051447
- Sigstore integration time:
-
Permalink:
cybernetic-physics/cybernetic@656b9085c53cd14e0ea43c7868fa0f71a5a7c119 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cybernetic-physics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@656b9085c53cd14e0ea43c7868fa0f71a5a7c119 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file cybernetic_physics-0.16.1-py3-none-any.whl.
File metadata
- Download URL: cybernetic_physics-0.16.1-py3-none-any.whl
- Upload date:
- Size: 287.7 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 |
836b0c56b3003107080bb54fbff05b958a7778456f9009b539aade7cc8a4bbec
|
|
| MD5 |
6a61f83c5a60e2127b7c11e483688177
|
|
| BLAKE2b-256 |
985389984ccf40c9c9fd85142247f6f71ed4b1a00b40d9c0bbaa04164b1c7a96
|
Provenance
The following attestation bundles were made for cybernetic_physics-0.16.1-py3-none-any.whl:
Publisher:
publish.yml on cybernetic-physics/cybernetic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cybernetic_physics-0.16.1-py3-none-any.whl -
Subject digest:
836b0c56b3003107080bb54fbff05b958a7778456f9009b539aade7cc8a4bbec - Sigstore transparency entry: 2124051470
- Sigstore integration time:
-
Permalink:
cybernetic-physics/cybernetic@656b9085c53cd14e0ea43c7868fa0f71a5a7c119 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cybernetic-physics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@656b9085c53cd14e0ea43c7868fa0f71a5a7c119 -
Trigger Event:
workflow_dispatch
-
Statement type: