Skip to content

feat(k8s): add the Qwen and auto-code trial groups to the gateway #5568

Done

Description

@dan-petty

Update 2026-11-26 (infra move): the gateway config moved to dan-petty/homelab.

This issue keeps the prices, CONST_AI_GATEWAY_HOSTED_MODELS, SECURITY.md item 13 and the README text. The three model_list entries, the checks that no pool or fallback names them and the live calls are in the homelab follow-up. A devops-cli test cannot read the gateway config.

Follow-up: dan-petty/homelab#303.


Problem or Motivation

Owner directions (2026-11-13): "I would like to test openrouter models: qwen/qwen3.8-flash - alternative to deepseek; qwen/qwen3.8-max-0902 - smarter model to test if failing task is due to model quality", and "this one is also worth an evaluation: openrouter/auto-code".

The gateway has no group for these three models, so an eval or a trial run cannot name them. These requests replace the 2026-11-02 rule "compare only Sonnet and DeepSeek" for these three models.

A probe on 2026-11-13 sent direct calls to OpenRouter with provider: {data_collection: deny}. It spent about 0.003 USD, and no call reached a Claude model.

Model Window List price, USD per million (input/output/cached input) Provider Probe
qwen/qwen3.8-flash 1,000,000 0.15 / 0.47 / 0.016 Alibaba only, quantization "unknown" Served with deny. Tool call and strict json_schema are correct.
qwen/qwen3.8-max-0902 1,000,000 2.0 / 6.0 / 0.25 Alibaba only Served with deny. Tool call is correct. Strict json_schema output fits the schema, but the answer was wrong once (it read the field "language" as a human language).
openrouter/auto-code 2,000,000 no fixed price (-1): OpenRouter bills the price of the model it picks the provider of the picked model Served with deny. All six calls went to openai/gpt-6.1-sol (1.0/5.0 USD per million). Tool call and strict json_schema are correct.

Two facts limit the config:

  • The quantizations: [fp8] filter of the DeepSeek groups stops a Qwen call: 404 "No endpoints found for the request with quantization: fp8". OpenRouter lists the quantization of the Qwen endpoints as "unknown". So a Qwen group has no quantization filter.
  • The owner holds claude-sonnet-5-5 since 2026-11-11: no trial, eval or comparison with it. openrouter/auto-code can pick an Anthropic Claude model. The plugin auto-router accepts excluded_models, and the probe showed that OpenRouter enforces it (a request that excluded every allowed model got 404 "No router pool model is routable for this request"). The patterns anthropic/* and */claude-* are the examples of the OpenRouter docs.

Proposed Solution & Architectural Design

Add three hosted trial groups to k8s/llm/gateway/config.yaml of dan-petty/homelab (follow-up issue):

  • qwen3.8-flash: openrouter/qwen/qwen3.8-flash, data_collection: deny, no quantization filter, window 1,000,000, list prices.
  • qwen3.8-max-0902: openrouter/qwen/qwen3.8-max-0902, data_collection: deny, no quantization filter, window 1,000,000, list prices.
  • auto-code: openrouter/openrouter/auto-code, data_collection: deny, and plugins: [{id: auto-router, excluded_models: ["anthropic/*", "*/claude-*"]}], so it never picks a Claude model. Its window is 2,000,000. Its gateway price is an upper bound from the OpenRouter docs, and the text says that OpenRouter bills the real price.

Also:

  • Add the prices to _HOSTED_GROUP_PRICES (src/devops_cli/ai/spend/pricing.py) and the groups to CONST_AI_GATEWAY_HOSTED_MODELS.
  • No pool and no fallback names a trial group, and no setting of the Service names one. A caller (an eval or a trial run) names a group to use it.
  • Update SECURITY.md item 13 and the hosted-model text of k8s/README.md.

Target Subsystem

AI & Agentic Review Pipeline

Acceptance Criteria

  • A gateway config test proves that each trial group is hosted, asks for data_collection: deny, has no quantization filter, and that no pool, no fallback and no Service setting names it. The test fails on the base (devops ci fail-to-pass).
  • The test proves that the auto-code group excludes anthropic/* and */claude-*.
  • tests/ai/spend/test_hosted_group_prices.py passes with the new groups (the prices are equal in both places).
  • After the Argo CD sync: one call to each trial group answers through the gateway.

