Skip to content

fix(ai): replace devops-embedding, which the gateway does not serve #5304

Done

Description

@dan-petty

Problem Description

The gateway config k8s/llm/gateway/config.yaml has no model_name, alias or wildcard devops-embedding. The embedder group is qwen3-embedding:0.6b. The CLI still names devops-embedding in DEFAULT_GATEWAY_ROUTES (src/devops_cli/ai/gateway.py:55-81), MODEL_FAILOVER_PAIRS (gateway.py:86-91), CONST_AI_GATEWAY_VIRTUAL_MODELS (src/devops_cli/config/constants.py:2823-2828), the embedding benchmark default (src/devops_cli/commands/benchmark.py:245-247) and src/devops_cli/ai/capability.py:52.

devops ai gateway status prints this static table, not the gateway routes. probe_gateway copies the /health/readiness result onto each row (gateway.py:562-572), so the command marks the missing group as healthy. It also shows devops-chat on one tier, but the gateway sends it to two tiers.

Reproduction Steps

  1. Run uv run devops ai gateway status.
  2. Run uv run devops ai gateway routes --format json.
  3. Run uv run devops ai benchmark --type embedding --dry-run.

Expected vs Actual Behavior

Expected: status shows the groups that the gateway serves. The embedding benchmark asks for a served group, and its plan names the gateway /v1/embeddings route.

Actual: status shows 4 static rows, and one of them is devops-embedding with a healthy mark. routes shows 12 groups and 16 deployments, and none is devops-embedding. The benchmark plans model devops-embedding, which the gateway refuses with HTTP 400 Invalid model name. Its dry-run plan names POST <ollama>/api/embeddings (src/devops_cli/ai/ai_plans.py:55-63), not the gateway route.

Environment Diagnostics

  • DevOps CLI Version: 0.124.0
  • Gateway: LiteLLM v1.103.11
  • Execution Environment: DevContainer, with the homelab Kubernetes cluster

Logs, Traces, or Terminal Output

# GET /v1/models (2026-11-13): 13 ids, and none is devops-embedding.
# devops ai gateway status: 4 rows, each with a healthy mark, and one is devops-embedding.
# devops ai gateway routes --format json: 12 groups and 16 deployments.
# Gateway logs over 7 days: 0 requests for devops-embedding. The defect is latent, but the status output is wrong today.

#3567 (archive design.md:18) kept the name for the benchmark, but the gateway never got a group with that name. The test only compares route targets (tests/ai/benchmark/test_k8s_llm_gateway.py:168-174).

