Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ubrain: Untrained Brain

Never trained, always learning.

A brain you can run on a laptop. It learns from experience by local plasticity, as synapses do: one-shot memories, values learned from reward, a cerebellum that learns its body. No pre-training, no gradient descent, no dataset. Plug in any trained AI model (CLIP, a language model) as its senses, and any body (a simulated humanoid robot, a Gymnasium game) as its interface.

Every behaviour of the brain follows a law written down before it was measured, and ubrain can tell you, before you run it, what the brain will do with your model's codes: a certificate.

Five minutes to a learning brain

git clone https://github.com/untrained-brain/ubrain
cd ubrain
uv run examples/01_whole_brain.py   # the whole brain learns which action each picture asks for
uv run examples/03_keep.py          # save it, load it, and it continues exactly

(uv installs Python and the dependencies for you; numpy is the only one.)

On Windows, clone with long paths on, or the robot's kitchen world stops the checkout half-way ("Filename too long"):

git clone -c core.longpaths=true https://github.com/untrained-brain/ubrain

(Prefer the clone to the ZIP download: Windows' own unzip has the same 260-character path limit.)

Every example uses the whole brain, Brain(), and has the same shape: what it shows, the question, a twin (the same run with one thing changed), and a check -- its last line is CHECK PASS or CHECK FAIL, and its exit code says the same.

example the question needs
00_check_setup.py is this computer ready for the robot examples? (2 minutes) the body
01_whole_brain.py does the whole brain learn which action each picture asks for? (twin: unrelated pictures) nothing
02_ask.py what does the brain say about itself: describe, read, datasheet, health? nothing
03_keep.py does a saved and loaded brain choose exactly what the original would? nothing
04_g1_brace.py does the whole brain keep the G1 up when a tone warns of a push? (twin: no tone) the body
05_g1_choose.py does it learn which way to turn from a picture? (twin: unrelated pictures) the body
06_g1_keep.py trained, saved and loaded: does the demo brain stay up where a fresh one falls? the body
07_g1_lead.py how long a warning can the cerebellum use? (a prediction written first, and it failed) the body
08_g1_vision.py what does the brain call new, seeing through the head camera with CLIP? (twin: covered camera) the body, --extra vision, the CLIP weights

"The body" means the robot, set up once: it ships in this repository, in bodies/mujoco (its own environment: MuJoCo, the G1, the photo gallery); cd bodies/mujoco && uv sync. The robot examples take --viewer to watch in real time. "The CLIP weights" are fetched once per machine (about 600 MB).

Use it in your own code

ubrain is on PyPI as compiled wheels (Windows, macOS, Linux; Python 3.11-3.13). Every version is a pre-release until 1.0, so name the version (or allow pre-releases):

uv add "ubrain==0.46.0.dev3"
# or with pip:  pip install "ubrain==0.46.0.dev3"      (or: pip install --pre ubrain)

The same wheels are in this repository's wheels/ folder, for a machine without PyPI access (pip install ubrain==0.46.0.dev3 --find-links /path/to/ubrain/wheels). The robot, the examples and the docs are in the repository: https://github.com/untrained-brain/ubrain.

The whole brain needs no wiring: choose a variant, attach streams by port class, tick it (a preview: the whole is not yet certified as a whole; examples/01_whole_brain.py shows what it does and the law beside it):

from ubrain import Brain, GaussianCodes
brain = Brain(variant="small")
brain.attach("sense", "vision", codec=GaussianCodes(dim=64, seed=1))   # any frozen model as the codec
brain.attach("reward")
brain.attach("action", n=4)
action = brain.tick({"sense.vision": 2, "reward": None})["action"]

A robot: ubrain.bodies.g1.G1(hello).attach(brain) adds the body's streams (body, cue, goal, command); see examples/04_g1_brace.py.

Extras, each installed only when you ask for it: ubrain[vision] (CLIP as a sense: torch, transformers), ubrain[video] (MP4 recording), ubrain[plot] (matplotlib).

The manual

  • Quickstart: install, run, what you are looking at
  • Using ubrain in your own code: install from the wheels, write your own
  • Concepts: regions, wiring, bodies, codecs and certificates
  • The examples (examples/): each one short, meant to be copied, on the whole brain, ending with its check

Three layers

layer what examples
codecs (plug-in) frozen AI models that turn the world into codes CLIP (ubrain[vision])
the brain Brain(): every region, wired once, stepped one tick at a time; numpy only hippocampus, cortex, prefrontal cortex, striatum, cerebellum, salience, thalamus, neuromodulators
bodies (plug-in) anything that sends senses and takes actions the MuJoCo G1 (over a small protocol), a Gymnasium game with discrete states (ubrain.bodies.gym)
from ubrain import Brain, GaussianCodes
brain = Brain(variant="small")
brain.attach("sense", "vision", codec=GaussianCodes(dim=64, seed=1))
brain.attach("reward"); brain.attach("action", n=4)
action = brain.tick({"sense.vision": s, "reward": r})["action"]

Status

Pre-release, 0.46.0.dev3: the whole brain, Brain(), with seventeen regions. The cerebellum (a forward model, a timed brace, walking adaptation); the striatum (on an index, or on a situation code conditioned by a goal); the hippocampus (an episode, and a store that acts, keyed through the dentate gyrus) and the hand-over from it to the striatum; the cortex's slow store; the prefrontal cortex's working memory (active and silent); the salience gate and the mode controller; the thalamus; and three neuromodulators (acetylcholine, noradrenaline, serotonin). The regions are certified copies from a research engine in which every law is written down before it is measured; ubrain never changes a region's code by hand. How the engine is built is the subject of The Untrained Brain Series, Volume 2: Building the Brain Engine (in preparation).

Copyright 2026 Hong Jeong. The examples, documentation and profiles are under the Apache License 2.0 (LICENSE); the ubrain package is distributed compiled, under LICENSE-BINARY: free for any use, commercial included; you may ship it unmodified inside what you build, but not republish it on its own, modify it or reverse-engineer it. The robot body in bodies/mujoco is Apache-2.0, with third-party parts under their own licences (its NOTICE).

Metadata

Release files for ubrain 0.46.0.dev3

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

Built distributions (wheels)

Table of built distributions (wheels) for ubrain 0.46.0.dev3
File Actions
ubrain-0.46.0.dev3-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for ubrain-0.46.0.dev3-cp313-cp313-win_amd64.whl
ubrain-0.46.0.dev3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for ubrain-0.46.0.dev3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
ubrain-0.46.0.dev3-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for ubrain-0.46.0.dev3-cp313-cp313-macosx_11_0_arm64.whl
ubrain-0.46.0.dev3-cp313-cp313-macosx_10_13_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.13+ x86-64 Details for ubrain-0.46.0.dev3-cp313-cp313-macosx_10_13_x86_64.whl
ubrain-0.46.0.dev3-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for ubrain-0.46.0.dev3-cp312-cp312-win_amd64.whl
ubrain-0.46.0.dev3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for ubrain-0.46.0.dev3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
ubrain-0.46.0.dev3-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for ubrain-0.46.0.dev3-cp312-cp312-macosx_11_0_arm64.whl
ubrain-0.46.0.dev3-cp312-cp312-macosx_10_13_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.13+ x86-64 Details for ubrain-0.46.0.dev3-cp312-cp312-macosx_10_13_x86_64.whl
ubrain-0.46.0.dev3-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for ubrain-0.46.0.dev3-cp311-cp311-win_amd64.whl
ubrain-0.46.0.dev3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for ubrain-0.46.0.dev3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
ubrain-0.46.0.dev3-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for ubrain-0.46.0.dev3-cp311-cp311-macosx_11_0_arm64.whl
ubrain-0.46.0.dev3-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details for ubrain-0.46.0.dev3-cp311-cp311-macosx_10_9_x86_64.whl

Total release size: 84.8 MB

Release files / ubrain-0.46.0.dev3-cp313-cp313-win_amd64.whl

Download URL ubrain-0.46.0.dev3-cp313-cp313-win_amd64.whl
Size 2.5 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
db60fc351cc711663df1a837950c7a02ce893f49a3936dbd44bef8228be609b7
BLAKE2b-256 checksum
How to use checksums
0047007b448d84277f685625cb9e4ae68f470135c67d450216a11ba6a64cb6e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / ubrain-0.46.0.dev3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl

Download URL ubrain-0.46.0.dev3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Size 19.7 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
46b9d7bc39728cc8bec07b15f615e2db1a2a133dcd0d8ab533ac4b2b20bbf345
BLAKE2b-256 checksum
How to use checksums
7f23536a490fc9515f6d2ddfb60fa21bab25a12f0e8569218e5ec28a56722c39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / ubrain-0.46.0.dev3-cp313-cp313-macosx_11_0_arm64.whl

Download URL ubrain-0.46.0.dev3-cp313-cp313-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6b1bb55cffdf4942a8421cf8b8a70946a89b2ee22101d30ef5e1158839c978d6
BLAKE2b-256 checksum
How to use checksums
9406817423d68290062dca233c2c5bbd64fd9dc3802b0414c5137fc7d46eb0a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / ubrain-0.46.0.dev3-cp313-cp313-macosx_10_13_x86_64.whl

Download URL ubrain-0.46.0.dev3-cp313-cp313-macosx_10_13_x86_64.whl
Size 3.0 MB
Tags CPython 3.13 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
e1c079a88f65f76764a64d73a15610115e18da579a73c4381cd32ecc19ad8027
BLAKE2b-256 checksum
How to use checksums
d1ddd42f174e0b844bec9b08ac8fe6a3b4cd2a7f035b27a5cb6417319771dc7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / ubrain-0.46.0.dev3-cp312-cp312-win_amd64.whl

Download URL ubrain-0.46.0.dev3-cp312-cp312-win_amd64.whl
Size 2.5 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
0a08ca43886e466d481fa006517f247b01bd0f068f29d47727070a1f4d03f87e
BLAKE2b-256 checksum
How to use checksums
30984f4c30063aef69e02b62dd066eefab65005a367ecfb2af812ffabdd62a55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / ubrain-0.46.0.dev3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl

Download URL ubrain-0.46.0.dev3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Size 20.0 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c4cbabe62fc6425e9876714524f5aa9de7b01bff96102bb5b34c4d1c9e79304b
BLAKE2b-256 checksum
How to use checksums
0d9e35ecdd5768efac3004870ed916e8aae20aefabdf1833e25f1be98f20686f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / ubrain-0.46.0.dev3-cp312-cp312-macosx_11_0_arm64.whl

Download URL ubrain-0.46.0.dev3-cp312-cp312-macosx_11_0_arm64.whl
Size 3.0 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
14a7afaf046238ab29619f92a70bd1a5a8a4f0a637e6fdadb3a010c06f8a6c36
BLAKE2b-256 checksum
How to use checksums
db14bf9b58299e5ce5e62021b2c874966bd77cfd4810f086e3b10561ef2f4a70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / ubrain-0.46.0.dev3-cp312-cp312-macosx_10_13_x86_64.whl

Download URL ubrain-0.46.0.dev3-cp312-cp312-macosx_10_13_x86_64.whl
Size 3.0 MB
Tags CPython 3.12 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
2597017e2208239615694a546380c943be70ab21e08a0b57fc3e395714273174
BLAKE2b-256 checksum
How to use checksums
f16e58b1e0e11da7b71bd075a485397966d6b436da37838d6ece98ab14ee02e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / ubrain-0.46.0.dev3-cp311-cp311-win_amd64.whl

Download URL ubrain-0.46.0.dev3-cp311-cp311-win_amd64.whl
Size 2.6 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
a8b75202063011edf31f9b544580e8ae62366ed595813c09eaa39ea66a90f9b3
BLAKE2b-256 checksum
How to use checksums
0c3c9a7b492fa0f560ef03aba14542fe2ef97264c2ab966ad17914036bc776b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / ubrain-0.46.0.dev3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl

Download URL ubrain-0.46.0.dev3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Size 19.7 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d88c7d7f5d4bfd7b36f5cbdd891d1af672604e2618623d6252862500f7693a95
BLAKE2b-256 checksum
How to use checksums
524a9b732c0012ed9f73209bac15cb479f2d42bd0d202fc4925948b113c5f406
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / ubrain-0.46.0.dev3-cp311-cp311-macosx_11_0_arm64.whl

Download URL ubrain-0.46.0.dev3-cp311-cp311-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c61d014b28f61ec9ae05283f8335369299571119f0a9173881638cad3d57e360
BLAKE2b-256 checksum
How to use checksums
87144a8e4aece0bea0d0e299898f5efe5a0a06af37894a098b859cd1869cbf39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / ubrain-0.46.0.dev3-cp311-cp311-macosx_10_9_x86_64.whl

Download URL ubrain-0.46.0.dev3-cp311-cp311-macosx_10_9_x86_64.whl
Size 3.0 MB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
e72e81dc3fd0157772935586aff51a675bdc2e16692a66f10266224aadbecaf7
BLAKE2b-256 checksum
How to use checksums
531abc67f39c19f76d4fce0e009953c590a34ed738d55541bd7e585783352966
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for ubrain 0.46.0.dev3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release
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