Skip to content

fix(ai): remove weight recs from gateway tune #2592

Closed

Description

@dan-petty

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.py says "The gateway spreads a model group over its deployments by weight (simple-shuffle)". recommend_weights and calculate_hardware_weights compute weights.
  • The command help, and so docs/CLI_REFERENCE.md and docs/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-busy router 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.py is 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 --help is 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 ai section has no gateway_weights field and no gateway_concurrency field

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.py is 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-busy routing. No deployment in the config sets weight or max_parallel_requests. [sources: k8s/llm/gateway/config.yaml]
  • Where is settings.ai.gateway_weights read in the codebase?: It is read only in tune_cmd in src/devops_cli/commands/ai_gateway.py, passed as overrides to tune_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_weights and ai.gateway_concurrency settings 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, and calculate_hardware_concurrency be removed from gateway_tune.py?: Remove all three. After the change, tune_pool no 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

  1. added
    source/agent
    type/bug
    status/new
    value/medium
    effort/low
    on Oct 29, 2026
  2. dan-petty commented on Oct 29, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The command recommends settings the gateway does not read, which is incorrect behaviour in shipped code.
    • Priority: P2-Medium. The command still runs but gives misleading output; no data loss or security risk.
    • Value: Medium. Users who follow the tune output will set a weight the gateway ignores, causing confusion.
    • Effort: Low. The fix deletes the weight and concurrency columns, the footer text, and possibly one setting; nothing new is built.
    • Related: docs(k8s): the gateway tune paragraph describes the least-busy gateway, with no weights #1971, which asks for a different change. 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.
  3. added
    priority/p2-medium
    on Oct 29, 2026
  4. added
    scope/ai
    on Oct 30, 2026
  5. added
    status/ready
    and removed
    status/new
    on Oct 30, 2026
  6. devops-cli-service commented on Oct 30, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 07fb4c2 (see proposed design in issue body).

  7. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

    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:

    1. Remove weight columns and footer from tune report: 4488 tokens
    2. Remove dead weight functions and fields from gateway_tune: 4548 tokens
    3. Remove dead gateway weight settings: 4363 tokens
    4. Update CLI reference and command docs: 4413 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.

  8. added a commit that references this issue on Nov 1, 2026
  9. added
    status/planned
    and removed
    status/ready
    on Nov 1, 2026
  10. added
    owner/agent
    on Nov 1, 2026
  11. changed the title [-]fix(ai): devops ai gateway tune recommends weights that the least-busy gateway does not read[/-] [+]fix(ai): remove weight recs from gateway tune[/+] on Nov 6, 2026
  12. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    The job shortened the title of this item. The summary had 83 characters, and the limit is 60. The type and the scope stay.

  13. added
    status/in-progress
    status/in-review
    and removed
    status/planned
    status/in-progress
    on Nov 7, 2026
  14. removed
    status/in-review
    owner/agent
    on Nov 7, 2026
  15. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor
  16. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-07 15:32 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/aisource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions