Repository navigation
Description
Update 2026-11-26 (infra move): The gateway config is in dan-petty/homelab now.
This item keeps the product part: devops ai gateway render sets model_info.id on each embedding deployment, with its test, and the panel query of k8s/devops/dashboards/ai-spend.json names each such bar by model_id. The new render of the tracked config is the homelab follow-up, after the release.
Follow-up: dan-petty/homelab#304.
Problem
The panel "Local savings by backend server: USD per hour" of k8s/devops/dashboards/ai-spend.json shows one bar for each Kubernetes service of an in-cluster Ollama (#5914). It takes the service name from the api_base that litellm_deployment_total_requests_total gives each deployment (model_id).
LiteLLM gives the two embedding deployments of k8s/llm/gateway/config.yaml (dan-petty/homelab) (ollama-24gib-embed-gpu0 and ollama-24gib-embed-gpu1) no api_base on any of its series. Live Prometheus on 2026-11-16 shows this for all 27 litellm_ series names of the two model_ids. So the panel names both by their model, qwen3-embedding:0.6b, in one bar. The owner requirement of 2026-11-16 asks for one series for each embedding backend.
Expected behavior
The panel shows one bar for ollama-24gib-embed-gpu0 and one for ollama-24gib-embed-gpu1.
Possible ways
- Give each deployment of the gateway config a fixed
model_info.idthat names its service, somodel_idnames the backend. The render ofdevops ai gateway renderwrites the embedding deployments. - Find why LiteLLM sets no
api_basefor an Ollama embedding call, and fix it upstream.
Source: #5931
Alternatives check of 2026-11-24: in-use.
The repository already uses this tool.
Tool: BerriAI/litellm (https://github.com/BerriAI/litellm), NOASSERTION, last activity 2026-11-24, maintained.
Reason: Searches found no alternative tool; the gateway the project already runs, LiteLLM, labels each deployment with a model_id taken from model_info.id, so a fixed per-deployment id gives each embedding backend its own bar.
Covers:
- Per-deployment model_id label on its request metrics
- model_info.id sets the deployment name in the config
- Lets the panel keep grouping by model_id alone
Lacks:
- No api_base label on Ollama embedding series
- No Kubernetes service label on the metric
- Does not write the rendered gateway config itself
Proposed design
Problem statement
The panel "Local savings by backend server: USD per hour" shows one bar for both Ollama embedding deployments. LiteLLM sets no api_base on their series, so the panel names both bars by the model qwen3-embedding:0.6b. This item sets a fixed model_info.id on each embedding deployment in devops ai gateway render, with its test. It also makes the panel name each embedding bar by model_id. The tracked config lives in dan-petty/homelab, so its re-render stays with dan-petty/homelab#304 after the release.
Acceptance criteria
Requirement: Embedding deployment id
The gateway render SHALL set model_info.id to the service name on each Ollama embedding deployment.
Scenario: Render names each embedding deployment
- WHEN
uv run pytest tests/ai/test_ai_gateway_render.py -k embedding_model_info_idruns - THEN The test passes and each rendered embedding deployment has a
model_info.idequal to the service name of itsapi_basehost.
Requirement: Panel bar name
The local savings by backend server panel SHALL name each bar by the service name from api_base when the series has one, and by model_id when it does not.
Scenario: Panel query falls back to model id
- WHEN
uv run devops ci --check --only k8sruns - THEN The k8s check passes with the panel query of
k8s/devops/dashboards/ai-spend.jsonlabelling each bar fromapi_base, else frommodel_id.
Existing Tool Considered
BerriAI/litellm, verdict in-use (alternatives check of 2026-11-24 in the issue body). The block records what LiteLLM covers and lacks: it sets model_id from model_info.id, but sets no api_base on Ollama embedding series and carries no Kubernetes service label. The render writes the model_info.id that LiteLLM does not write. The panel takes the bar name from model_id when api_base is empty, so the missing labels do not matter.
Key questions
- Which label names each local savings bar?: Use the
api_basehost when the series has one, andmodel_idwhen it does not. (best practice) [sources: k8s/devops/dashboards/ai-spend.json, src/devops_cli/ai/pool_load.py]- Chosen:
model_idwith anapi_basefallback. LiteLLM keepsmodel_idon the embedding token and request series and sets noapi_basethere. - Rejected:
api_baseonly. The embedding series have noapi_base, so both deployments merge in one bar. - Rejected:
litellm_model_name. Both embedding deployments share the model name, so their bars merge again.
- Chosen:
- Which value does the render put in
model_info.id?: The Kubernetes service name of the deployment, taken from the host of itsapi_base. (best practice) [sources: src/devops_cli/ai/gateway_render.py, tests/ai/test_ai_gateway_render.py, tests/fixtures/k8s_environment/llm/gateway/config.yaml]- Chosen: Service name from the
api_basehost. The panel already takes the service name from that host, so each embedding deployment gets its own bar. - Rejected: The model name. Both embedding deployments share the model name, so the bars merge again.
- Rejected: A hand-written id per deployment. The render derives the id from the config, so there is no second list to keep.
- Chosen: Service name from the
- Does
devops ai gateway renderwrite the embedding deployments?: Yes. The command renders the gateway config, and the render writes the embedding deployments with the chat deployments. [sources: src/devops_cli/ai/gateway_render.py, src/devops_cli/commands/ai_gateway.py, tests/ai/test_ai_gateway_render.py] - Which part of this item does the product repository deliver?: The render code with its test, and the panel query. The tracked config
k8s/llm/gateway/config.yamlis in dan-petty/homelab, so its re-render stays withdan-petty/homelab#304after the release. (best practice) [sources: k8s/devops/dashboards/ai-spend.json, src/devops_cli/ai/gateway_render.py, tests/fixtures/k8s_environment/llm/gateway/config.yaml]- Chosen: Product render and panel only. The tracked config is not in this repository, and homelab#304 tracks its re-render.
- Rejected: Also change the tracked config here. The file is in dan-petty/homelab, so this repository cannot change it.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 16, 2026
Both fix backend naming in the ai-spend savings panels, but #5546 fixes empty backend for hosted models while this fixes collapsed local embedding backends.devops-cli-service commentedon Nov 17, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (10)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 18, 2026
Status set to Ready at 97bb46c (see proposed design in issue body).
devops-cli-service commentedon Nov 27, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 29, 2026
Released in v0.247.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.247.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:17 UTC