Let the SemIf decision engine run on a GPU via llama.cpp. SemIf's llamacpp
backend is CPU-only by construction (it hardcodes n_gpu_layers=0), so the
agent wraps `_cpu_model_params` for the duration of the load and restores it
after — no patch to the re-cloned engine source.
- `engine.gpu_layers` / `gpu_device` / `gpu_split` in config (default 0 = CPU).
- On the GPU path, force a full cache reset (`llama_memory_clear(mem, True)`):
SemIf's metadata-only clear leaves stale hybrid-attention state on Vulkan,
so repeated scores drift (0.08 -> 0.36 -> 0.43) and return wrong
probabilities.
- Fail loudly when `gpu_layers` is set but the build has no GPU backend.
- bootstrap.sh: opt-in `--gpu auto|vulkan|rocm|cuda|cpu`. A GPU build is
opt-in because llama.cpp's Vulkan backend splits the graph across CPU and
Vulkan even at `n_gpu_layers=0`, roughly halving CPU throughput, so a CPU-only
host must keep the CPU wheel. Detects the backend, installs the Vulkan build
prereqs, and rebuilds when offload support disagrees (pip's wheel cache
otherwise serves the CPU wheel back).
- Bump the SemIf pin 1f2dea3 -> 23cf1f3.
- Tests: unit coverage for the config mapping + loader patches; an integration
test asserting GPU determinism and CPU parity.
- Offload needs the accelerator to itself (~2.9 GiB for the 4B Q4 model): a GPU
already holding another model makes the engine slower than CPU and can abort
with `vk::DeviceLostError`.
config.json is now per-machine USER config that no code writes: bootstrap
seeds it from config.example.json only when absent, then reads every
per-machine value from it. Flags override those values for the run only and
are never written back.
External refs (engine commit, GGUF url+sha256, HF tokenizer revision,
simplex-chat version/url+sha256) move out of config into a committed,
code-owned pins.json, so a git pull bump propagates on the next bootstrap
run instead of being frozen per machine. The agent reads engine
source/revision from pins.json and derives the GGUF path from engine.gguf_url
under .runtime/models/ (an explicit engine.gguf in config.json overrides it).
- config.example.json: drop all refs; ship the provisioned defaults
(codegen.timeout 3600, gateway/bridge enabled, dashboard 127.0.0.1)
- scripts/bootstrap.sh: seed config.json if absent, read pins from pins.json
and per-machine values from config.json, never write config.json; drop the
flags that only existed to populate config.json; US-delimit read fields so
empty values do not shift later fields
- semif_agent/cli.py: add load_pins / build_engine_config; load_config
hard-errors when config.json is missing
- tests/integration + README/AGENTS updated