Existing Tool Considered

LiteLLM model_list entries with extra_body, OpenRouter provider routing (data_collection: deny) and the OpenRouter Auto Router plugin (excluded_models) cover the need. No new code.

Related

#5564 (the DeepSeek fallback group, PR #5565, changes the same files), #3152, #4403

Alternatives check of 2026-11-23: in-use.
The repository already uses this tool.
Tool: BerriAI/litellm (https://github.com/BerriAI/litellm), NOASSERTION, last activity 2026-11-23, maintained.
Reason: Searches on the OpenRouter routing and gateway config found little usable text, but LiteLLM, the gateway the repository already runs, forwards extra_body into the OpenRouter request body, so three model_list entries with provider deny, the auto-router plugin and prices cover the need with no new code.

Covers:

  • Hosted model groups from model_list entries in the proxy config
  • Forwards extra_body.provider.data_collection: deny to OpenRouter
  • Passes the auto-router plugin with excluded_models patterns
  • Per-deployment model_info window, prices and response-schema flag

Lacks:

  • No guard that keeps trial groups out of pools and fallbacks
  • No fixed price for a router-picked model; the group price is an estimate
  • No automatic Claude exclusion; the pattern list must be set by hand
  • No quantization filter check; OpenRouter reports Qwen endpoints as unknown

Proposed design

Problem statement

The gateway needs three trial groups: qwen/qwen3.8-flash, qwen/qwen3.8-max-0902 and openrouter/auto-code. The gateway config moved to dan-petty/homelab, so homelab#303 adds the three model_list entries and the live checks. This issue updates the spend price table, the hosted-model constant, SECURITY.md item 13 and the k8s/README.md text. The two Qwen groups carry list prices, and auto-code has no fixed price, so the gateway records the billed cost.

Acceptance criteria

Requirement: Hosted group prices

_HOSTED_GROUP_PRICES SHALL hold the list prices of qwen3.8-flash (0.15/0.47/0.016) and qwen3.8-max-0902 (2.0/6.0/0.25) in USD per million, and no fixed auto-code price.

Scenario: The hosted group price test passes

  • WHEN uv run pytest tests/ai/spend/test_hosted_group_prices.py runs on the change
  • THEN The test passes with the two Qwen list prices and no fixed auto-code price.

Requirement: Hosted model constant

CONST_AI_GATEWAY_HOSTED_MODELS SHALL name qwen3.8-flash, qwen3.8-max-0902 and auto-code.

Scenario: The settings test passes

  • WHEN uv run pytest tests/config/test_settings.py runs on the change
  • THEN The test passes with the three group names in the constant.

Requirement: Security and k8s docs

SECURITY.md item 13 and k8s/README.md SHALL name the three trial groups, the data_collection: deny rule, the auto-code Claude exclusion and its no-fixed-price billing.

Scenario: The docs row passes

  • WHEN uv run devops ci --check --only docs runs on the change
  • THEN The docs row passes.

Existing Tool Considered

BerriAI/litellm is the open, maintained gateway that the repository already uses. The alternatives check of 2026-11-23 in the issue body records the verdict in-use and lists what the tool covers and lacks. This issue adds no gateway code. The homelab follow-up #303 sets the anthropic/* and */claude-* exclusion patterns by hand, leaves auto-code without a fixed price so LiteLLM records the billed cost, and sets no quantization filter on the Qwen groups. This repository updates the prices, the hosted-model constant and the two documents.

Key questions

  • Which files hold the hosted group prices and the hosted group names?: _HOSTED_GROUP_PRICES is in src/devops_cli/ai/spend/pricing.py. CONST_AI_GATEWAY_HOSTED_MODELS is in src/devops_cli/config/constants.py. [sources: src/devops_cli/ai/spend/pricing.py:84, src/devops_cli/config/constants.py:3337]
  • Which repository holds the gateway model_list entries and the live checks?: The environment tree lives only in dan-petty/homelab. homelab#303 adds the three model_list entries and the live checks. This repository holds no gateway config. [sources: CONTEXT.md]
  • Which test proves the hosted model constant?: tests/config/test_settings.py tests CONST_AI_GATEWAY_HOSTED_MODELS. The test must pass with the three new names. [sources: tests/config/test_settings.py, src/devops_cli/config/constants.py:3337]
  • Where does the documentation change go?: SECURITY.md item 13 and the hosted-model text of k8s/README.md name the trial groups and their rules. [sources: SECURITY.md, k8s/README.md]
  • How does _HOSTED_GROUP_PRICES represent the auto-code group?: It holds no fixed price for auto-code. The group stays out of the fixed-price table, and the gateway records the billed cost of each call. (best practice) [sources: src/devops_cli/ai/spend/pricing.py:84]
    • Chosen: No fixed price. OpenRouter gives no bound, and LiteLLM 1.111.0 drops the billed cost when a fixed price is set.
    • Rejected: Upper-bound estimate. The reply states that no upper bound exists on the gateway side.
    • Rejected: Zero price. A zero price hides the real spend that OpenRouter bills.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    scope/k8s
    status/new
    value/medium
    effort/medium
    on Nov 13, 2026
  2. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    owner/agent
    on Nov 13, 2026
  4. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: Searches confirmed LiteLLM's gateway model_list takes per-group extra_body and plugins, so the three OpenRouter groups need config only; the issue already names LiteLLM as the tool the gateway uses.

    The repository already uses this tool.

    Tool: BerriAI/litellm (https://github.com/BerriAI/litellm), NOASSERTION, last activity 2026-11-17, maintained.

    Covers:

    • Hosted OpenRouter groups declared in gateway model_list config
    • extra_body carries provider data_collection deny per group
    • Plugin options can exclude anthropic/* and /claude- models
    • Pricing and hosted-model constants stay in the same repository

    Lacks:

    • No list price for openrouter/auto-code; an upper bound is set by hand
    • Config test proving the new groups is project code, not shipped
    • No quantization filter where OpenRouter reports the endpoint as unknown
    Searches (9)

    Tools considered:

    Searches run:

    • LiteLLM model_list extra_body openrouter provider routing config, results: 5
    • OpenRouter auto-router plugin excluded_models, results: 5
    • OpenRouter provider preferences data_collection deny docs, results: 5
    • LiteLLM proxy documentation model_list configuration, results: 5
    • openrouter.ai docs provider routing quantization, results: 5
    • litellm.ai docs providers openrouter, results: 5
    • BerriAI litellm github, results: 5
    • OpenRouter Auto Router plugin excluded_models documentation, results: 5
    • LiteLLM proxy config extra_body plugins openrouter auto router, results: 5

    Sources:

    A person decides what this check of 2026-11-17 means for the item.

  5. added
    status/ready
    and removed
    status/new
    on Nov 18, 2026
  6. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 86358b6 (see proposed design in issue body).

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

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  8. dan-petty commented on Nov 27, 2026

    @dan-petty
    OwnerAuthor

    The homelab gateway part of this item has a pull request: dan-petty/homelab#618 (for dan-petty/homelab#303).

    • Group names and aliases in the gateway: qwen3.8-flash, qwen3.8-max-0902, auto-code; aliases openrouter/qwen/qwen3.8-flash, openrouter/qwen/qwen3.8-max-0902 and openrouter/openrouter/auto-code.
    • Prices: the two Qwen groups carry the OpenRouter list prices. auto-code has NO fixed price: the OpenRouter docs give no pool and no upper bound, and in LiteLLM 1.111.0 a fixed price would make the gateway drop the cost that OpenRouter reports. The gateway records the billed cost of each call. The "upper bound" price of this item does not exist on the gateway side.
    • auto-code sends the auto-router plugin with excluded_models: ["anthropic/*", "*/claude-*"] (a hard restriction per the OpenRouter docs), not a models list (a fallback list).
    • No group has a fallback; each asks for data_collection: deny.
  9. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  10. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 29, 2026
  11. removed
    status/in-review
    owner/agent
    on Nov 29, 2026
  12. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 16:50 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/mediumpriority/p2-mediumscope/k8ssource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions