FlyCore
v0.1.0The engine runs the complete fruit fly connectome as a sparse, signed, recurrent network. Every weight set on this site is a set of parameters for this one network, plus adapters.
The network
FlyCore instantiates the FlyWire connectome (v783, Dorkenwald et al. 2024) as a sparse directed graph: 139,248 annotated neurons, of which 138,639 carry synapses in the signed connectivity table of Shiu et al. 2024 (15.1 million edges, 54.5 million synapses). The sign comes from the predicted neurotransmitter per neuron: acetylcholine excitatory, GABA and glutamate inhibitory, about 60% of edges excitatory. Each edge weight is a learnable scale over the fixed sign times synapse count; the wiring itself is never changed.
Each neuron carries a small rate-based state (dimension 1 to 4) with a leaky nonlinearity, a per-neuron or per-cell-type bias and leak, updated every step from its weighted inputs. Backprop through time runs over the full network with a custom sparse backward, so the 138k × 138k gradient never materialises. Perception and language weight sets step at 50 Hz, control weight sets at 100 Hz; the Rust runtime can run inference loops up to 1 kHz.
Ports
Neurons are partitioned by the FlyWire annotations (Schlegel et al. 2024) into ports. Adapters attach to ports, never to individual neurons, which is what makes weight sets and adapters swappable.
| Port | Role | Neurons |
|---|---|---|
central · Central brain | core | 32,394 |
optic · Optic lobes | core | 86,103 |
visual · Visual afferents | input | 11,390 |
mechanosensory · Mechano / auditory afferents | input | 2,668 |
olfactory · Olfactory afferents (embedding port) | input | 2,282 |
chemosensory · Gustatory / thermo / hygro | input | 646 |
ascending · Ascending (body state) | input | 2,276 |
descending · Descending neurons | output | 1,303 |
motor · Motor / endocrine | output | 186 |
Port counts are annotated neurons; 609 of them have no synapse in the connectivity table and are carried as unconnected nodes. The olfactory port deserves a note. The 2,282 olfactory receptor neurons are the fly's native high-dimensional input, so FlyCore uses them as the embedding port: token sequences, instruction embeddings and seed points all enter here.
Install
pip install flycore # Python, PyTorch
cargo add flycore # Rust runtime, inference only
npm i @flylabs/flycore # browser (WebGPU) and NodeLoad and run
import flycore
brain = flycore.load("flylabs/cursor") # engine + weights + adapters
print(brain.engine.version, brain.weights.version)
print(brain.ports) # {'visual': 11390, 'ascending': 2276, ...}
state = brain.reset()
for obs in stream:
state, out = brain.step(state, obs) # one 10 ms stepRuntimes
- PyTorch: reference implementation, training and inference, CUDA and Apple silicon. torch.sparse with a custom sparse matmul backward; no PyTorch Geometric dependency.
- Rust: inference only, CPU SIMD or wgpu, C ABI. For actuators, input devices and anything that needs a fixed-rate loop.
- WebGPU: inference in the browser with a WebGL2 fallback. The 3D view on this page runs on the same stack.
Data and credits
- Connectome: Dorkenwald et al., Neuronal wiring diagram of an adult brain, Nature 2024. FlyWire Consortium.
- Signed connectivity table (v783): Shiu et al., A Drosophila computational brain model reveals sensorimotor processing, Nature 2024; github.com/philshiu/Drosophila_brain_model, MIT.
- Annotations and ports: Schlegel et al., Whole-brain annotation and multi-connectome cell typing of Drosophila, Nature 2024. CC BY 4.0.
- Brain surface in the 3D view: FlyWire tissue mesh from the FAFB tissue mask by Peter Li (Google), via navis-flybrains.