Repository navigation
Description
Problem
On 2026-11-09 the owner decided that the spend reports value local AI tokens at the hosted prices of qwen3.8:27b (chat; OpenRouter quote 0.035 USD input and 1.50 USD output per million tokens) and qwen/qwen3-embedding-8b (embeddings; 0.01 USD per million tokens).
The live ConfigMap devops-cli-config holds ai.reference_model: qwen3.8:27b and ai.reference_embedding_model: qwen/qwen3-embedding-8b, applied by hand. The template k8s/devops/configmap.example.yaml does not name them. devops k8s deploy-stack renders the template, so the next deploy removes the two lines. The Service then values local tokens at the defaults gpt-4o and text-embedding-3-small again. The Service ledger showed 2,361 USD hosted equivalent at gpt-4o against about 60 USD at qwen3.8:27b.
Evidence (2026-11-09): render_active_devops_configmap against the live ConfigMap differs in three keys only: ai.reference_model, ai.reference_embedding_model (live only; this issue) and ai.tasks.stage (live only; a deliberate pause that the lead removes after #4228 merges).
Expected
- The template names both reference models with a comment: the owner decision of 2026-11-09, the two prices, and why (genai-prices does not know both names, so the Service keeps the prices in an override).
- The key-walk test of fix(k8s): check that the example ConfigMap keys are settings #4093 and the template tests still pass.
- Where the price comes from is a separate point. Today the price is the file
pricing_overrides.jsonin/home/devops/.data/ai/on the PVCroadmap-service-home, written by hand withdevops ai cost set-pricein the pod. genai-prices (0.1.13) returnsLookupErrorfor both names, so without the file the reports show no savings and log an unpriced warning. A new PVC loses the file. The repository-owned price needs new code (a setting that holds the price, read byPricingRegistry); it is split to a second issue and not built here.
Acceptance criteria
grep -c 'reference_model: qwen3.8:27b' k8s/devops/configmap.example.yamlprints 1 (prints 0 today).grep -c 'reference_embedding_model: qwen/qwen3-embedding-8b' k8s/devops/configmap.example.yamlprints 1 (prints 0 today).uv run devops ci test tests/k8s/test_k8s_configmap.pypasses with a new test that renders the template and expects both values underai(fails today).uv run devops ci test tests/k8s/test_k8s_configmap_keys.pypasses.
Existing tool considered
The settings ai.reference_model and ai.reference_embedding_model already exist (src/devops_cli/config/settings.py), and so does devops ai cost set-price. No new tool is needed for the template. For the price source: devops ai cost update-pricing --source <file> also writes to the data volume (pricing_snapshot.json), so it does not remove the hand step.
Cost
About 40,000 tokens to build and review; a few minutes of CI under the shared lock. Keeping it costs nothing. The price of not doing it: wrong Service spend reports after the next deploy.
Related
Proposed design
Problem statement
The live ConfigMap names the reference models qwen3.8:27b and qwen/qwen3-embedding-8b, applied by hand. The template k8s/devops/configmap.example.yaml does not name them. The next devops k8s deploy-stack removes both keys, and the Service then values local tokens at the defaults gpt-4o and text-embedding-3-small. The spend reports then show wrong savings (2,361 USD against about 60 USD).
Acceptance criteria
Requirement: Template names the chat reference model
The template k8s/devops/configmap.example.yaml MUST set ai.reference_model to qwen3.8:27b, once.
Scenario: Chat reference model in the template
- WHEN The test renders the template with render_active_devops_configmap and reads the ai section
- THEN ai.reference_model equals qwen3.8:27b, and the file holds exactly one line with 'reference_model: qwen3.8:27b'
Requirement: Template names the embedding reference model
The template k8s/devops/configmap.example.yaml MUST set ai.reference_embedding_model to qwen/qwen3-embedding-8b, once.
Scenario: Embedding reference model in the template
- WHEN The test renders the template with render_active_devops_configmap and reads the ai section
- THEN ai.reference_embedding_model equals qwen/qwen3-embedding-8b, and the file holds exactly one line with 'reference_embedding_model: qwen/qwen3-embedding-8b'
Requirement: Template comment states the decision
The template SHALL carry a comment that names the owner decision of 2026-11-09, the two prices, and the reason that the Service keeps the prices in an override.
Scenario: Comment above the two keys
- WHEN A reader opens the template at the two reference model keys
- THEN The comment names the decision date, 0.035 and 1.50 USD per million tokens for chat, 0.01 USD per million tokens for embeddings, and that genai-prices does not know both names
Requirement: Key walk and template tests stay green
The change MUST keep tests/k8s/test_k8s_configmap_keys.py and tests/k8s/test_k8s_configmap.py passing.
Scenario: Both test files run
- WHEN uv run devops ci test runs the two test files
- THEN Both files pass, and unknown_setting_keys of the rendered template returns an empty list
Existing Tool Considered
No new tool is needed. The settings ai.reference_model and ai.reference_embedding_model already exist in src/devops_cli/config/settings.py, and so does devops ai cost set-price. devops ai cost update-pricing --source <file> also writes to the data volume, so it does not remove the hand step for the price. This change adds two keys and one test and builds no code. The cost is about 40,000 tokens to build and review, plus a few minutes of CI. Keeping it costs nothing.
Key questions
- Do the two keys already exist as settings, so that the key-walk test accepts them?: Yes. AIConfig declares reference_model and reference_embedding_model, so unknown_setting_keys reports nothing for them and the template needs no code change. [sources: src/devops_cli/config/settings.py, tests/k8s/test_k8s_configmap_keys.py]
- Does the render keep the ai section of the template as it is?: Yes. render_active_devops_configmap changes only the service block, so the two keys in the ai section reach the rendered ConfigMap. [sources: src/devops_cli/k8s/configmap.py, tests/k8s/test_k8s_configmap.py]
- Where do the keys and the comment go in the template, and how does the comment avoid a second grep match?: Put both keys in the ai block, after max_retries and before tasks, with one comment block above them. Write the comment so that no comment line holds the strings 'reference_model: qwen3.8:27b' or 'reference_embedding_model: qwen/qwen3-embedding-8b'. Then each grep -c prints 1. (best practice) [sources: k8s/devops/configmap.example.yaml]
- Chosen: Keys in the ai block with a comment that does not repeat the key text. It keeps each grep count at 1 and follows the style of the other comments in the template.
- Rejected: A new top-level section for the reference models. The settings live under ai, so a new section would be an unknown key.
- How does the new test check the values?: Add one test in tests/k8s/test_k8s_configmap.py. It renders the repository template with render_active_devops_configmap and k8s_dir=REPO_ROOT / 'k8s', validates the inner config with Settings.model_validate, and compares ai.reference_model and ai.reference_embedding_model with the two names. (best practice) [sources: tests/k8s/test_k8s_configmap.py]
- Chosen: Render the repository template and validate with Settings. It follows the existing tests of the repository template and fails today.
- Rejected: A text match on the template file. It does not check that the key sits under ai and loads into Settings.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 9, 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.(k8s)scope of the title gives the scope.The next deploy silently reverts the reference models and produces wrong spend reports, but the Service keeps running.Corrects the financial basis of spend reports after each deploy without breaking the Service.Add two YAML keys with a comment and one render test; no new code path.Both add a hand-set ConfigMap key to configmap.example.yaml so deploy-stack does not remove it, but #4208 names the analysis model while this names the reference models.devops-cli-service commentedon Nov 9, 2026
Status set to Ready at f9e47b7 (see proposed design in issue body).
Moved to new items: #4244.
devops-cli-service commentedon Nov 9, 2026
Released in v0.102.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.102.0
devops-cli-service commentedon Nov 9, 2026
Live since 2026-11-09 17:57 UTC