Repository navigation
Description
Problem or Motivation
The tiers ollama-48gib and ollama-64gib load qwen3.8:27b alone (#3567). A client that calls the default Ollama Service ollama-fast straight, past the gateway, can still ask for another model. Ollama then unloads qwen3.8:27b to load it.
Two paths do this today:
devops k8s configure-urlswritesai.ollama_urlswith the default Ollama Service, which is the 48 GiB tier (DEFAULT_OLLAMA_CLUSTER_SERVICE). The defaultai.providerisollama, and the RAG embedding code usesai.ollama_urlswhen no embedding URL is set (src/devops_cli/ai/rag/embeddings.py,_get_ollama_urls). Soqwen3-embedding:0.6bgoes to the 48 GiB tier.- The NetworkPolicy
llm-default-perimeteradmits every pod of thellmnamespace, themonitoringnamespace and Traefik to the Ollama pods, andollama-ingressexposesollama-fast.
Proposed Solution & Architectural Design
Send direct embedding calls to an embedding Service (DEFAULT_OLLAMA_EMBEDDING_CLUSTER_URL) and not to the default Service, or send them through the gateway. Decide with the owner whether the Ollama pods admit the gateway alone. Add a test that fails when a default URL for an embedding call names a tier that loads one chat model.
Target Subsystem
Kubernetes & Minikube Automation
Existing Tool Considered
Kubernetes NetworkPolicy for the admission rule, and the gateway for the embedding route. Nothing is built.
Related: #3567
Proposed design
Problem statement
ollama-48gib and ollama-64gib load qwen3.8:27b alone. A client that calls the default Ollama Service ollama-fast can ask for another model. Ollama then unloads qwen3.8:27b to load it. devops k8s configure-urls writes ai.ollama_urls with ollama-fast. The default ai.provider is ollama, and the RAG embedding code reads ai.ollama_urls. Thus a direct embedding call reaches the 48 GiB tier.
Acceptance criteria
Requirement: Embedding URL setting
The AI configuration SHALL hold an embedding URL setting that defaults to DEFAULT_OLLAMA_EMBEDDING_CLUSTER_URL.
Scenario: Default embedding URL
- WHEN no embedding URL is set in the configuration
- THEN the resolved embedding URL list is
[DEFAULT_OLLAMA_EMBEDDING_CLUSTER_URL].
Requirement: Embedding engine endpoint
The embedding engine MUST send a direct Ollama embedding request to the embedding URL and MUST NOT send it to ai.ollama_urls.
Scenario: Chat URLs set to the default Service
- WHEN
ai.ollama_urlsholdsDEFAULT_OLLAMA_CLUSTER_URLandai.providerisollama - THEN the request goes to
DEFAULT_OLLAMA_EMBEDDING_CLUSTER_URLand no request goes toDEFAULT_OLLAMA_CLUSTER_URL.
Requirement: Configured embedding URL wins
A configured embedding URL SHALL win over the default embedding URL.
Scenario: An operator sets one embedding URL
- WHEN the embedding URL setting holds one URL
- THEN the engine sends every direct embedding request to that URL.
Requirement: Configure URLs writes the embedding URL
devops k8s configure-urls SHALL write DEFAULT_OLLAMA_EMBEDDING_CLUSTER_URL into the embedding URL setting.
Scenario: Configure URLs against a cluster
- WHEN a person runs
devops k8s configure-urlsfor a cluster - THEN the written configuration holds the embedding Service as the embedding URL and keeps the default Ollama Service only as a chat URL.
Requirement: Guard against a one-model tier
A test MUST fail when a default embedding URL names a tier that loads one chat model.
Scenario: The embedding URL names the 48 GiB tier
- WHEN
DEFAULT_OLLAMA_EMBEDDING_CLUSTER_URLis set to the URL of a tier that loads one chat model - THEN the test fails and names that tier.
Existing Tool Considered
No alternatives check has run. Kubernetes NetworkPolicy covers the admission rule, and the LiteLLM gateway covers the embedding route with DEFAULT_OLLAMA_EMBEDDING_CLUSTER_URL. The NetworkPolicy cannot see the model that a request names. The gateway cannot stop a client that calls the Ollama Service directly. The change builds no code beyond one setting, one resolver change and one test.
Key questions
- Which setting does a direct Ollama embedding call read today?:
_get_ollama_urlsreturnsai.ollama_urls, elseai.api_base_url. The providerollamasends the embedding batch to those URLs. The defaultai.ollama_urlsthatdevops k8s configure-urlswrites is the default Ollama Service, which is the 48 GiB tier. [sources: src/devops_cli/ai/rag/embeddings.py:707, src/devops_cli/config/defaults.py:106, src/devops_cli/config/defaults.py:108] - Which Service is the default Ollama Service, and which model does its tier load?:
DEFAULT_OLLAMA_CLUSTER_SERVICEisollama-fast, andDEFAULT_OLLAMA_CLUSTER_URLishttp://ollama-fast.llm.svc.cluster.local:11434. The archived change 3567 records that the default Ollama Service is the 48 GiB tier, and that tier loadsqwen3.8:27balone. [sources: src/devops_cli/config/defaults.py:106, src/devops_cli/config/defaults.py:108, openspec/changes/archive/2026-11-05-3567-one-model-48-64gib-tiers/design.md:10, openspec/changes/archive/2026-11-05-3567-one-model-48-64gib-tiers/proposal.md:18] - Which embedding URL and which gateway route already exist?:
DEFAULT_OLLAMA_EMBEDDING_CLUSTER_URLnames the embedding Service. Thedevops-embeddingroute ofDEFAULT_GATEWAY_ROUTESuses it as its backend URL. The direct path has no such URL. [sources: src/devops_cli/ai/gateway.py:78, src/devops_cli/config/defaults.py, openspec/changes/archive/2026-11-05-3567-one-model-48-64gib-tiers/tasks.md:7] - Where must a direct embedding call go?: A direct embedding call goes to the embedding Service through a dedicated embedding URL setting. The direct path then matches the gateway route that 3567 delivered. (best practice) [sources: openspec/changes/archive/2026-11-05-3567-one-model-48-64gib-tiers/design.md:10, src/devops_cli/ai/gateway.py:78]
- Chosen: Embedding Service through a dedicated URL setting. The archived change 3567 records that the default Ollama Service no longer serves an embedding model. The gateway route already uses
DEFAULT_OLLAMA_EMBEDDING_CLUSTER_URL, so the direct path matches it. - Rejected: Send embedding calls through the gateway only. The gateway needs a URL, a key and a reachable port-forward. The direct Ollama path serves a cluster without the gateway, and change 2524 keeps it.
- Rejected: Keep
ai.ollama_urlsand add only the test. The test would fail on the default configuration, and the defaultollamaprovider would still reach the 48 GiB tier.
- Chosen: Embedding Service through a dedicated URL setting. The archived change 3567 records that the default Ollama Service no longer serves an embedding model. The gateway route already uses
- Which setting holds the embedding URL, and who writes it?: A new setting
ai.embedding_ollama_urlsholds the embedding URLs, and its default is[DEFAULT_OLLAMA_EMBEDDING_CLUSTER_URL].devops k8s configure-urlswrites it with the embedding Service and keepsai.ollama_urlsfor chat. (best practice) [sources: src/devops_cli/commands/k8s/networking.py:501, src/devops_cli/config/defaults.py:106, src/devops_cli/ai/rag/embeddings.py:707]- Chosen: New setting
ai.embedding_ollama_urls. It keeps the chat URLs and the embedding URLs apart, anddevops k8s configure-urlswrites each one to its own Service. The engine reads one list, and an error message shows it. - Rejected: Reuse
ai.ollama_urlsand swap the default Service at read time. A hidden rewrite of a person's setting is hard to see in the configuration file and in an error message. - Rejected: Reuse
ai.api_base_url. That field is the base URL of an OpenAI-compatible endpoint, and the gateway provider reads it.
- Chosen: New setting
- How does the test prove that a default embedding URL does not name a one-model tier?: The test reads the default embedding URL, resolves the tier that serves it, and asserts that the tier does not load exactly one chat model. It extends
tests/ai/benchmark/test_k8s_llm_gateway.py, which already tests both URL constants. (best practice) [sources: tests/ai/benchmark/test_k8s_llm_gateway.py, openspec/changes/archive/2026-11-05-3567-one-model-48-64gib-tiers/design.md:10]- Chosen: Extend
tests/ai/benchmark/test_k8s_llm_gateway.py. The file already testsDEFAULT_OLLAMA_EMBEDDING_CLUSTER_URLand the tier that serves it, and the 3567 design records a tier check there. One guard stays in one file. - Rejected: Add a new test module under
tests/ai/rag/. It duplicates the tier check of the gateway test and splits one guard across two files.
- Chosen: Extend
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 5, 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.A live path unloads the only chat model on the 48 GiB tier, breaking RAG and chat availability.Every direct embedding call can evict qwen3.8:27b, stopping both RAG and chat on that tier.The fix touches URL configuration, NetworkPolicy rules, and adds a guard test across two subsystems.Both concern the 48 GiB tier serving qwen3.8:27b alone; #3567 defines the tier rule, the candidate fixes a URL and NetworkPolicy path that bypasses it.devops-cli-service commentedon Nov 5, 2026
Status set to Ready at ce689f4 (see proposed design in issue body).
Moved to new items: #3583.
devops-cli-service commentedon Nov 7, 2026
Staged: branch
fix/3574-a-direct-embedding-call-must-not, draft pull request #3952. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:
The runs of the planner and the review made 37 model request(s), and used 2153702 input tokens and 37163 output tokens. The tool calls, in order:
read_file({"path":"src/devops_cli/config/defaults.py","start_line":80,"end_line":160})search_code({"text":"DEFAULT_OLLAMA_EMBEDDING_CLUSTER_URL"})search_code({"text":"ollama_urls"})search_code({"text":"get_ollama_urls"})search_code({"text":"\"ai.ollama_urls\""})search_code({"text":"def setting_default"})read_file({"path":"src/devops_cli/config/settings.py","start_line":700,"end_line":800})read_file({"path":"src/devops_cli/config/settings.py","start_line":1330,"end_line":1420})read_file({"end_line":700,"path":"src/devops_cli/config/settings.py","start_line":630})read_file({"end_line":380,"path":"src/devops_cli/commands/k8s/networking.py","start_line":280})read_file({"end_line":640,"path":"src/devops_cli/commands/k8s/networking.py","start_line":430})search_code({"text":"configure-urls"})read_file({"end_line":1230,"path":"src/devops_cli/commands/k8s/stack_lifecycle.py","start_line":1170})file_symbols({"path":"src/devops_cli/commands/k8s/networking.py"})read_file({"path":"tests/ai/benchmark/test_k8s_llm_gateway.py","start_line":1560,"end_line":1700})search_code({"text":"qwen3.8:27b"})search_code({"text":"_serving_tiers"})read_file({"end_line":1560,"path":"tests/ai/benchmark/test_k8s_llm_gateway.py","start_line":1440})read_file({"end_line":1960,"path":"tests/ai/benchmark/test_k8s_llm_gateway.py","start_line":1740})read_file({"end_line":80,"path":"tests/ai/benchmark/test_k8s_llm_gateway.py","start_line":1})list_files({"directory":"k8s/llm/profiles"})read_file({"end_line":140,"path":"tests/ai/benchmark/test_k8s_llm_gateway.py","start_line":78})read_file({"path":"k8s/llm/profiles/services.yaml"})search_code({"text":"def _tiers_of"})search_code({"text":"SINGLE_MODEL_TIERS"})read_file({"end_line":1010,"path":"tests/ai/benchmark/test_k8s_llm_gateway.py","start_line":920})read_file({"end_line":1740,"path":"tests/ai/benchmark/test_k8s_llm_gateway.py","start_line":1700})read_file({"path":"tests/config/test_service_url_defaults.py"})read_file({"path":"src/devops_cli/ai/rag/embeddings.py","start_line":700,"end_line":745})read_file({"end_line":860,"path":"src/devops_cli/config/settings.py","start_line":800})read_file({"end_line":620,"path":"src/devops_cli/config/settings.py","start_line":560})search_code({"text":"tasks.embedding.ollama_urls"})search_code({"text":"TASK_EMBEDDING_OLLAMA_URLS"})search_code({"text":"embedding_ollama_urls"})read_file({"path":"tests/security/test_config_declarations.py"})read_file({"path":"tests/security/test_config_declarations.py","start_line":168,"end_line":330})search_code({"text":"ENV_VARS.md"})search_code({"text":"ci docs"})search_code({"text":"def setting_variables"})search_code({"text":"Variable marker"})list_files({"directory":"tests/ai/rag"})list_files({"directory":"tests/commands/k8s"})search_code({"text":"_get_ollama_urls"})search_code({"text":"SINGLE_MODEL_TIERS"})read_file({"path":"src/devops_cli/ai/rag/embeddings.py","start_line":700,"end_line":740})search_code({"text":"ollama_urls"})search_code({"text":"def _tiers_of"})search_code({"text":"def get_ollama_urls"})search_code({"text":"_NODEPORT_KEYS_LLM"})search_code({"text":"_configure_llm_stack_urls"})search_code({"text":"DEFAULT_OLLAMA_EMBEDDING_CLUSTER_URL"})read_file({"path":"src/devops_cli/config/settings.py","start_line":700,"end_line":790})read_file({"path":"src/devops_cli/commands/k8s/networking.py","start_line":480,"end_line":660})read_file({"path":"src/devops_cli/config/defaults.py","start_line":100,"end_line":125})read_file({"path":"tests/ai/benchmark/test_k8s_llm_gateway.py","start_line":1590,"end_line":1640})read_file({"path":"tests/ai/benchmark/test_k8s_llm_gateway.py","start_line":1700,"end_line":1760})read_file({"path":"src/devops_cli/commands/k8s/networking.py","start_line":430,"end_line":480})search_code({"text":"def _update_ollama_urls"})search_code({"text":"embedding_no_ollama_urls"})file_symbols({"path":"tests/ai/rag/test_embedding_providers.py"})search_code({"text":"ollama_urls: Annotated"})read_spec({"capability":"configured-service-urls"})read_spec({"capability":"ai-gateway-routing"})search_code({"text":"def _resolve_accessible_url"})search_code({"text":"def _detect_service_url"})read_file({"path":"src/devops_cli/commands/k8s/networking.py","start_line":315,"end_line":365})find_issues({"terms":"embedding ollama_urls configure-urls"})list_files({"directory":""})read_file({"path":"src/devops_cli/config/defaults.py","start_line":95,"end_line":130})search_code({"text":"_get_ollama_urls"})search_code({"text":"def get_ollama_urls"})read_file({"path":"src/devops_cli/ai/rag/embeddings.py","start_line":690,"end_line":760})read_file({"path":"src/devops_cli/config/settings.py","start_line":700,"end_line":800})list_files({"directory":"tests/ai/rag"})list_files({"directory":"tests/ai/benchmark"})list_files({"directory":"k8s/llm/profiles"})list_files({"directory":"docs"})Tool calls: file_symbols=2 (empty=0), find_issues=1 (empty=1), list_files=8 (empty=0), read_file=32 (empty=0), read_spec=2 (empty=0), search_code=32 (empty=1)
The stage job read the open pull requests and their files in 1 GraphQL request(s).
5 remaining items
docs(openspec): mark verification commands in plan for #3574
docs(openspec): cite target test in group 3 of plan for #3574
docs(openspec): plan #3574 Send embedding calls to the embedding Serv…
fix(k8s): Send direct embedding calls to the embedding Service
fix(k8s): Send direct embedding calls to the embedding Service
devops-cli-service commentedon Nov 18, 2026
Released in v0.177.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.177.0
devops-cli-service commentedon Nov 18, 2026
Live since 2026-11-18 16:28 UTC