Repository navigation
Labels
priority/p3-lowPriority P3: a small improvementscope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/featureType feature: a new function
Description
Context & Rationale
The tuner measures cost with a probe on a synthetic prompt, and measuring capacity takes a sweep of about eight minutes that loads every backend. The vLLM backends were removed in #734, so vLLM's lifetime counters (which also counted every benchmark request, the tuner's own included) are no longer an alternative; real traffic comes from the spend ledger.
Scope & Deliverables
- Context & Rationale*: The tuner measures cost with a probe on a synthetic prompt, and measuring capacity takes a sweep of about eight minutes that loads every backend. The vLLM backends were removed in feat(k8s): modernize monitoring stack, llm profiles, traefik routing, and remove squid proxy #734, so vLLM's lifetime counters (which also counted every benchmark request, the tuner's own included) are no longer an alternative; real traffic comes from the spend ledger.
- Deliverable*: Take cost (tokens per review request, per backend) from the spend ledger's recorded serving backend. Persisting measurements already shipped in v0.2.23 (
devops ai gateway tunerecords each run viarecord_run(Mechanism.GATEWAY_TUNE)), so add--estimateon top of those records: capacity for a new or changed deployment, scaled by GPU memory bandwidth from a measured deployment running the same model and engine, without sending load.
Strategic Alignment
Proposed design
Problem statement
The AI gateway tuner currently measures cost using synthetic prompts and capacity through time-consuming backend sweeps. With vLLM backends removed, there's no way to use lifetime counters for cost estimation, so real traffic data from the spend ledger must be used instead.
Acceptance criteria
- Criterion 1: Cost measurements are taken from the spend ledger's recorded serving backend
Verification: Verify that the gateway tuner reads token usage per request from the spend ledger rather than synthetic probe data - Criterion 2: Capacity estimates can be made without sending load to backends
Verification: Confirm that capacity estimation uses GPU memory bandwidth scaling from measured deployments running the same model and engine, without additional load generation - Criterion 3: Existing measurements are persisted with new --estimate flag
Verification: Ensure thatdevops ai gateway tunerecords each run viarecord_run(Mechanism.GATEWAY_TUNE)and supports a new--estimateoption to add capacity estimates
Key questions
None.
Open questions
- What is the current method of measuring cost in the AI gateway tuner? (missing verified source)
- How long does it take to measure capacity with the current method? (missing verified source)
- What happened to vLLM backends in issue feat(k8s): modernize monitoring stack, llm profiles, traefik routing, and remove squid proxy #734? (missing verified source)
- How will cost be measured now that vLLM backends are gone? (missing verified source)
- What is the expected outcome of adding --estimate flag to existing records? (missing verified source)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
priority/p3-lowPriority P3: a small improvementscope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/featureType feature: a new function
Type
Projects
- StatusShow more project fieldsIn Review
Activity
docs(roadmap): plan LLM tuning and optimization work for v0.2.23 (#483)
feat(release): v0.2.23 (#681)
dan-petty commentedon Oct 1, 2026
Moved from the shipped v0.2.23 to the backlog. It is still valid (checked 2026-10-01), and P2 items don't displace P1 work in the planned releases.
dan-petty commentedon Oct 2, 2026
Grooming (2026-10-02): Priority p2-medium → p3-low. An optimization of an internal tuning tool. The tuner works today with a synthetic probe, and nothing is broken or at risk.
Checked against the code at the release/v0.2.25 tip.
dan-petty commentedon Oct 8, 2026
Linked: #478 and #595. Gateway routing is hand-tuned from synthetic probes; #478 renders what this item measures, and #595's slice 1 stores its results here. Found by the 2026-10-08 backlog review.
dan-petty commentedon Oct 22, 2026
Returned to New: the tuner's recommendation has no consumer, so building the item as written would add machinery nothing reads.
least-busyand sets noweightanywhere:k8s/llm/gateway/configmap.yaml:166names the strategy, and the file holds noweight:key.devops ai gateway renderdeletesweight:lines (src/devops_cli/ai/gateway_render.py:14,86-88), anddocs/agent/tasks/task-478-*.mdrecords the weights as meaningless underleast-busy. The only readers of the tuner's capacity and cost figures arerecommend_weightsand the table incommands/ai_gateway.py:342-361, so better cost and capacity numbers would change nothing the gateway does.--estimate) are buildable, but the physical model is shaky: the capacity pass relies onignore_eos, whichgateway_bench.py:12,124says only vLLM honours, and no vLLM backend remains; summing GPU bandwidth over-predicts layer-split Ollama on multi-GPU nodes. Checking either needs a live cluster, a prior livegateway-tunerun record and a populated spend ledger.Proposed re-scope, a deletion item: remove
recommend_weights,calculate_hardware_weights,_deployment_hardware_score,_deployment_bandwidth_sum,settings.ai.gateway_weights, the Weight, Recommended and Est. req/s columns with the "set litellm_params.weight" footer, theCONST_ENGINE_MULTIPLIER_*constants, the vLLM remnants ingateway_bench.py, and the stale weight text ink8s/README.md:87-99and thegateway_tune.pymodule docstring.chore(main): release 0.4.0 (#1960)