Python SDK / Open source / Alpha

No CUDA
required.

Bring a neural circuit into your game.
Load a model. Give it input. Read an action.

Play the live sandbox Python quickstart View source ↗
CPU readyMIT licensedOffline demo
quickstart.py
from flybrain import FlyBrain

brain = FlyBrain.load("toy", backend="cpu")
brain.stimulate("food", duration_ms=100)
brain.step(100)

print(brain.action().to_dict())
# walk / turn_left / turn_right / jump

brain.save("brain.checkpoint.json")
restored = FlyBrain.restore(
    "brain.checkpoint.json"
)
What runs today: a synthetic offline circuit and an opt-in, 313-neuron real MaleCNS subgraph on your CPU. Select cells, inject currents, inspect activity and bind your own output channels. Try it in the browser, export a recording for Python replay, or download an editable HTML demo. The real model uses assumed dynamics. The optional CUDA backend has a complete FlyWire brain benchmark: 139,255 neurons. Watch the full-brain GPU voxel recording: neural output drives movement, but the current readout does not reach food. Version 0.5 alpha includes experimental CUDA support; CPU stays the default and WASM is planned. Compare the full-brain odor gain pilot.
A small API, from input to action

Keep the game loop yours.

01 / STIMULATE

Send a sensory signal

Food, looming on the left or right, and touch are mapped to explicit inputs in the demo circuit.

02 / STEP

Advance neural time

Run fixed simulation ticks on NumPy. Inspect voltages, spikes and firing rates. No GPU setup.

03 / ACT

Read motor intensity

Bind your own named output channels, or use the toy walk, turn and jump values. Save an experiment and continue its trajectory.

A model catalog, not a giant install

Download only what you want to use.

Source URLs, versions, sizes and licenses live in a lightweight catalog. Assets stream to a local cache when you explicitly request them.

Model sourceTodayDownload
Toy LIF circuitRunnable, syntheticIncluded
MaleCNS escape circuitRunnable, experimental real subgraph3.8 MB, SHA256 verified
MaleCNS v1.0Raw connectome dataChoose connections, annotations or transmitters
FlyWire v783Raw connectome dataChoose connections or neuron IDs

Explore model downloads and limitations →

Build in the open

The next circuit could be yours.

Contribute a model source, a real-data importer, an engine adapter or a WASM implementation. You can start with a laptop and a focused pull request.

Start contributing