Repository navigation
Description
Context & Rationale
The ledger stores provider, served_by, model, tokens and cost per call (src/devops_cli/ai/spend/ledger.py:24-40) but not what the call was for: request_type holds transport labels (src/devops_cli/ai/client/unified.py:449, src/devops_cli/ai/direct.py:124) and AIConfig.for_task keeps no task name (src/devops_cli/config/settings.py:408-429). LLMRouter serves only the advisory devops ai route (src/devops_cli/commands/ai.py:1350); only tests call GatewayRouter.resolve_model. devops ai harness offload passes frontier_tokens=0 and prints 100%, target met, with no model call (src/devops_cli/commands/ai_harness.py:79-107). ai_spend_report and resource://ai/spend pass --group-by, which devops ai cost report rejects (src/devops_cli/ai/mcp/server.py:2831-2857). Prices disagree across the router (src/devops_cli/ai/router.py:249-252), the ledger's hand-kept dict (src/devops_cli/ai/spend/pricing_data.py:67) and an unpinned LiteLLM fetch (src/devops_cli/config/defaults.py:366); genai-prices is installed via pydantic-ai-slim but nothing imports it. vibes' 80/20 split and 85%+ savings cite no method or data.
Scope & Deliverables
- Context & Rationale*: The ledger stores provider,
served_by, model, tokens and cost per call (src/devops_cli/ai/spend/ledger.py:24-40) but not what the call was for:request_typeholds transport labels (src/devops_cli/ai/client/unified.py:449,src/devops_cli/ai/direct.py:124) andAIConfig.for_taskkeeps no task name (src/devops_cli/config/settings.py:408-429).LLMRouterserves only the advisorydevops ai route(src/devops_cli/commands/ai.py:1350); only tests callGatewayRouter.resolve_model.devops ai harness offloadpassesfrontier_tokens=0and prints 100%, target met, with no model call (src/devops_cli/commands/ai_harness.py:79-107).ai_spend_reportandresource://ai/spendpass--group-by, whichdevops ai cost reportrejects (src/devops_cli/ai/mcp/server.py:2831-2857). Prices disagree across the router (src/devops_cli/ai/router.py:249-252), the ledger's hand-kept dict (src/devops_cli/ai/spend/pricing_data.py:67) and an unpinned LiteLLM fetch (src/devops_cli/config/defaults.py:366);genai-pricesis installed viapydantic-ai-slimbut nothing imports it. vibes' 80/20 split and 85%+ savings cite no method or data. - Deliverable*: (1) Ship alone, first: delete
TokenSavingsSummary,is_target_metand both "Token Savings" rows (src/devops_cli/commands/ai_harness.py:105,237), report files scanned and matches instead, and restate 85%+ in ROADMAP principle 5 andsrc/devops_cli/ai/harness/slots.py:6as an unmeasured target with no replacement figure. (2) Add a nullablestagecolumn in place, asserved_bywas (src/devops_cli/ai/spend/ledger.py:51-53), filled from a ContextVar scope likecompletion_cap(src/devops_cli/ai/client/network.py:55) set inside thereview.file_reviewandreview.verificationspans (src/devops_cli/ai/review/pipeline.py:1723,2251), falling back to theai.tasks.<task>name passed toLLMClient, through alltrack_request_spendsites. Add--by stagetodevops ai costanddevops ai cost report(calls, tokens, cost side by side); point the MCP tool and resource at--by. (3) Makegenai-pricesthe only lookup behindPricingRegistry.get_pricing, declared directly, withupdate-pricingusing its updater; retire the dict, the LiteLLM fetch andDEFAULT_MODEL_PRICING(src/devops_cli/ai/router.py:253,src/devops_cli/ai/agents/embeddings.py:171). Local calls cost nothing unlessdevops ai cost set-pricesays otherwise. Addcost_usdto the call-observer payload (src/devops_cli/ai/spend/ledger.py:467-477) andReviewProfile. (4) Then deleteLLMRouter,devops ai routeandGatewayRouter.resolve_model, movingTaskComplexity; wire one selector on theAITasksConfigvocabulary only if the ledger shows misrouted calls. - Constraint*: Mislabelled rows are worse than none: an unset scope records the task name or NULL, shown as
unattributed.for_taskaccepts unknown names silently (src/devops_cli/config/settings.py:410), so record onlyAITasksConfigfields. Never record local AST work as spend. Step (3) lowersdevops ai cost reporttotals and the Review, findings and AI spend metrics reach Prometheus #564 spend metrics for local calls; announce it. An all-hosted counterfactual prices the same tokens at one configured reference model on read, never stored. Any surviving selector keeps the per-role floors (src/devops_cli/ai/capability.py:47) and keeps security-critical work local. Port nothing from vibes' router or leaderboard. - Measured*:
uv run python -c "from devops_cli.ai.harness.slots import TokenSavingsSummary as T; print(T.calculate(frontier_tokens=0, offloaded_tokens=14))"printssavings_percentage=100.0. One millionqwen2.5-coder:7bprompt tokens cost 0.15 USD in the ledger table (uv run python -c "from devops_cli.ai.spend.pricing_data import DEFAULT_INDUSTRIAL_MODEL_PRICING as D; print(D['qwen2.5-coder:7b'].calculate_cost(1_000_000, 0))") and 0.0 in the router (uv run python -c "from devops_cli.ai.router import LLMRouter; print(LLMRouter._estimate_cost(None, 'ollama', 'qwen2.5-coder:7b', 1_000_000))").grep -rn "request_type" src --include='*.py' | grep -v "^src/devops_cli/ai/spend/\|request_type=" | wc -lprints 0. - Source*: vibes
observations/devops-cli/05-harness-slots-and-subagent-offloading.md, vibestools/model_router.py, vibesobservations/systems/25-multi-model-capability-boundaries-and-dynamic-routing-oracles.md, vibestests/test_model_router.py, vibestools/model_leaderboard.py, vibestools/subagent_orchestrator.py, vibesbenchmarks/benchmark_runner.py, vibesbenchmarks/README.md, vibesREADME.md, vibesobservations/systems/21-hierarchical-subagent-slot-offloading-and-epistemic-loss.md, vibesobservations/systems/20-internet-grounded-information-foraging-and-self-improvement-loops.md
Strategic Alignment
- Milestone:
v0.2.23(devops ai Review Quality, LLM Routing & Multi-Language Validation) - Roadmap Reference:
docs/ROADMAP.md
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(ai): delete TokenSavingsSummary and report scanned metrics (#594) (
feat(ai): stage-attributed spend ledger and by-stage reporting (#594) (…
feat(ai): one genai-prices price source and local zero-cost spend (#594…
feat(ai): local hardware payoff tracking and counterfactual savings (#…
feat(ai): delete LLMRouter, devops ai route, and GatewayRouter.resolv…
dan-petty commentedon Sep 27, 2026
Closed by #631, merged into
release/v0.2.23.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.