Skip to content

Configuration

Raul Montoya Cardenas edited this page Jul 29, 2026 · 2 revisions

Configuration

Wiki hero

Generated with Grok Build: Grok 4.5 · xAI Imagine (/imagine)

Loading

DaemonConfig::load(path: &Path) -> Result<DaemonConfig>
  • Reads UTF-8 TOML via toml::from_str.
  • Rejects absolute paths that contain parent-dir components (..) to avoid surprising traversals.
  • Relative .. is allowed (resolved against process CWD at load time).

Default path (binary): dirs::config_dir()/soma/daemon.toml, or ./soma/daemon.toml if no config dir.

Fields

Field Type Purpose
tick_rate_hz u32 Loop frequency; must be 1..=1_000_000 at run()
log_level String Tracing filter (errortrace); falls back to info if invalid
spine_sub_port u16 ZMQ SUB / readout (stimuli in); used by binary when feature on
spine_pub_port u16 ZMQ PUB bind for spike egress
model_path PathBuf Weight/model path passed to source initialize on ZMQ path
lif_count usize LIF neuron count
izh_count usize Izhikevich neuron count
channels usize Expected stimulus channels
services Vec<ServiceConfig> Optional; default empty

ServiceConfig (table array)

[[services]]
name = "telemetry"
enabled = true   # default true if omitted

See Service Registry.

Validation

Rule When
lif_count + izh_count must not overflow usize try_with_backend / try_new
Sum must be ≤ u16::MAX same (spike channel encoding)
tick_rate_hz in 1..=1_000_000 start of run()

Prefer fallible constructors for user-supplied config:

BrainstemDaemon::try_new(cfg)?;
BrainstemDaemon::try_with_backend(cfg, pair)?;

new / with_backend panic on validation failure (documented); binary uses try_with_backend.

ZMQ-only Settings

When the stub backend is active, these have no effect on I/O:

  • spine_sub_port, spine_pub_port
  • model_path (stub initialize ignores it)
  • Env: SPIKENAUT_ZMQ_READOUT_IPC / CORPUS_IPC_ZMQ_READOUT_IPC

When corpus-ipc feature is enabled, the binary sets both env names to tcp://127.0.0.1:{spine_sub_port} before connecting.

Example (full)

lif_count      = 16
izh_count      = 5
channels       = 16
model_path     = "~/models/soma16.mem"
tick_rate_hz   = 1000
log_level      = "info"
spine_sub_port = 5555
spine_pub_port = 5556

[[services]]
name = "telemetry"
enabled = true

[[services]]
name = "critic-ipc"
enabled = true

Trading/mining adapter names are intentionally not part of defaults.


Last updated: July 28, 2026 Updated by: Grok Build: Grok 4.5 Package tip reference: 8176c58 (main)

Clone this wiki locally