- TypeScript 94%
- Python 4.7%
- Dockerfile 1.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| bench | ||
| docker | ||
| kev_ext | ||
| .gitignore | ||
| ISA.md | ||
| jev-local-decision-model-instructions.md | ||
| kev-9b-r9700-results.md | ||
| README.md | ||
sysOne-devOS
Local "System One" decision model for Pi: the benchmark of Kev on the Radeon AI PRO R9700, the labelled request set, the fine-tuned and calibrated Kev-0.8B router, and the tooling that produced them. The router itself (checkpoint, CPU image, service, and a general guide to training your own) lives in the private repo Pcsf/kev-router. This repo is everything needed to retrain it from my own data.
ISA.md: state of record. Every decision, number and method, newest first.kev-9b-r9700-results.md: the benchmark and fine-tune report.jev-local-decision-model-instructions.md: the original task spec (voice notes and sources).labels-review*-report.md(local only, not in git: they quote request text): my label reviews, applied by thebench/src/finalize-*.tsandbuild-trainset.tsscripts.bench/: TypeScript (bun) harness: extraction, labelling, synthetic data, training-set build, scoring, calibration, gate, latency, co-residency.docker/Dockerfile: the ROCm image (WITH_FLA=1for the GPU,0for the CPU).kev_ext/: the park/unpark wrapper, and the firstkev-routerunit. The live unit now comes fromPcsf/kev-router(systemd/kev-router.service), installed by thekev-routermodule ofomarchy-dev-bootstrap.
The dataset is not in git
Every file that contains my real requests is kept out of this repo and backed up as one zip in my vault, which syncs to Google Drive:
~/Documents/dDocs/2-resources/files/40-professional/42-ai-and-machine-learning/kev-router-dataset/kev-router-dataset-2026-09-27.zip
sha256 7b4536295dbe2428cc43c36bbab6dc218f7c683b9ec93d66af2d2ae6fcefe5f0
It holds 74 files (1.9 MB) with a MANIFEST.sha256 and a README.txt describing them. The important ones:
| File | What it is |
|---|---|
bench/data/labels.real.jsonl |
780 reviewed real requests: session, text, previous assistant turn, label |
bench/data/synthetic.final.jsonl, synthetic2.jsonl |
synthetic rows, rounds 3 and 4 |
bench/data/trainset.meta.jsonl |
the 1,159 rows chosen for training |
kev-work/ft/train-full.jsonl, holdout-full.jsonl |
the exact files Kev trained and was evaluated on |
kev-work/ft/evalfull-*/ |
benchmark outputs; the predictions the calibration and gate were fitted on |
bench/results/classify-*.json |
classifier runs with per-request detail |
The rest are earlier pools, pre-label rounds and review sheets, kept for provenance.
Restore
T=$(mktemp -d) && cd "$T" && unzip -q <path-to-zip>
sha256sum -c --quiet MANIFEST.sha256
cp -a sysOne-devOS/bench/data ~/Documents/10-repos/11-gitRepo/sysOne-devOS/bench/
cp -a sysOne-devOS/bench/results/. ~/Documents/10-repos/11-gitRepo/sysOne-devOS/bench/results/
mkdir -p ~/kev-work/ft && cp -a kev-work/ft/. ~/kev-work/ft/
Dependencies
- Kev checkout at
~/kev-work/kev, jaredpalmer/kev commit5920c5f, bind-mounted into the container. - Base model
Qwen/Qwen3.5-0.8B-Baserevisiondc7cdfe2ee4154fa7e30f5b51ca41bfa40174e68and initial weightsjaredpalmer/kev-0.8brevision9a45d25eb2ab761841196625383fa1dff0e56c1ein~/ai/models/managed/hf-hub, the Hugging Face hub layout kept by llama-model-manager. Fetch them withllama-model-add --format hf --repo <repo> --revision <commit>(plain curl, every file hash-checked). - Images from
docker/Dockerfile:kev-rocm:fla(--build-arg WITH_FLA=1) for training and GPU serving,kev-rocm:noflafor the CPU router. Rootless Docker:export DOCKER_HOST=unix:///run/user/1000/docker.sock. - The R9700 is HIP device 0 (
HIP_VISIBLE_DEVICES=0,gcnArchName == gfx1201). - bun for
bench/(cd bench && bun install && bun test).
Retrain
-
Restore the dataset (above).
-
Rebuild the training and holdout files. This regenerates
~/kev-work/ft/train-full.jsonlandholdout-full.jsonlbyte-identical to the originals (checked 2026-09-27):cd bench && bun src/build-trainset.ts -
Train on the R9700. The arguments are those recorded in the checkpoint's
training_config.json; about ten minutes, 4.7 GB of VRAM.kev.trainrefuses an existing--out, so pick a new name:docker run --rm --device=/dev/kfd --device=/dev/dri --security-opt seccomp=unconfined --ipc=host \ -e HIP_VISIBLE_DEVICES=0 -e HF_HUB_OFFLINE=1 \ -v ~/kev-work/kev:/work/kev:ro -v ~/ai/models/managed/hf-hub:/root/.cache/huggingface/hub:ro -v ~/kev-work/ft:/ft \ kev-rocm:fla python -m kev.train --base Qwen/Qwen3.5-0.8B-Base --base_revision dc7cdfe2ee4154fa7e30f5b51ca41bfa40174e68 \ --init_from jaredpalmer/kev-0.8b --data /ft/train-full.jsonl --out /ft/<new-run> \ --device cuda --epochs 2 --lr 2e-5 --dtype bf16 --batch 1 --accum 8 --lora 16 --checkpointing 1 --max_state 384--baseis required: without itkev.trainfalls back toQwen/Qwen3-0.6B-Base, which is not cached, and fails offline.--device cudais required becausekev.trainrejects--dtype bf16before it auto-detects the GPU. A run that fails leaves an empty--outdirectory behind; remove it before retrying. -
Evaluate on the holdout (same container flags):
python -m kev.benchmark --run /ft/<new-run> --data /ft/holdout-full.jsonl --out /ft/evalfull-<new-run>, thenbun src/score-predictions.ts new=$HOME/kev-work/ft/evalfull-<new-run>/predictions.jsonl. The reference run scored 0.813 accuracy, 0.683 macro-F1. -
Calibrate:
bun src/calibrate.ts <predictions.jsonl> ~/kev-work/ft/holdout-full.jsonl results/<name>.json, then write the mean fold temperature into a copy of the run with Kev'sscripts/calibrate_checkpoint.py --run <copy> --rows <eval>/rows.json --temperature <T> --reason "...". -
Check the gate:
bun src/gate.ts <predictions.jsonl> ~/kev-work/ft/holdout-full.jsonl <T> results/<name>.json. The interim gate is p ≥ 0.85. -
Serve: copy the calibrated run into
Pcsf/kev-router'scheckpoint/(or pointkev_ext/kev-router.serviceat it) and restartkev-router.
The method behind each step, and why it is done that way, is in ISA.md (Decisions and Learning). The same pipeline, generalised to anyone's own requests, is in Pcsf/kev-router's README.org.