Repository navigation
Description
Problem Description
devops ai gateway tune recommends routing weights and tells the user to set litellm_params.weight, but the gateway routes with least-busy and reads no weight (router_settings.routing_strategy: least-busy, k8s/llm/gateway/config.yaml; no deployment sets weight). No deployment sets max_parallel_requests either, so the recommended concurrency is not a gateway setting too.
On origin/main (2026-10-29):
- The table of
_print_tune_report(src/devops_cli/commands/ai_gateway.py) has the columns Current Weight, Recommended Weight and Recommended Concurrency, and its footer says "To apply, set litellm_params.weight on each deployment in the gateway configuration." - The module docstring of
src/devops_cli/ai/gateway_tune.pysays "The gateway spreads a model group over its deployments by weight (simple-shuffle)".recommend_weightsandcalculate_hardware_weightscompute weights. - The command help, and so
docs/CLI_REFERENCE.mdanddocs/commands/ai.md, says "Measure each deployment of a gateway model group and recommend routing weights." - The setting
ai.gateway_weights(config/settings.py) overrides the recommended weights.
#1971 corrects the documents. This item corrects the command.
Reproduction Steps
Run uv run devops ai gateway tune --help, or read the footer of a devops ai gateway tune run.
Expected vs Actual Behavior
- Expected: the command reports what it measures for each deployment (engine, GPUs, capacity, cost) and tells the reader how the
least-busyrouter uses them, or that it does not. It recommends no setting that the gateway does not read. - Actual: it recommends weights and a concurrency, and tells the reader to copy the weights into
litellm_params.weight.
Environment Diagnostics
origin/main c96dbfe3.
Logs, Traces, or Terminal Output
None; the text is in the source lines above.
Existing Tool Considered
LiteLLM's routing documentation: least-busy picks the deployment with the fewest requests in flight and uses no weight. The change deletes the weight and concurrency recommendation, the footer and, if nothing else reads it, the ai.gateway_weights setting. Nothing new is built.
Proposed design
Problem statement
The devops ai gateway tune command recommends routing weights and concurrency, and tells the user to set litellm_params.weight. The gateway uses least-busy routing, which reads no weight. The command's table, footer, docstring, help text, and the ai.gateway_weights setting all reference a setting the gateway ignores. The command should report what it measures and state how the least-busy router uses that data, or that it does not.
Acceptance criteria
Requirement: No weight columns in report table
The tune command report table SHALL NOT include columns for current weight, recommended weight, or max parallel requests.
Scenario: Table headers exclude weight columns
- WHEN the tune command renders its report table
- THEN the table headers do not contain "Current Weight", "Recommended Weight", or "Max Parallel"
Requirement: No weight instruction in footer
The tune command footer SHALL NOT instruct the user to set litellm_params.weight on any deployment.
Scenario: Footer omits weight instruction
- WHEN the tune command prints its footer after the table
- THEN the footer text does not contain the string "litellm_params.weight"
Requirement: Docstring names least-busy
The module docstring of gateway_tune.py SHALL describe the least-busy routing strategy and SHALL NOT describe simple-shuffle as the gateway's routing method.
Scenario: Docstring reflects actual routing
- WHEN the module docstring of
src/devops_cli/ai/gateway_tune.pyis read - THEN it contains "least-busy" and does not contain "simple-shuffle" as the routing strategy
Requirement: Help text describes measurement
The tune command help text SHALL describe measuring and reporting per-deployment capacity, and SHALL NOT say it recommends routing weights.
Scenario: Help text omits weight recommendation
- WHEN
devops ai gateway tune --helpis run - THEN the help text does not contain the phrase "recommend routing weights"
Requirement: Dead settings removed
The settings model SHALL NOT define gateway_weights or gateway_concurrency fields under the ai section.
Scenario: Settings model has no weight fields
- WHEN the settings model is loaded and inspected
- THEN the
aisection has nogateway_weightsfield and nogateway_concurrencyfield
Requirement: Dead weight functions removed
The module gateway_tune.py SHALL NOT define or export recommend_weights, calculate_hardware_weights, or calculate_hardware_concurrency.
Scenario: Module exports exclude weight functions
- WHEN
src/devops_cli/ai/gateway_tune.pyis imported - THEN the module's
__all__does not contain "recommend_weights", "calculate_hardware_weights", or "calculate_hardware_concurrency"
Existing Tool Considered
No alternatives check has run. LiteLLM's least-busy routing strategy covers the gateway's routing need. It picks the deployment with the fewest in-flight requests and reads no weight. The CLI command reports per-deployment measurements; no external tool covers that reporting. The change removes the weight and concurrency recommendation from the command. Nothing new is built.
Key questions
- What routing strategy does the gateway use, and does any deployment set a weight?: The gateway uses
least-busyrouting. No deployment in the config setsweightormax_parallel_requests. [sources: k8s/llm/gateway/config.yaml] - Where is
settings.ai.gateway_weightsread in the codebase?: It is read only intune_cmdinsrc/devops_cli/commands/ai_gateway.py, passed asoverridestotune_pool. No other code reads it. [sources: src/devops_cli/commands/ai_gateway.py] - Should the weight and concurrency recommendation columns be removed from the tune report table?: Remove them. The gateway reads no weight, so a recommended weight is not a setting the user can apply. The measurement data (engine, GPUs, capacity, cost) stays. (best practice) [sources: k8s/llm/gateway/config.yaml, src/devops_cli/commands/ai_gateway.py]
- Chosen: Remove weight and concurrency columns. The gateway uses least-busy and reads no weight. A recommended weight is not actionable.
- Rejected: Keep columns but mark them informational. The user cannot apply the value. Keeping it adds noise and implies an action that does not exist.
- Should the
ai.gateway_weightsandai.gateway_concurrencysettings be removed?: Remove both. The gateway reads no weight and no concurrency limit. The settings are dead after the weight recommendation is removed. (best practice) [sources: src/devops_cli/commands/ai_gateway.py, k8s/llm/gateway/config.yaml]- Chosen: Remove both settings. No code reads them after the change. The gateway reads no weight. Keeping dead settings misleads the user.
- Rejected: Keep them for a future routing strategy. Speculative. The project is pre-1.0 and the pre-1.0 policy is to delete, not keep behind flags.
- Should
recommend_weights,calculate_hardware_weights, andcalculate_hardware_concurrencybe removed fromgateway_tune.py?: Remove all three. After the change,tune_poolno longer calls them. No other code calls them. They are dead. (best practice) [sources: src/devops_cli/ai/gateway_tune.py]- Chosen: Remove all three functions. No caller remains after the change. The pre-1.0 policy is to delete dead code.
- Rejected: Keep them for reuse. No other code path uses them. Keeping unused functions adds maintenance cost.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 29, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The command recommends settings the gateway does not read, which is incorrect behaviour in shipped code.The command still runs but gives misleading output; no data loss or security risk.Users who follow the tune output will set a weight the gateway ignores, causing confusion.The fix deletes the weight and concurrency columns, the footer text, and possibly one setting; nothing new is built.Both correct the same root cause (least-busy gateway reads no weight), but #1971 edits k8s/README.md while this item edits the tune command output and settings.docs(k8s): describe gateway tune for the least-busy router (#2593)
devops-cli-service commentedon Oct 30, 2026
Status set to Ready at 07fb4c2 (see proposed design in issue body).
devops-cli-service commentedon Nov 1, 2026
Staged: branch
fix/2592-devops-ai-gateway-tune-recommends-weights, draft pull request #3008. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:
These paths of the plan are no file on the default branch, and no group creates them:
config/settings.py. A person checks that the plan names them right.docs(openspec): plan #2592 remove weight recs from gateway tune (#3008)
docs(openspec): fix plan #2592 premise, paths and tests (#3085)
feat(roadmap): let the step guard allow a recorded test removal (#3715)
[-]fix(ai): devops ai gateway tune recommends weights that the least-busy gateway does not read[/-][+]fix(ai): remove weight recs from gateway tune[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 83 characters, and the limit is 60. The type and the scope stay.
fix(ai): devops ai gateway tune recommends weights that the least-busy gateway does not readfix(ai): remove weight recs from gateway tunedevops-cli-service commentedon Nov 7, 2026
Released in v0.81.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.81.0
devops-cli-service commentedon Nov 7, 2026
Live since 2026-11-07 15:32 UTC