Repository navigation
Description
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
- Run
uv run devops ai gateway status. - Run
uv run devops ai gateway routes --format json. - 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 fromGET /model/infowhen the gateway answers, asroutesdoes. Pass the API key (get_ai_api_key(settings)). UseDEFAULT_GATEWAY_ROUTESonly 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-embeddingwithqwen3-embedding:0.6bin the routes and the failover pairs (src/devops_cli/ai/gateway.py:50-91), the benchmark default (src/devops_cli/commands/benchmark.py:247) andsrc/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_modeland eachCONST_AI_GATEWAY_VIRTUAL_MODELSentry is amodel_nameink8s/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:33and the configured-service-urls spec. - Fix the stale test path in the comment at
gateway.py:51-54. The test istests/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 statusshows the groups fromGET /model/infowhen the gateway answers. Rows fromDEFAULT_GATEWAY_ROUTESshow only when the gateway does not answer, and they are marked as not checked. -
git grep -n devops-embedding -- src testsfinds no line. - A test fails when a route
virtual_modelor aCONST_AI_GATEWAY_VIRTUAL_MODELSentry is not amodel_nameink8s/llm/gateway/config.yaml. -
devops ai benchmark --type embedding --dry-runwith the providergatewayplansqwen3-embedding:0.6bon/v1/embeddings. -
uv run devops ci fail-to-pass --base origin/mainshows 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/inforesponse with bothdevops-chatdeployments andqwen3-embedding:0.6b, and a recorded failover. - THEN The test asserts that the output lists both
devops-chatdeployments,qwen3-embedding:0.6b, and the failover record, and does not listdevops-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/inforequest 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/infofail 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 testsruns. - THEN The command exits with no matches, and a source test asserts that
qwen3-embedding:0.6bappears 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_modelis 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-runwith the providergateway. - THEN The test asserts that the plan names
qwen3-embedding:0.6band the gateway/v1/embeddingsroute, and no Ollama/api/embeddingsroute.
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.6bwith nodevops-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_ROUTESinsrc/devops_cli/ai/gateway.py. - THEN The test asserts that the comment names
tests/ai/benchmark/test_k8s_llm_gateway.pyand 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/mainruns 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.6bis the model group that the gateway config serves. [sources: k8s/llm/gateway/config.yaml] - How should
devops ai gateway statusshow routes when the gateway answers or does not answer?: Use the liveGET /model/infogroups when the gateway answers. UseDEFAULT_GATEWAY_ROUTESonly 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.yamland compares itsmodel_namevalues with each routevirtual_modeland eachCONST_AI_GATEWAY_VIRTUAL_MODELSentry. (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?: PlanPOST /v1/embeddingson the gateway with modelqwen3-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/embeddingsroute. 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.
- Rejected: Keep the Ollama
- 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]
- Rejected: Remove the failover record. The record shows the failover state that feat(ai): devops ai gateway status reports failover while a route is failover:*, and failover --reset restores the default routes #1986 added.
- Chosen: Keep the failover record. It preserves the existing operator view and does not conflict with live routes.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
Both touch ai gateway status and routes in the same files, but #5236 changes command naming conventions while this candidate replaces a dead model name and fixes status to show live routes.devops-cli-service commentedon Nov 16, 2026
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 deaddevops-embeddingname inDEFAULT_GATEWAY_ROUTES/MODEL_FAILOVER_PAIRS/CONST_AI_GATEWAY_VIRTUAL_MODELS, makingai gateway statusrender the live routes, pointing the embedding benchmark dry-run at the gateway/v1/embeddingsroute, and adding the model-name drift test — none of which an external tool covers.Tool: none found
Lacks:
devops ai gateway statusfromGET /model/infoinstead of the staticDEFAULT_GATEWAY_ROUTEStabledevops-embeddingwithqwen3-embedding:0.6bin the routes, failover pairs, benchmark default and capability constant/v1/embeddingsroute when the provider isgatewayvirtual_modeland everyCONST_AI_GATEWAY_VIRTUAL_MODELSentry is amodel_nameink8s/llm/gateway/config.yamlTools considered:
Searches run:
Sources:
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at e6f5718 (see proposed design in issue body).
devops-cli-service commentedon Nov 25, 2026
Released in v0.219.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.219.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 17:09 UTC