High-performance spiking neural-network runtime written in Rust.
Note
Training / weight-optimization lives in the separateplasticity-labproject;brainstem-daemonis inference-only.
- Modular
neuromod::SpikingNetworkcore (CPU; SIMD ready) - High-frequency networking over ZeroMQ PUB/SUB via
corpus-ipc - Headless
soma-daemonbinary for background execution
# Release build (includes soma-daemon)
cargo build --release --bin soma-daemonThe binary will be located at target/release/soma-daemon.
soma-daemon expects a TOML file; default path: ~/.config/soma/daemon.toml (override with --config).
# ~/.config/soma/daemon.toml
# Engine
lif_count = 16 # LIF neurons
izh_count = 5 # Izhikevich neurons
channels = 16 # expected input channels
model_path = "~/models/soma16.mem" # weights/thresholds
# Runtime
tick_rate_hz = 1000 # loop frequency
log_level = "info" # error|warn|info|debug|trace
# ZMQ
spine_sub_port = 5555 # stimuli in
spine_pub_port = 5556 # spikes out
# Service registry (optional; empty by default)
# Trading/mining-specific adapters are intentionally excluded from defaults.
[[services]]
name = "telemetry"
enabled = true
[[services]]
name = "critic-ipc"
enabled = truecorpus-ipc / ZeroMQ is currently an optional feature (corpus-ipc). When the feature is disabled (the default during this temporary decoupling phase), an in-memory stub backend is used instead.
Only the following settings are specific to the ZMQ backend:
spine_sub_portspine_pub_portSPIKENAUT_ZMQ_READOUT_IPC(orCORPUS_IPC_ZMQ_READOUT_IPC)
When using the stub backend these have no effect.
The stub backend is always safe to use for core library builds/tests and simulation runs. Example of constructing a daemon with the stub backend (feature-independent):
use brainstem_daemon::{BrainstemDaemon, DaemonConfig, BackendPair};
let cfg: DaemonConfig = /* ... */;
let daemon = BrainstemDaemon::with_backend(cfg, BackendPair::stub());Note (temporary):
neuromodis still a hard dependency for PR A. It will be made optional in a subsequent PR (see tracking issues #15-19).corpus-ipc/zmqare intentionally off-by-default during the decoupling phase (core builds and tests do not require libzmq).
neuromodwill be made optional later (see #15-19). This is tracked separately from thecorpus-ipctemporary split.
A Dockerfile is provided for reproducible Linux builds.
# Core build (no libzmq / stub backend only)
docker build --target core -t brainstem-daemon:core .
# Full build (with corpus-ipc + zmq)
docker build --target full -t brainstem-daemon:full .Inside the container you can run the usual checks:
cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings
cargo check --no-default-features
cargo check --features corpus-ipc
cargo test --all-featurestarget/release/soma-daemon # uses default config
# or
soma-daemon --config /path/to/custom.toml- Copy unit file:
# ~/.config/systemd/user/soma-daemon.service [Unit] Description=Soma Spiking Network Daemon After=network.target [Service] ExecStart=%h/.cargo/bin/soma-daemon --config %h/.config/soma/daemon.toml Restart=on-failure Environment=RUST_LOG=info [Install] WantedBy=default.target
- Enable & start:
systemctl --user daemon-reload systemctl --user enable --now soma-daemon
sudo semanage port -a -t user_tcp_port_t -p tcp 5555
sudo semanage port -a -t user_tcp_port_t -p tcp 5556
sudo semanage fcontext -a -t user_home_t "~/.config/soma(/.*)?"
restorecon -Rv ~/.config/somabrainstem-daemon is the headless runtime process for the Limen spiking-neural-network stack. It owns inference-time execution, stimulus ingestion, spike publication, and neuromodulator-driven network stepping. It does not own training, trading, mining, or hardware control.
| Concern | Owned by brainstem-daemon |
Not owned |
|---|---|---|
| Purpose | Run neuromod::SpikingNetwork in a headless loop; ingest stimuli via corpus-ipc; publish spikes via ZeroMQ |
Training/weight optimization; hardware I/O; business logic (trading/mining) |
| Configuration | Load DaemonConfig from TOML; maintain a config-driven ServiceRegistry |
Hardcoded service names; upstream soma-engine service names |
| Networking | ZeroMQ PUB/SUB; tokio async runtime |
Direct exchange adapters; market-data feeds |
| Dependencies | corpus-ipc, neuromod, tokio, zmq, serde, tracing, clap |
Exchange/Mining-specific adapters; GPU drivers; weight-training frameworks |
neuromod— core spiking-network library consumed by the daemon. The daemon configures dimensions and drivesSpikingNetwork::stepon every tick.limbic-critic— expected to send neuromodulator / critic signals over thecorpus-ipcingress channel. The daemon applies them but does not generate them.silicon-bridge— consumes the daemon's outbound spike stream (ZeroMQ PUB) for downstream tasks. The daemon does not know what silicon-bridge does with the spikes.Spikenaut-Hardware— physical hardware coordination is out of scope; the daemon publishes logical spike events only.plasticity-lab— weight training and plasticity experiments live here, not in the daemon.
corpus-ipc(withzmqfeature)neuromodtokio,zmq,serde,toml,tracing,clap,anyhow,dirs
- Trading or mining exchange adapters
- Hardware-control / GPIO / firmware crates
- Weight-training / optimizer frameworks (e.g., gradient-descent, backprop tooling)
Dual-licensed under MIT or Apache-2.0, at your option.
SPDX-License-Identifier: MIT OR Apache-2.0