Repository navigation
Description
Problem Description
A gateway call that a local group answers counts as hosted when the reply names a model that is not in CONST_AI_GATEWAY_VIRTUAL_MODELS and not an ollama: model. After #4523, is_local makes a gateway call with no backend local only for these names. Two real paths give another name:
- A local fallback.
k8s/llm/gateway/config.yamlsendsdevops-coderanddevops-reasoningtodevops-chatwhen their backend is not available. After a fallback, LiteLLM v1.103.10 keeps the model that answered in the reply:_override_openai_response_model(litellm/proxy/common_request_processing.py) returns early whenx-litellm-attempted-fallbacksis above 0. For an Ollama deployment, that model isollama_chat/qwen3.8:27bin a reply that is not streamed (litellm/llms/ollama/chat/transformation.py) and the bare Ollama model in a streamed chunk. - A local group outside the constant. The gateway config has the local groups
devops-review,devops-background,devops-triage,qwen3.8:27bandqwen3-embedding:0.6b.CONST_AI_GATEWAY_VIRTUAL_MODELSnames onlydevops-chat,devops-coder,devops-reasoninganddevops-embedding. Abuild_agentrun onqwen3.8:27b(the defaultai.model) under providergatewaygets a reply that namesqwen3.8:27b, and the hook sends it asserved_model.
In both paths the record gets local="false" on devops_cli_ai_tokens_total, the pricing source unknown at 0 USD, and the warning for an unpriced hosted model. The AI spend dashboard leaves the tokens out of the local savings.
Reproduction Steps
- In a checkout of
mainwith fix(ai): an agent run on a local group counts as hosted #4523, run:
uv run python -c 'from devops_cli.ai.spend.pricing import is_local; print([is_local(server="llm.example.com:4000", provider="gateway", served_model=m) for m in ("ollama_chat/qwen3.8:27b", "qwen3.8:27b", "devops-review")])' - The output is
[False, False, False]. Withserved_model="devops-chat", the output isTrue.
Expected vs Actual Behavior
- Expected: a gateway call that a local group of the gateway config answers is local, with the pricing source
local, 0 USD and no warning. A hosted group and an unknown deployment model stay hosted (fix(ai): a hosted gateway call is recorded as a local call at $0 #3656). - Actual: the call is hosted at 0 USD with the pricing source
unknownand a warning.
Environment Diagnostics
main with #4523. LiteLLM image ghcr.io/berriai/litellm:v1.103.10. The set of local groups lives in k8s/llm/gateway/config.yaml, and the client knows only CONST_AI_GATEWAY_VIRTUAL_MODELS. A fix can name every local group in one constant and add a test that compares it with the gateway config, as tests/ai/spend/test_hosted_group_prices.py does for the hosted groups.
Logs, Traces, or Terminal Output
PromQL, 30 days: sum by (asked, answered) (increase(devops_cli_ai_model_answers_total{asked!~"deepseek.*|claude.*"}[30d])) returned no data on 2026-11-11 (#4523). So no live series shows the defect now.
Pre-Submission Checklist
- I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
- I have checked existing issues and pull requests to ensure this is not a duplicate. Related: fix(ai): a hosted gateway call is recorded as a local call at $0 #3656, fix(roadmap): send tool choice auto to Claude and count answers #4216, fix(ai): an agent run on a local group counts as hosted #4523.
Source: #4523
Activity
dan-petty commentedon Nov 12, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(ai)scope of the title gives the scope.The spend dashboard reports wrong local savings, but no call fails and no data is lost.Users see incorrect local savings and unpriced-hosted warnings for local groups, which erodes trust in the dashboard.The fix names the missing local groups in one constant and adds a comparison test, as the body describes.Both fix is_local() gateway group classification, but #3656 corrected hosted calls recorded as local while this corrects local calls recorded as hosted.fix(ai): the gateway group that answered decides the local label (#4907)
dan-petty commentedon Nov 13, 2026
New evidence (2026-11-13, read-only investigation of the LiteLLM gateway):
genai-prices and the price overrides hold no price for model qwen3.8:27b under provider litellm. Its requests are recorded at $0 with the pricing source unknown.(1 line in 7 days).devops-review,devops-background,devops-triage,qwen3.8:27bandqwen3-embedding:0.6b, butCONST_AI_GATEWAY_VIRTUAL_MODELS(src/devops_cli/config/constants.py:2823-2828) does not hold them. It holdsdevops-embedding, which the gateway does not serve.src/devops_cli/config/settings.py:1196-1208) also reads the constant, so it refuses real local groups._is_local_tier(src/devops_cli/ai/spend/pricing.py:203-206) reads it too.model_nameentries ink8s/llm/gateway/config.yaml. fix(ai): replace devops-embedding, which the gateway does not serve #5304 needs the same test for the gateway routes, so one test can cover both.docs(openspec): plan #4886 name the local gateway groups
docs(openspec): archive #4886 name the local gateway groups
devops-cli-service commentedon Nov 14, 2026
Released in v0.138.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.138.0
devops-cli-service commentedon Nov 14, 2026
Live since 2026-11-14 15:02 UTC