How to run it
git clone https://github.com/jaredpalmer/kev && cd kevuv sync --extra serveuv run --extra serve python -m kev.serve --run BharathGowda/kev-gym-4b --port 8009
The server exposes a TypeSafe-compatible POST /v1/systemone. Send the log line as state and one Score question per muscle.
Use exactly the question text it was trained on:
{"state": "15kg x 16 reps flat dumbell bench", "questions": { "chest": {"type": "score", "instructions": "How involved are the chest in this exercise?", "criteria": ["Not involved", "Minor assist", "Significant contributor", "Primary driver"]} }}
Send all 14 questions in one request (ids:
glutes hamstrings adductors quads calves lower_back upper_back lats abs_core shoulders chest biceps triceps forearms
; the instruction is
How involved are the {name} in this exercise? with the name
written
lower back,
upper back,
abs and core for those three).
build_dataset.py in the dataset repo builds this request.
The answer's
probabilities are keyed
"0" to
"3"; the expected level is their weighted sum. A calibrated temperature
(1.23) is stored in
head.pt.
Tested on an NVIDIA L4 (serving, through Kev's Modal endpoint) and an H100 (training). Not tested on AMD or Apple hardware.
Training
- Warm start:
jaredpalmer/kev-4b (its LoRA and pointer head), one epoch, learning rate 2e-05, batch 2 x accumulation 4.
- Data: the 1,569 training records of
BharathGowda/gym-muscle-involvement
mixed with 2,000 public records from Kev's decision-v7 recipe, which keeps general skill.
- 1193 s on one H100 (0.33 h), Kev commit
f2bb629d. Temperature fitted on the 217-record calibration split.
Results
Development split: 209 records, 2,926 questions, from 37 exercises the model never trained on (32 rendered from the exercise
table, 5 taken from the author's real log). Same records, same calibration procedure for both columns.
Table with columns: kev-4b (before), this model | kev-4b (before) | this model |
|---|
| Accuracy | 0.713 | 0.932 |
| Brier score (lower is better) | 0.362 | 0.098 |
| Log loss (lower is better) | 0.666 | 0.190 |
| Calibration error, ECE (lower is better) | 0.069 | 0.008 |
| Wrong with probability 0.9 or more | 0.002 | |
Paired bootstrap, accuracy change +0.219 (95% CI +0.199 to +0.242).
Accuracy on 417 public decision-v7 records, as a forgetting check: 0.862 before, 0.856 after.
Confident mistakes (wrong at probability 0.9 or more) went up
from 0.002 to 0.006 of questions; every other row improved.
Read the accuracy with care. 86.7% of development labels are 0 (Not involved), so a model that always answers 0
scores 0.867, which is higher than the untrained model's 0.713. This model is 6.5 points above that
reference. The Brier score and log loss are the better guide: a model that knew only the label frequencies would score a Brier of
about 0.241 and a log loss of about 0.525 on this split (computed from the development labels themselves),
and this model beats both.
Limitations
- The labels were written by an AI assistant, not by a trainer or physiotherapist. Claude wrote one 14-muscle label vector
per exercise from a written rubric, and the author did not review it row by row. Level 1 and level 2 are judgment calls. Treat
this as a prototype, and check the labels in the dataset before relying on them.
- Stabilizers do not count. A muscle that only braces or grips (the core on a bench press, the forearms on a lat pulldown)
is labelled 0, except where holding is the exercise (plank, dead hang, wrist curl).
- A small, partly synthetic set. 226 exercises in all; most training lines are rendered from a table in the author's logging
style, with random weights and reps. The development split holds 37 exercises, and the bootstrap treats the six renderings of
one exercise as independent, so the confidence intervals are too narrow.
- Some levels cannot be measured. No exercise has forearms at level 1, and several other rare levels are missing from the
development split. The development set has no exercise that works the forearms at all.
- Known misses. Dumbbell side bends (abs and core predicted 0, labelled 3), plate front raises, walking lunges and handstand
push-ups, mostly level 1 and 2 calls. Held-out real-log exercises have close relatives in training, so that check is optimistic.
- One short log line in, nothing else: no injury, form or programming advice, and not a medical tool.
Files
adapter_model.safetensors (LoRA), adapter_config.json, head.pt (pointer head and temperature), tokenizer files,
training_metrics.json.
Credits and license
Built with Kev by Jared Palmer on Qwen/Qwen3.5-4B-Base (Apache-2.0), warm-started from
jaredpalmer/kev-4b (Apache-2.0). This adapter is released under Apache-2.0.