Crates

The published workspace has these library crates. Lower layers don’t depend on higher ones, so you can take only the parts you need.

Core

crate contents
modgrad-traits core traits: Brain, LossFn, Encoder, Vjp (a forward op paired with its backward), TokenInput
modgrad-ctm the CTM (neuron-level memory, synchronization, attention, U-Net synapse, backpropagation through time), the region graph, NeuralComputer, and the research modules below
modgrad-compute Linear, tensor ops, batched dispatch, GPU-resident buffers (GpuVec, LinearResident*)
modgrad-device the CPU, CUDA, ROCm, KFD and Vulkan backends and their kernels; see compute backends
modgrad-training optimizers (AdamW, Adam, SGD), warmup and cosine schedules, checkpointing, replay
modgrad-persist save and load, f32 / f16 / i8 quantization

Models and data

crate contents
modgrad-transformer transformer blocks, attention, RoPE, KV cache, GptModelResident, Qwen-class weight loading
modgrad-blt byte-latent transformer (Pagnoni et al. 2024): entropy patcher, local encoder and decoder, the byteify recipe
modgrad-ffn a SwiGLU MLP language model
modgrad-codec modality codecs: a retina and V1/V2/V4 visual cortex, VQ-VAE, FSQ, an audio codec, byte n-gram hashing
modgrad-data multimodal tokenization and streaming
modgrad-io serialization, telemetry, safetensors / ONNX / GGUF backends
modgrad-memory episodic memory, replay buffer, sleep consolidation

Applications and tools

crate contents
modgrad-serve a local inference server (REST, Anthropic Messages API, MCP) over a LanguageModel trait
modgrad-gemma Gemma-4 GGUF inference and server on modgrad-device
modgrad-attribution gradient-based data attribution (per-sample influence ranking)
modgrad-substrate host observability: CPU frequency, throttle counters, thermal sensors
modgrad-prompts shared system and user prompts
modgrad-wasm WebAssembly bindings, the engine the maze demo runs on
sonotxt text-to-speech (Orpheus 3B + SNAC) on ROCm
anneal decentralized, verifiable DiffusionBlocks training (research)

Not published yet

Newer crates, including the task harness behind the results, are on the development branch only.

Research code

modgrad-ctm also has optional modules named after biology: bio::pain (loss z-scored against its running average), bio::neuromod, bio::salience, bio::three_factor, bio::cerebellar, bio::homeostasis, bio::dream, bio::consolidation, and plural, organism and monarch (several “personalities” over one set of weights, an orchestrator, and adversarial tests). None has been shown to improve a benchmark result, and the core CTM trains without them.

Runtime, debugger and examples

isis is a runtime on the crates: a region-graph brain with multimodal input and an interactive mode. You don’t need it to use the SDK. It needs ROCm to build (which packages need ROCm), and like the rest of the workspace it does not build from a clean clone yet.

isis train model.bin          # byte curriculum; --multimodal --images ... --audio ...
isis nc model.bin             # interactive neural computer
isis generate model.bin "the cat "
isis daemon model.bin --port 4747
isis send "hello world" --addr 127.0.0.1:4747
isis devices                  # list compute devices

Also isis learn, isis learn-ffn and isis eval. train, nc and learn take --debug-port for the debugger.

modgrad-debugger (egui) attaches to a running model over TCP and shows neurons as 3D particles by region, the token stream, per-region traces and global synchronization, with pause, step and token injection:

modgrad-debugger 127.0.0.1:4747

Examples. 35 example packages, among them minictm (a single-file trainer), mazes and maze_viz, parity (tick depth and adaptive exit against accuracy), bench_brain_crossover, lm_validate (byte-level transformer training), qwen_chat (Qwen2.5 inference), the blt_* examples, and vision probes such as cifar10_probe and v4ctm_classifier.

Next: compute backends →