Skip to main content

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:

  1. an explicit api_key= argument,
  2. the CYBERNETICS_API_KEY environment variable,
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cybernetic_physics-0.16.1.tar.gz (377.1 kB view details)

Uploaded Source

Built Distribution

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

cybernetic_physics-0.16.1-py3-none-any.whl (287.7 kB view details)

Uploaded Python 3

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

Hashes for cybernetic_physics-0.16.1.tar.gz
Algorithm Hash digest
SHA256 6c12ab65f64e2a4b251584d17e9a7e7f40c7b6d61659a51225696e8394dd8250
MD5 41e5041d066bbb3892a15267fabc46e4
BLAKE2b-256 1c2ef97806f01beaa9a54d64ecc2abdbc0648aa058217bcbff7fbc81fb926078

See more details on using hashes here.

Provenance

The following attestation bundles were made for cybernetic_physics-0.16.1.tar.gz:

Publisher: publish.yml on cybernetic-physics/cybernetic

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

File details

Details for the file cybernetic_physics-0.16.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cybernetic_physics-0.16.1-py3-none-any.whl
Algorithm Hash digest
SHA256 836b0c56b3003107080bb54fbff05b958a7778456f9009b539aade7cc8a4bbec
MD5 6a61f83c5a60e2127b7c11e483688177
BLAKE2b-256 985389984ccf40c9c9fd85142247f6f71ed4b1a00b40d9c0bbaa04164b1c7a96

See more details on using hashes here.

Provenance

The following attestation bundles were made for cybernetic_physics-0.16.1-py3-none-any.whl:

Publisher: publish.yml on cybernetic-physics/cybernetic

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