- Go 1.26 or later
- For the frontend: Node.js 20+
- For CUDA: Linux, NVIDIA CUDA toolkit
- For Metal: macOS, Xcode Command Line Tools
- For XLA: XLA headers and a PJRT plugin library
git clone https://github.com/theapemachine/caramba
cd caramba
# Build the CLI
go build -o caramba .
# Or install globally
go install .The server hosts the API and serves the frontend:
caramba serveThe frontend is available at http://localhost:3000 (or whichever port is configured). The API is available at http://localhost:8080/api.
Configuration is loaded from cmd/asset/config.yml through pkg/config; edit that file or pass --config to use an alternate YAML file.
Scaffold a new project with:
caramba research <project-name>This creates:
research/project/<project-name>/
├── manifest/
│ ├── master.yml # Top-level project manifest
│ ├── architecture/ # Architecture manifests
│ └── operation/ # Custom operation definitions
└── paper/ # LaTeX paper artifacts
The generated master.yml is a starting point. Edit it to declare your intent.
A minimal manifest that trains a two-layer transformer:
name: my_first_experiment
description: Small transformer on wikitext
variables:
d_model: 256
n_heads: 4
vocab_size: 50257
datasets:
train:
source: s3://my-bucket/wikitext-train
format: arrow
eval:
source: s3://my-bucket/wikitext-val
format: arrow
trainer:
optimizer: adam
learning_rate: 3.0e-4
max_steps: 5000
warmup_steps: 500
batch_size: 32
system:
topology:
type: GraphTopology
inputs: [x]
nodes:
- id: embed
op: embedding.token
in: [x]
out: [h]
config:
vocab_size: ${vocab_size}
d_model: ${d_model}
- repeat: 2
index: layer_idx
template:
- id: attn_${layer_idx}
op: attention.sdpa
in: [layer_${layer_idx}_in]
out: [attn_${layer_idx}_out]
config:
d_model: ${d_model}
n_heads: ${n_heads}
causal: true
- id: ffn_${layer_idx}
op: projection.linear
in: [attn_${layer_idx}_out]
out: [layer_${next_layer_idx}_in]
config:
d_in: ${d_model}
d_out: ${d_model}
- id: lm_head
op: projection.linear
in: [layer_2_in]
out: [logits]
config:
d_in: ${d_model}
d_out: ${vocab_size}
outputs: [logits]Instead of writing manifests by hand, use the visual editor:
- Open
http://localhost:3000in the browser - Navigate to Project → New or open an existing project
- Drag operations from the left panel onto the canvas
- Connect ports to wire the computation graph
- Click any node to configure its parameters in the inspector
- Use the Templates section for pre-wired blocks (TransformerBlock, DBA, GQA, etc.)
- Click Export to save as a YAML manifest
Once you have a manifest:
# Validate the manifest
caramba manifest validate path/to/manifest.yml
# Run the experiment
caramba research run path/to/manifest.yml
# Check status
caramba research status
# List assets
caramba asset listThe experiment follows the validation flow:
- Notary validates the manifest
- Compiler lowers YAML to IR
- Orchestrator optimizes the IR
- Runner dispatches to hardware
- Notary checkpoints at defined intervals
- On completion: commit (verified) or void (failed)
By default, the CPU backend is used. To select a specific backend:
# CUDA (Linux only, CUDA toolkit required)
CGO_ENABLED=1 go run -tags "cgo cuda" . serve
# Metal (macOS only)
CGO_ENABLED=1 go run . serve
# XLA (configure compute.xla in cmd/asset/config.yml first)
CGO_ENABLED=1 go run -tags "cgo xla" . serveSee Compute Backends for full setup instructions.
# All tests
go test ./...
# CPU compute tests
go test ./pkg/backend/compute/cpu/...
# Manifest compiler tests
go test ./pkg/manifest/...
# CUDA tests (Linux, CUDA toolkit required)
CGO_ENABLED=1 go test -tags "cgo cuda" ./pkg/backend/compute/cuda/...
# Metal tests (macOS)
CGO_ENABLED=1 go test ./pkg/backend/compute/metal/...
# XLA tests
CGO_ENABLED=1 go test -tags "cgo xla" ./pkg/backend/compute/xla/...Tests use Goconvey with a nested BDD structure (Given / It should). Every file has a corresponding _test.go file.
cd frontend
npm install
npm run devThe frontend uses TanStack Start + Router. See Frontend & Visualization for the full architecture.
| Document | What it covers |
|---|---|
| Architecture | System internals, IR, distributed model |
| Compute Backends | CPU/SIMD, CUDA, Metal, XLA |
| Manifest & Governance | Manifest schema, atomic intent, lifecycle |
| The Notary | Validation, ledger, custody |
| Operations | Full operation library reference |
| Frontend & Visualization | Editor, microscope, graph view |
| Agents | Research team interface, LLM providers |