Repository navigation
Description
Context & Rationale
devops-review serves every review call from two models. That covers persona review and verification alike (k8s/llm/gateway/configmap.yaml:89-108).
| Model | Tier (weight) | KV cache (k8s/llm/profiles/ollama-profiles.yaml) |
|---|---|---|
| qwen3-coder:30b | ollama-48gib (9), ollama-64gib (6) | q8_0 on both (:366-367, :469-470) |
| gpt-oss:20b | ollama-16gib (8), ollama-24gib (1) | q4_0 on 16gib (:61-62), q8_0 on 24gib (:162-163) |
gpt-oss:20b holds 9 of the 24 weight units.
- Weights track throughput only. The gateway routes by weight (
simple-shuffle,configmap.yaml:170-172).devops ai gateway tunesets each weight from the deployment's best request rate (src/devops_cli/ai/gateway_tune.py:167-190). - Quality matters more than speed. A faster model that reports more false positives, or misses defects, costs more than it saves, because verification checks every finding.
- feat(ai): llm gateway weights validated against real reviews #476 found that faster weights reported more findings, including top-severity false positives that passed verification.
- It could not tell which model produced them, so it left the question to this item (
docs/agent/tasks/task-476-llm-gateway-weights-validated-against-real-reviews.md).
- Nothing measures quality per model.
- No finding records its model.
Finding/SavedFinding,ReviewSessionPayload,FeedbackRecordandCommonHallucinationEntryhave 69 fields between them, and none names a model or backend (model_fieldsat ef21785). - The spend ledger stores the requested group, not the model that answered (
src/devops_cli/ai/client/unified.py:443). served_bycomes from the gateway'sx-litellm-model-api-baseheader (src/devops_cli/config/constants.py:1710, read atsrc/devops_cli/ai/client/openai.py:174,204). It names a tier, not a model.profile.jsoncounts calls per tier per stage (src/devops_cli/ai/review/profile.py:202-204).
- No finding records its model.
- Pinning one model per run is the clean measurement. Three things prevent it today.
- gpt-oss:20b has no group of its own. The
ollama/*pass-through route left the configmap in feat(k8s): modernize monitoring stack, llm profiles, traefik routing, and remove squid proxy #734 (fdd4d0f). devops-coderreaches qwen3-coder:30b alone (configmap.yaml:44-47), but it falls back todevops-chat(:184). devops-chat's qwen3.8:27b also runs on ollama-48gib (:31-32), soserved_bycannot show the switch.- Verification cannot be pinned from the shell.
- Environment overrides apply only through
OPTION_TO_ENV_VAR(src/devops_cli/config/settings.py:715-733).load_settingsbuilds settings withmodel_validate(:844), which reads no environment. - The map has
DEVOPS_CLI_AI_TASK_ANALYSIS_MODEL(src/devops_cli/config/env.py:45, :128-131) but no entry forai.tasks.verification(:98-175). - Reviews layer a set verification override on the analysis task (
src/devops_cli/ai/review/runner.py:1539-1556). The workstation's project config setsai.tasks.verification.model: devops-review. So an arm that sets only the analysis model still verifies on the whole pool. - A probe at ef21785 also showed that the nested form
DEVOPS_CLI_AI__TASKS__ANALYSIS__MODELis ignored: analysis stayeddevops-review.
- Environment overrides apply only through
- gpt-oss:20b has no group of its own. The
- Scanner hits count as model recall.
devops review pathhas--no-static-scan(src/devops_cli/commands/review.py:210-213).devops review benchmark(:1333-1401) does not pass it through.- Scanner findings carry no producer (
_wrap_static_findings,src/devops_cli/ai/review/pipeline.py:432-441), and the run's model verifies them (:2586-2590). So a scanner hit on an injected defect scores as found in every arm.
- Arms would share on-disk state.
- Pre-analysis metadata is cached by file content in
data.analysis_dir(src/devops_cli/ai/analyze/cache.py:48-54). Reviews load it withoutforce_refresh(runner.py:2023-2029,pipeline.py:1527).benchmark'sno_cacheturns off only the response cache (commands/review.py:1377). So the second arm would review with metadata the first arm's model wrote. corpus scorepicks sessions by target from the whole reviews dir (commands/review.py:1494-1509).review stats,export-feedbackand the feat(review): track false-positive rate across runs #434 baseline add up every session directory (feat(review): subject-keyed review history with a leave-one-out baseline #607). One shared dir mixes the arms and pollutes review history.
- Pre-analysis metadata is cached by file content in
- The pool is all Ollama now. feat(k8s): modernize monitoring stack, llm profiles, traefik routing, and remove squid proxy #734 (fdd4d0f) removed the vLLM deployments that served Qwen2.5-Coder 32B and 14B.
- The cluster can run this today.
- On 2026-10-01,
kubectl get pods -n llmshowed the gateway and all four tiers running. ollama-48gib had 40 restarts, the last one 15 h earlier. - The live
llm-gateway-configmatchedconfigmap.yaml:89-108.
- On 2026-10-01,
Scope & Deliverables
Deliverable:
- Per-model gateway groups.
- Add
qwen3-coder:30bandgpt-oss:20btok8s/llm/gateway/configmap.yaml. Each copies that model'sdevops-reviewentries exactly: the samemodel,api_baseandweight, nomodel_info, and no fallback. Withenable_pre_call_checkson (:180), any extramax_input_tokenswould route differently from the pool. - This follows the existing per-model groups
gemma4:31bandqwen3.8:27b(:110-151). - Add one line about them to the gateway section of
k8s/README.md.
- Add
- Verification task environment overrides. Add
DEVOPS_CLI_AI_TASK_VERIFICATION_PROVIDER,_MODEL,_REASONING_EFFORTand_OLLAMA_URLSforai.tasks.verification.*. They mirror the analysis task's: the option names (src/devops_cli/config/options.py:40-43), the map (env.py:128-131) and theEnvVarSpecentries (env.py:383-399). devops review benchmark --no-static-scan, passed through to every run and recorded in the run's setup.- The measurement. A person runs the commands below. For each model, run feat(ai): model-in-the-loop prompt benchmarking #413's repeated-run report over one fixed synthetic corpus. Personas, k and the corpus are the same in both arms. Each arm has its own reviews and analysis directories.
- Results and decision.
- A results table per model in the task file.
- The decision on a quality factor, made by the rule under Key questions.
- Docs.
- Rewrite
docs/agent/tasks/task-475-per-backend-review-quality-baseline.md. It is stale: it names v0.2.24 and three models. - Mark the roadmap entry (
docs/ROADMAP.md:309-312) as delivered. - Replace its "Review Findings Carry Their Producer" extension (:313-317) with links to the split-off issues.
- Run
devops docs generate --sync-readme, which regeneratesdocs/CLI_REFERENCE.mdanddocs/ENV_VARS.md.
- Rewrite
Acceptance criteria:
- Offline, inside
uv run devops ci:- A file-only test in
tests/test_k8s_llm_gateway.pyasserts three things:- each per-model group's entries, as (model, api_base, weight) in order, equal that model's
devops-reviewentries; - neither group's entries carry
model_infoor anylitellm_paramskey beyond those three; - neither group appears in
fallbacksorcontext_window_fallbacks.
- each per-model group's entries, as (model, api_base, weight) in order, equal that model's
test_gateway_configmap_virtual_models(:86-116) lists both new groups.- A test in
tests/test_config_env_overrides.pywrites a tmp config whoseai.tasks.verification.modelisdevops-review, as the test at :10 does. It setsDEVOPS_CLI_AI_TASK_ANALYSIS_MODELandDEVOPS_CLI_AI_TASK_VERIFICATION_MODELtogpt-oss:20band asserts, with no network:load_settings().ai.tasks.verification.modelisgpt-oss:20b;- the verification client that
_make_review_clientsbuilds has modelgpt-oss:20band the analysis task's provider (as intests/test_review_verification_task.py:52-65); - with
gateway_poolstubbed,review_setup()["models"]namesgateway/gpt-oss:20bfor both analysis and verification.
- A CLI test modeled on
test_a_review_benchmark_is_kept_with_its_setup_and_corpus(tests/test_run_store.py:247) asserts thatreview benchmark --no-static-scan -n 2passesno_static_scan=Trueto bothpathcalls and records it in the run's setup. Without the flag, both calls getFalse. - All assertions are structural tuple assertions. The new tests add under 1 s in total, checked with
pytest --durations.uv run devops cipasses.
- A file-only test in
- Live (a person runs these and pastes the output into the PR):
- After the configmap is applied,
uv run devops ai gateway routeslists both groups with their four deployments. - Every run record of an arm names that arm's group for both analysis and verification (
uv run devops ai runs show <id>). - In every session's
profile.json, every stage'sbackendsnames only that arm's tiers. This shows no call fell back to another model, and that verification did not reach the pool. - The first session of each arm shows LLM calls in its
pre_analysisstage, so the arm wrote its own metadata. - The task file's results table cites a run ID for every figure. For each model it gives:
- found and reported counts per injection, with pass^k, pass@k and found-in-none (feat(ai): model-in-the-loop prompt benchmarking #413);
- candidates by verdict;
- reported findings that match no injection, by severity, labelled "unlabelled" and not called false positives;
- unparsed persona replies;
- median seconds per candidate, and tokens.
- The PR states the decision and the rule that produced it. If a factor is warranted, it links the follow-up issue.
- After the configmap is applied,
Person-run commands, from the branch before merge, with DEVOPS_CLI_DATA_DIR unset (it takes precedence over the reviews dir, src/devops_cli/ai/review/review_environment.py:97-110). #413 sets <sources>, <seed> and <k>; today's defaults are seed 1 and k 3. Directory names carry no colons, because the workspace may sit on a Windows share.
kubectl apply -f k8s/llm/gateway/configmap.yaml
kubectl -n llm rollout restart deployment/llm-gateway && kubectl -n llm rollout status deployment/llm-gateway
uv run devops ai gateway routes
kubectl get pods -n llm # note restart counts
uv run devops review corpus generate <sources> --seed <seed> --out .data/475/corpus
for arm in qwen3-coder=qwen3-coder:30b gpt-oss=gpt-oss:20b; do
name=${arm%%=*} model=${arm#*=}
# Own sessions and pre-analysis cache per arm, kept out of review stats and the #434 baseline.
export DEVOPS_CLI_DATA_REVIEWS_DIR="$PWD/.data/475/$name/reviews" DEVOPS_CLI_DATA_ANALYSIS_DIR="$PWD/.data/475/$name/analysis"
export DEVOPS_CLI_AI_TASK_ANALYSIS_MODEL=$model DEVOPS_CLI_AI_TASK_VERIFICATION_MODEL=$model
uv run devops review benchmark .data/475/corpus/files --all --no-static-scan -n <k>
uv run devops review corpus score .data/475/corpus --runs <k> # #413's repeated-session score of this arm's k sessions
done
kubectl get pods -n llm # restart counts unchangedKey questions:
-
Measure per model or per tier? Per model (proposed).
- The weights question is between two models.
- Each arm spreads its calls over its tiers with the pool's weights, so gpt-oss:20b is measured mostly on ollama-16gib, as the pool serves it.
profile.jsonrecords the tier of every call. - If gpt-oss:20b comes out worse, a follow-up compares ollama-16gib (q4_0 KV cache) with ollama-24gib (q8_0) before any weight change.
-
How is each arm pinned? Through the per-model gateway groups (proposed). This is the same path reviews take. Two alternatives were rejected:
devops-coderfalls back to a different model on the same tier.- Direct Ollama calls take a different client path from production.
The groups stay in place afterwards, so feat(review): review page size against quality and speed #480 and later candidate models can reuse them.
-
How does an arm select its group for both tasks? With
DEVOPS_CLI_AI_TASK_ANALYSIS_MODELand the newDEVOPS_CLI_AI_TASK_VERIFICATION_MODEL(proposed). A per-arm file throughDEVOPS_CLI_CONFIGwas rejected: it replaces the whole project config layer, gateway settings included. -
Why pin, rather than attribute findings in pool runs? Findings carry no model today. Pinning needs no schema change, and it measures each model end to end, generating and verifying (proposed). Attributing each finding is a split-off.
-
Where does false-positive ground truth come from? Not from the arm's own verifier (see Constraint). No human verdicts exist yet (feat(ai): model-in-the-loop prompt benchmarking #413 counted 0 of 2,237 findings), and feat(ai): model-in-the-loop prompt benchmarking #413 splits agreement with human verdicts off to the backlog, so this item decides on recall against the injected defects alone (proposed). Reported findings that match no injection are counted by severity but not called false positives, because the corpus source can hold real defects.
-
Corpus, personas, k and temperature? Use feat(ai): model-in-the-loop prompt benchmarking #413's corpus and k, so a model difference sits on the same scale as a prompt difference (proposed).
- Personas:
--all, as feat(review): review performance baseline per-stage timing, calls and tokens on a fixed corpus #473 and feat(ai): llm gateway weights validated against real reviews #476 used. - Temperature: the configured one, the same in both arms.
- Scanners off, so recall is the model's own.
- Personas:
-
Do the arms share pre-analysis metadata? No (proposed). Each arm has its own analysis directory. Its first run writes metadata with its own model, and its later runs reuse it, as production does.
-
Decision rule? Fixed before the runs (proposed). A quality factor is warranted when one model's reported recall (pass@k) is below the other's by more than the run-to-run spread feat(ai): model-in-the-loop prompt benchmarking #413 reports for either arm.
Otherwise weights stay throughput-only, and the task file says so. Unlabelled findings do not enter the rule. The task file reports them by severity beside the outcome, since feat(ai): llm gateway weights validated against real reviews #476's concern was extra top-severity findings.
-
Does this PR change the
devops-reviewweights? No (proposed). A pool change alters every review.- If a factor is warranted, file a follow-up with the figures. It either adds a quality multiplier to
recommend_weights(gateway_tune.py:167-190) or takes gpt-oss:20b out of the pool. - The follow-up re-runs feat(ai): llm gateway weights validated against real reviews #476's A/B.
- If a factor is warranted, file a follow-up with the figures. It either adds a quality multiplier to
-
Do the arm sessions pollute review history? They would in the default reviews dir (feat(review): subject-keyed review history with a leave-one-out baseline #607). Each arm sets
DEVOPS_CLI_DATA_REVIEWS_DIRto its own directory (proposed;src/devops_cli/config/settings.py:741-744). That also keeps each arm'scorpus scoreto its own sessions. -
What about other models (gemma4:31b, qwen3.8:27b, deepseek-r1:70b)? Out of scope (proposed). Their groups already exist, so the same commands can measure them later.
-
Does the gate run any of this? No. Live-model runs stay on demand, as feat(ai): model-in-the-loop prompt benchmarking #413 requires, and every test is offline.
Constraint:
- Ground truth must not come from the verifier being measured (feat(ai): model-in-the-loop prompt benchmarking #413).
- The synthetic corpus measures regression, not capability, and the results table must say so (
SYNTHETIC_CAVEAT,src/devops_cli/ai/review/defects.py:41). - No new dependencies.
- Tests never touch the network or the cluster. They add at most 1 s to the gate.
Strategic Alignment
- Milestone: v0.2.25
- Depends on: feat(ai): model-in-the-loop prompt benchmarking #413 (v0.2.25, the same release). It supplies repeated-run corpus scoring (
corpus score --runs) and run setups that name the verification model each arm used. - Related:
- feat(ai): llm gateway weights validated against real reviews #476 and feat(ai): review verification on its own model task #486 (closed). feat(ai): llm gateway weights validated against real reviews #476 left its question to this item.
- feat(review): review page size against quality and speed #480: its page-size sweep reuses these arms.
- feat(cli): measured per-deployment capability probes replacing parameter-count failover floors #595: capability probes, which do not replace this baseline.
- feat(review): subject-keyed review history with a leave-one-out baseline #607: review history counts repeated sessions.
- chore(ai): remove the code, config and policies left over from the removed vLLM deployments #820: owns the stale vLLM comments in the same configmap (
configmap.yaml:85-88, :181) and in thek8s/README.mdgateway section. - The split-offs: findings record their producer; a dry-run review writes no session, which feat(cli): reachable
--dry-runpreviews for delegated commands #412 depends on. Review run records that name the verification model the review uses (src/devops_cli/ai/run_store.py:146) are not a split-off: feat(ai): model-in-the-loop prompt benchmarking #413 delivers that fix.
- Split off (backlog): feat(review): every reported finding is admitted with its producer's anchor and a location that exists in the reviewed commit, the review writes findings.sarif, and review.md shows findings and suppressions #871 (findings record their producer: scanner rule or serving model); fix(review): a dry-run review writes no session directory or findings #872 (a dry-run review writes no session directory or findings).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
docs(roadmap): plan LLM tuning and optimization work for v0.2.23 (#483)
feat(review): let review verification use its own model task (#495)
feat(release): v0.2.23 (#681)
dan-petty commentedon Oct 1, 2026
Retargeted from the shipped v0.2.23 to v0.2.25. It is still valid (checked 2026-10-01), and a P1 left open in a shipped release keeps precedence over P1 work committed later.
[-]feat(review): per-backend review quality baseline[/-][+]feat(review): per-model review quality baseline for the devops-review pool[/+]feat(review): per-model review quality baseline for the devops-review…
dan-petty commentedon Oct 2, 2026
Closed by #962, merged into
release/v0.2.25.GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by
devops gh issues close-merged.feat(release): v0.2.25 (#1089)