Proposed Fix

  • ai gateway status (src/devops_cli/commands/ai_gateway.py:120-160): render the live routes from GET /model/info when the gateway answers, as routes does. Pass the API key (get_ai_api_key(settings)). Use DEFAULT_GATEWAY_ROUTES only when the gateway does not answer, and mark those rows as not checked. Keep the failover record (feat(ai): devops ai gateway status reports failover while a route is failover:*, and failover --reset restores the default routes #1986).
  • Replace devops-embedding with qwen3-embedding:0.6b in the routes and the failover pairs (src/devops_cli/ai/gateway.py:50-91), the benchmark default (src/devops_cli/commands/benchmark.py:247) and src/devops_cli/ai/capability.py:52.
  • When the provider is gateway, let the dry-run plan of the benchmark name /v1/embeddings (src/devops_cli/ai/ai_plans.py:55-63).
  • Add a test that each route virtual_model and each CONST_AI_GATEWAY_VIRTUAL_MODELS entry is a model_name in k8s/llm/gateway/config.yaml. fix(ai): an unknown local gateway group counts as hosted #4886 needs the same test.
  • Update the MCP tool snapshot, tests/ai/benchmark/test_embedding_benchmark_failure.py:25, tests/ai/test_service_client_configured_urls.py:33 and the configured-service-urls spec.
  • Fix the stale test path in the comment at gateway.py:51-54. The test is tests/ai/benchmark/test_k8s_llm_gateway.py.

Related: #4886 (the constant drift and the price source), #5236 (command names for these routes).

Acceptance Criteria

  • devops ai gateway status shows the groups from GET /model/info when the gateway answers. Rows from DEFAULT_GATEWAY_ROUTES show only when the gateway does not answer, and they are marked as not checked.
  • git grep -n devops-embedding -- src tests finds no line.
  • A test fails when a route virtual_model or a CONST_AI_GATEWAY_VIRTUAL_MODELS entry is not a model_name in k8s/llm/gateway/config.yaml.
  • devops ai benchmark --type embedding --dry-run with the provider gateway plans qwen3-embedding:0.6b on /v1/embeddings.
  • uv run devops ci fail-to-pass --base origin/main shows that the new tests fail on the base.

Alternatives check of 2026-11-22: none.
Tool: none found.
Reason: Searches found no open tool for this need. LiteLLM is the gateway the project already runs and reads through GET /model/info; it supplies route data but cannot edit the CLI constants, status renderer or benchmark planner.

Lacks:

  • No edit of CLI route and failover constants
  • No live route rendering in the status command
  • No drift test comparing CLI names with the gateway config
  • No embedding benchmark plan for the gateway route

Proposed design

Problem statement

Replace the dead devops-embedding name, render live gateway routes, and add a drift test. The gateway serves qwen3-embedding:0.6b, but the CLI still names devops-embedding in routes, failover pairs, constants and benchmark defaults. The status command prints a static table and marks the missing group as healthy. The embedding benchmark plans an Ollama route that the gateway refuses.

Acceptance criteria

Requirement: Live gateway status

The devops ai gateway status command SHALL render each group and deployment from GET /model/info when the gateway answers, and MUST keep the failover record.

Scenario: Live status shows served groups and failover

  • WHEN A test gives the status command a fake GET /model/info response with both devops-chat deployments and qwen3-embedding:0.6b, and a recorded failover.
  • THEN The test asserts that the output lists both devops-chat deployments, qwen3-embedding:0.6b, and the failover record, and does not list devops-embedding.

Requirement: Gateway status sends API key

The devops ai gateway status command MUST send the configured AI API key on its GET /model/info request.

Scenario: Status authenticates the model-info request

  • WHEN A test runs the status command with get_ai_api_key(settings) set to a known key and a fake gateway client.
  • THEN The test asserts that the GET /model/info request carries that key.

Requirement: Static fallback rows are marked not checked

The command SHALL use DEFAULT_GATEWAY_ROUTES only when the gateway does not answer, and MUST mark those rows as not checked.

Scenario: Gateway unreachable

  • WHEN A test makes GET /model/info fail or time out.
  • THEN The test asserts that the output lists the default route rows and marks each row as not checked.

Requirement: No dead embedding name

The CLI SHALL name qwen3-embedding:0.6b in place of devops-embedding in gateway routes, failover pairs, benchmark defaults and capability constants.

Scenario: Dead embedding name is gone

  • WHEN The check git grep -n devops-embedding -- src tests runs.
  • THEN The command exits with no matches, and a source test asserts that qwen3-embedding:0.6b appears in the route, failover, benchmark default and capability constants.

Requirement: Model-name drift test

The project MUST have a test that parses k8s/llm/gateway/config.yaml and asserts that every route virtual_model and every CONST_AI_GATEWAY_VIRTUAL_MODELS entry is a model_name in that file.

Scenario: Drift check rejects an unknown model

  • WHEN The drift test runs with a route whose virtual_model is absent from the gateway config.
  • THEN The test fails and reports the absent model name.

Requirement: Gateway embedding benchmark plan

The embedding benchmark dry-run SHALL plan POST /v1/embeddings on the gateway with model qwen3-embedding:0.6b when the provider is gateway.

Scenario: Gateway provider uses the gateway embeddings route

  • WHEN A test runs devops ai benchmark --type embedding --dry-run with the provider gateway.
  • THEN The test asserts that the plan names qwen3-embedding:0.6b and the gateway /v1/embeddings route, and no Ollama /api/embeddings route.

Requirement: Updated AI fixtures

The change SHALL update the MCP tool snapshot, tests/ai/benchmark/test_embedding_benchmark_failure.py, tests/ai/test_service_client_configured_urls.py and the configured-service-urls spec to the served embedding group.

Scenario: Updated AI fixtures pass

  • WHEN The affected AI tests run.
  • THEN The tests pass and the fixtures name qwen3-embedding:0.6b with no devops-embedding.

Requirement: Stale test path comment

The source comment that names the test for DEFAULT_GATEWAY_ROUTES SHALL name tests/ai/benchmark/test_k8s_llm_gateway.py.

Scenario: Comment names the real test path

  • WHEN A test reads the comment above DEFAULT_GATEWAY_ROUTES in src/devops_cli/ai/gateway.py.
  • THEN The test asserts that the comment names tests/ai/benchmark/test_k8s_llm_gateway.py and no stale path.

Requirement: Fail-to-pass evidence

The change SHALL show that the new tests fail on the base branch.

Scenario: New tests fail before the fix

  • WHEN uv run devops ci fail-to-pass --base origin/main runs on the change branch.
  • THEN The command shows the new tests fail on the base and pass on the change.

Existing Tool Considered

None. The alternatives check found no open, maintained tool that covers this need. It considered LiteLLM (https://github.com/BerriAI/litellm). That is the gateway this project already runs and reads via GET /model/info. LiteLLM does not edit the CLI route constants, status renderer or benchmark planner. The work edits existing CLI code. Estimated cost: about 45k tokens to build, 15k tokens to keep and fix, and 1.5 days elapsed.

Key questions

  • Which model name replaces devops-embedding?: qwen3-embedding:0.6b is the model group that the gateway config serves. [sources: k8s/llm/gateway/config.yaml]
  • How should devops ai gateway status show routes when the gateway answers or does not answer?: Use the live GET /model/info groups when the gateway answers. Use DEFAULT_GATEWAY_ROUTES only when it does not answer, and mark those rows as not checked. Send the configured AI API key on the request. (best practice) [sources: src/devops_cli/commands/ai_gateway.py, src/devops_cli/ai/gateway.py, k8s/llm/gateway/config.yaml]
    • Rejected: Live routes only. The command shows no route table when the gateway is down.
    • Rejected: Static routes only. This keeps the defect: the table marks a group the gateway does not serve as healthy.
    • Chosen: Live routes with marked static fallback. It shows the served groups and keeps a usable table when the gateway is down.
  • How should the project keep route and constant names aligned with the gateway config?: Add a test that parses k8s/llm/gateway/config.yaml and compares its model_name values with each route virtual_model and each CONST_AI_GATEWAY_VIRTUAL_MODELS entry. (best practice) [sources: tests/ai/benchmark/test_k8s_llm_gateway.py, k8s/llm/gateway/config.yaml, src/devops_cli/ai/gateway.py, src/devops_cli/config/constants.py]
    • Rejected: No drift test. The dead name stayed latent for weeks because no test compared the names.
    • Rejected: Runtime check in status. A runtime check finds drift only when a person runs the command.
    • Rejected: Generate constants from the config. This couples CLI code to a Kubernetes manifest and is larger than this fix.
    • Chosen: Test that parses the config. It catches drift in CI and needs no runtime coupling.
  • What route should the embedding benchmark dry-run plan when the provider is gateway?: Plan POST /v1/embeddings on the gateway with model qwen3-embedding:0.6b. (best practice) [sources: src/devops_cli/ai/ai_plans.py, src/devops_cli/commands/benchmark.py, k8s/llm/gateway/config.yaml]
    • Rejected: Keep the Ollama /api/embeddings route. The gateway refuses the dead model name, and the plan names a route the gateway does not serve.
    • Chosen: Use the gateway route only when the provider is gateway. It matches the gateway contract and keeps the direct Ollama route for the Ollama provider.
    • Rejected: Always use the gateway route. This breaks a benchmark that runs against Ollama directly.
  • Should the gateway status keep the failover record?: Yes. The command keeps the failover record while it renders live routes. (best practice) [sources: src/devops_cli/commands/ai_gateway.py, src/devops_cli/ai/gateway.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/ai
    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
    on Nov 13, 2026
  4. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: Searches turned up only the LiteLLM gateway that this project already runs (the data source the fix reads via GET /model/info), and no open tool or library that implements what the issue asks for. The need is internal to the project's own CLI: replacing the dead devops-embedding name in DEFAULT_GATEWAY_ROUTES/MODEL_FAILOVER_PAIRS/CONST_AI_GATEWAY_VIRTUAL_MODELS, making ai gateway status render the live routes, pointing the embedding benchmark dry-run at the gateway /v1/embeddings route, and adding the model-name drift test — none of which an external tool covers.

    Tool: none found

    Lacks:

    • Rendering live gateway model groups in devops ai gateway status from GET /model/info instead of the static DEFAULT_GATEWAY_ROUTES table
    • Replacing devops-embedding with qwen3-embedding:0.6b in the routes, failover pairs, benchmark default and capability constant
    • Making the embedding benchmark dry-run plan the gateway /v1/embeddings route when the provider is gateway
    • A test that every route virtual_model and every CONST_AI_GATEWAY_VIRTUAL_MODELS entry is a model_name in k8s/llm/gateway/config.yaml

    Tools considered:

    Searches run:

    • LiteLLM proxy /model/info endpoint list model groups CLI, results: 5
    • validate model names against LiteLLM config yaml test drift, results: 5
    • litellm proxy model_info endpoint list available models, results: 5
    • devops-cli ai gateway status live routes issue 5304, results: 5
    • openai embeddings API v1/embeddings model name, results: 5
    • litellm, results: 5
    • litellm proxy model_info endpoint returns model groups documentation, results: 5

    Sources:

    Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.

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

    @devops-cli-service
    Contributor

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

  7. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 25, 2026
  8. removed
    status/in-review
    on Nov 25, 2026
  9. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-25 17:09 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/aisource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions