spikeforge
A spiking-neural-network (SNN) toolkit built on snnTorch and PyTorch. Loads MNIST-style and neuromorphic event datasets, encodes them into rate, latency, delta, and random spikes, and trains, validates, exports, and deploys LIF networks — with a live browser dashboard served over WebSockets.
Pre-1.0. Before trusting any number this produces, read Implications and boundaries.
Quickstart
No clone, no Docker — five lines of Python:
pip install spikeforge
from spikeforge.training.training_engine import TrainingEngine
engine = TrainingEngine(dataset="mnist", hidden=32, epochs=1, num_steps=5)
for metrics in engine.train():
last = metrics
print(last) # {'loss': ..., 'train_accuracy': ..., 'test_accuracy': ...}
The first run downloads MNIST; later runs are offline. That's the training
API — spikeforge-verify, spikeforge-benchmark, and the NIR/deployment/
energy pieces live in Usage.
Want the live browser dashboard instead? That's the richer, second path:
git clone https://github.com/capsize-games/spikeforge.git
cd spikeforge
docker compose up --build
Open http://localhost:8877 — the dashboard connects to the WebSocket on the same host and port. No separate backend or proxy to run.
See Usage and Quickstart
for every path (./install.sh, local dev with Vite, examples/, and the
spikeforge-* console scripts).
Why not just snnTorch, Norse, Lava, or SpikingJelly?
spikeforge doesn't replace those — it trains through snnTorch and can deploy to Norse and Lava. The question is what it adds on top: a NIR-described interpreter spine with an independent interpreter that re-executes every exported graph and reports numerical drift against the original model (not just export — snnTorch and Norse both export NIR too; Lava-DL currently only reads it, not writes it), a deployment-capability matrix that reports per-target op support and availability instead of just declaring support, an event-driven energy estimator, and a live training/ introspection dashboard. None of the other libraries ship the latter two as part of the library itself, to our knowledge — file an issue if that's stale.
| snnTorch | Norse | Lava | SpikingJelly | spikeforge | |
|---|---|---|---|---|---|
| Surrogate-gradient training in PyTorch | ✅ | ✅ | ✅ (Lava-DL) | ✅ | ✅ (via snnTorch) |
| NIR export (write) | ✅ | ✅ | import-only (Lava-DL reads NIR, doesn't write it) | not part of NIR's official framework list | ✅ |
| Independent re-execution + drift check of the exported graph | — | — | — | — | ✅ |
| Per-target deployment capability matrix (op support, honest availability) | — | — | Loihi-focused | — | ✅ (reference/Norse/Lava/SpiNNaker2/Speck/Xylo) |
| Built-in event-driven energy estimator (SOP/MAC/AC) | — | — | — | — | ✅ (labelled estimate, not hardware-measured) |
| Pretrained model zoo | — | — | — | ✅ (some vision tasks) | catalog infra ships; mostly untrained preset shapes today (details) |
| Live browser training/introspection dashboard | — | — | — | — | ✅ |
If you already have a training loop in snnTorch/Norse/Lava/SpikingJelly and don't need interop, deployment reporting, energy estimates, or the dashboard, you may not need spikeforge on top of it — that's a fair "obviously no," and better than an uninformed "obviously yes."
Features
- Encoding — rate, latency, delta, and random spike coders.
- Training — fully-connected and convolutional LIF networks with surrogate-gradient cross-entropy, checkpointing, and opt-in AMP / gradient checkpointing / truncated BPTT / multi-GPU.
- Topologies —
fc_legacy,fc_small,conv_net,recurrent_net, plus the sequence presetssequence_mlpandsequence_attn. - Datasets — MNIST, Fashion-MNIST, KMNIST, QMNIST, USPS, EMNIST,
CIFAR-10, and (via the
eventsextra) N-MNIST, DVS128 Gesture, CIFAR10-DVS, and Spiking Speech Commands. - Interpreter spine — NIR export, an independent NIR interpreter, and numerical drift validation.
- Introspection — educational-mode
U[t]/I[t]/S[t]traces, trajectory metrics, and surrogate-derivative curves. - Deployment — a capability matrix, weight quantization, energy
accounting, and executable
reference,norse, andlava_loihi2backends. - Model hub — a curated, offline-first catalog plus optional live Hugging Face search.
- Dashboard — a React + TypeScript UI with training, introspection, analysis, targets, energy, and hub panels, and seven guided walkthroughs.
What's implemented vs. experimental vs. spec-only
The features list above spans very different levels of maturity. This is the ten-second version; each row links to the honest detail.
| Capability | Status | Detail |
|---|---|---|
| Training, encoding, topologies, checkpointing | Shipped | Features |
| NIR export + independent-interpreter drift validation | Shipped | Interpreter spine |
Deployment — reference target |
Shipped, always available | Backend execution |
Deployment — norse, lava_loihi2 targets |
Shipped, gated on an SDK extra (pip install spikeforge-targets[norse] or [lava]) |
Targets and interop |
Deployment — spinnaker2, speck, xylo targets |
Spec-only — registered in the capability matrix, no installable SDK integration yet | Targets and interop |
| Energy accounting (SOP/MAC/AC) | Shipped as an explicit estimate, not hardware-measured |
Event runtime and energy |
| Model hub catalog, CLI, dashboard panel, opt-in live HF search | Shipped | Model hub |
| Model hub catalog content | Thin — bundled NIR shapes today, not trained weights | spikeforge_hub/models.json |
Sequence/attention topologies (sequence_mlp, sequence_attn) |
Experimental — research scope, not production sequence training | Sequence primitives |
| ONNX interop | Shipped, single-step export/import only | Interop fold-ins |
| Production use-case toolkit: streaming time-series (UC-1) | Shipped | UC-1 |
| Production use-case toolkit: UC-2 through UC-10 | Spec-only (design docs behind issues #13–#21) | plans/index.md |
| Live browser dashboard | Shipped | Dashboard |
Packages
This repository is a single workspace that publishes seven distributions, each versioned independently:
| Distribution | Import root | Purpose |
|---|---|---|
spikeforge |
spikeforge |
Core package: encoders, topologies, training, simulator, NIR bridge, tracking |
spikeforge-targets |
spikeforge_targets |
Deployment targets, quantization, energy accounting, sparse event runtime |
spikeforge-hub |
spikeforge_hub |
Curated model hub and optional Hugging Face access |
spikeforge-server |
server |
FastAPI + WebSocket server and dashboard hosting |
spikeforge-serve |
spikeforge_serve |
Headless REST/WebSocket inference service for a deployment bundle |
spikeforge-clients |
spikeforge_clients |
Python/TypeScript/CLI clients for spikeforge-serve (no torch dependency) |
spikeforge-io |
spikeforge_io |
Recorded-stream I/O adapters and windowing |
spikeforge-hub and spikeforge-targets sit at 0.1.x while core is at
0.3.x by design, not neglect — each package is versioned independently, and
compatibility.json is the source of truth for which
satellite versions go with which core release. If you're pinning versions by
hand, read that file rather than assuming semver alignment across packages.
Documentation
This README covers first contact and positioning; it deliberately doesn't
go deeper. documentation/ is the full reference — install
paths, the CLI tools, architecture, module layout, and the dev workflow —
written for contributors and coding agents alike. Also see
COOKBOOK.md for copy-pasteable recipes,
examples/ for runnable end-to-end scripts, and
plans/ for design documents and the roadmap.
See CONTRIBUTING.md and rules.md before opening a pull request.
Citing
If spikeforge is useful in your research, please cite it — see CITATION.cff (GitHub renders a "Cite this repository" button from it automatically).
License
Released under the BSD 3-Clause License — see LICENSE and AUTHORS.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spikeforge-0.3.4.tar.gz.
File metadata
- Download URL: spikeforge-0.3.4.tar.gz
- Upload date:
- Size: 216.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54d96b1df5cfc785a12874ad055b8addf4d578690b3e0aa7297416fe7ce39caf
|
|
| MD5 |
f527c816b6a46bb3d302b45b5e3a29c2
|
|
| BLAKE2b-256 |
421925c43de9d048a78393688a4c126e8dfad2330dd6b2459827b2dc54be1b1d
|
Provenance
The following attestation bundles were made for spikeforge-0.3.4.tar.gz:
Publisher:
release.yml on Capsize-Games/spikeforge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spikeforge-0.3.4.tar.gz -
Subject digest:
54d96b1df5cfc785a12874ad055b8addf4d578690b3e0aa7297416fe7ce39caf - Sigstore transparency entry: 2835950969
- Sigstore integration time:
-
Permalink:
Capsize-Games/spikeforge@ab3a7003647b0108c111bc348431d13f188ee328 -
Branch / Tag:
refs/tags/spikeforge-v0.3.4 - Owner: https://github.com/Capsize-Games
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ab3a7003647b0108c111bc348431d13f188ee328 -
Trigger Event:
push
-
Statement type:
File details
Details for the file spikeforge-0.3.4-py3-none-any.whl.
File metadata
- Download URL: spikeforge-0.3.4-py3-none-any.whl
- Upload date:
- Size: 306.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
026b1d572550570c229caae7c0a9d8ce8462f396a4832d87a91cedd26edc10ae
|
|
| MD5 |
93159bbbe199373c56d4e41ec6a039e1
|
|
| BLAKE2b-256 |
9ce3983fc2289b0a094a1cafa9673feab07d491325759fa16da82dad95beab24
|
Provenance
The following attestation bundles were made for spikeforge-0.3.4-py3-none-any.whl:
Publisher:
release.yml on Capsize-Games/spikeforge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spikeforge-0.3.4-py3-none-any.whl -
Subject digest:
026b1d572550570c229caae7c0a9d8ce8462f396a4832d87a91cedd26edc10ae - Sigstore transparency entry: 2835950991
- Sigstore integration time:
-
Permalink:
Capsize-Games/spikeforge@ab3a7003647b0108c111bc348431d13f188ee328 -
Branch / Tag:
refs/tags/spikeforge-v0.3.4 - Owner: https://github.com/Capsize-Games
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ab3a7003647b0108c111bc348431d13f188ee328 -
Trigger Event:
push
-
Statement type: