Context
Release classification: boardless production-hardening leaf under #13852; this does not replace the native-Ollama lifecycle work.
Operator cloud-health evidence showed the opt-in local Ollama provider can make the deployment container unhealthy under the current local-model serving envelope. The live code check found ai/deploy/docker-compose.yml sets OLLAMA_CONTEXT_LENGTH=${NEO_LOCAL_MODEL_CONTEXT_LENGTH:-262144} and OLLAMA_KEEP_ALIVE=${NEO_LOCAL_MODEL_KEEP_ALIVE:--1}, but does not expose the matching Ollama serving caps for request parallelism or loaded-model count.
Live latest-open sweep: checked latest 20 open issues at 2026-06-22T12:03:50Z; no equivalent leaf found. Closest related tickets were #13852 (broad native-Ollama lifecycle), #13854 (chat-model parity), and #13853 (MoE/provider JSON schema). A2A in-flight sweep over the latest 30 messages found only this agent's [lane-claim][#13852] cloud local-model Ollama resource caps in compose; no competing peer claim. KB ticket query for OLLAMA_NUM_PARALLEL OLLAMA_MAX_LOADED_MODELS NEO_LOCAL_MODEL_CONTEXT_LENGTH local-model compose returned #13854/#13852/#13853 but no existing compose-cap leaf.
The Problem
The compose profile documents and launches a very large context window without making the serving resource knobs explicit. Upstream Ollama exposes OLLAMA_NUM_PARALLEL, OLLAMA_CONTEXT_LENGTH, and OLLAMA_MAX_LOADED_MODELS; its FAQ documents that parallel request handling multiplies context/RAM requirements, and its env config source defines those environment keys.
That means the local-model profile can look structurally complete while the resource envelope stays implicit. In cloud deployments, implicit serving defaults are not an acceptable contract: the deployment file, operator cookbook, and compose unit test need to encode the cap intentionally.
The Architectural Reality
ai/deploy/docker-compose.yml owns the opt-in local-model service profile and is the runnable cloud/local-provider substrate.
learn/agentos/DeploymentCookbook.md is the operator-facing deployment contract for starting and tuning the local-model profile.
test/playwright/unit/ai/scripts/diagnostics/mcpHealthcheck.spec.mjs already reads the production compose file and asserts the local-model profile contract.
- This is distinct from the parent #13852 lifecycle work: it does not add
ollama serve supervision, model preload, or loaded num_ctx verification inside the orchestrator.
The Fix
- Add explicit local-model compose environment defaults:
OLLAMA_NUM_PARALLEL=${NEO_LOCAL_MODEL_NUM_PARALLEL:-1}
OLLAMA_MAX_LOADED_MODELS=${NEO_LOCAL_MODEL_MAX_LOADED_MODELS:-2}
- Mirror those knobs in
DeploymentCookbook.md startup examples and environment inventory.
- Extend the existing compose unit test so the deployment contract cannot silently drop the caps.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
local-model compose env |
Ollama FAQ + envconfig/config.go; ai/deploy/docker-compose.yml |
Expose OLLAMA_NUM_PARALLEL and OLLAMA_MAX_LOADED_MODELS through NEO_LOCAL_MODEL_* vars |
Operator can tune the NEO_LOCAL_MODEL_* overrides per deployment |
learn/agentos/DeploymentCookbook.md |
Focused unit reads compose YAML and asserts env entries |
| Operator resource tuning docs |
DeploymentCookbook.md local-model profile |
Resource-pressure guidance names parallelism, context, loaded-model cap, memory, CPU, and model choice |
Operator tunes down before treating Agent OS services as faulty |
Same file |
Markdown diff + compose unit coverage |
Decision Record impact
none. This is deployment-env parity and cookbook/test coverage; it does not change the cloud topology or accepted ADR authority.
Acceptance Criteria
Out of Scope
- Starting or supervising native
ollama serve from the orchestrator.
- Preloading models with
num_ctx or verifying the loaded context window.
- Changing chat-model selection or provider JSON-schema behavior from #13853/#13854.
Avoided Traps
- Do not close #13852 from this patch. The parent ticket's lifecycle/readiness ACs remain broader than compose env parity.
- Do not add a filesystem or orchestration fallback for unhealthy deployments here. This leaf only makes the runnable provider envelope explicit and test-covered.
Related
Parent: #13852
Related: #13853, #13854
Retrieval Hint: OLLAMA_NUM_PARALLEL OLLAMA_MAX_LOADED_MODELS NEO_LOCAL_MODEL_CONTEXT_LENGTH local-model compose cloud-health
Context
Release classification: boardless production-hardening leaf under #13852; this does not replace the native-Ollama lifecycle work.
Operator cloud-health evidence showed the opt-in local Ollama provider can make the deployment container unhealthy under the current local-model serving envelope. The live code check found
ai/deploy/docker-compose.ymlsetsOLLAMA_CONTEXT_LENGTH=${NEO_LOCAL_MODEL_CONTEXT_LENGTH:-262144}andOLLAMA_KEEP_ALIVE=${NEO_LOCAL_MODEL_KEEP_ALIVE:--1}, but does not expose the matching Ollama serving caps for request parallelism or loaded-model count.Live latest-open sweep: checked latest 20 open issues at 2026-06-22T12:03:50Z; no equivalent leaf found. Closest related tickets were #13852 (broad native-Ollama lifecycle), #13854 (chat-model parity), and #13853 (MoE/provider JSON schema). A2A in-flight sweep over the latest 30 messages found only this agent's
[lane-claim][#13852] cloud local-model Ollama resource caps in compose; no competing peer claim. KB ticket query forOLLAMA_NUM_PARALLEL OLLAMA_MAX_LOADED_MODELS NEO_LOCAL_MODEL_CONTEXT_LENGTH local-model composereturned #13854/#13852/#13853 but no existing compose-cap leaf.The Problem
The compose profile documents and launches a very large context window without making the serving resource knobs explicit. Upstream Ollama exposes
OLLAMA_NUM_PARALLEL,OLLAMA_CONTEXT_LENGTH, andOLLAMA_MAX_LOADED_MODELS; its FAQ documents that parallel request handling multiplies context/RAM requirements, and its env config source defines those environment keys.That means the local-model profile can look structurally complete while the resource envelope stays implicit. In cloud deployments, implicit serving defaults are not an acceptable contract: the deployment file, operator cookbook, and compose unit test need to encode the cap intentionally.
The Architectural Reality
ai/deploy/docker-compose.ymlowns the opt-inlocal-modelservice profile and is the runnable cloud/local-provider substrate.learn/agentos/DeploymentCookbook.mdis the operator-facing deployment contract for starting and tuning the local-model profile.test/playwright/unit/ai/scripts/diagnostics/mcpHealthcheck.spec.mjsalready reads the production compose file and asserts the local-model profile contract.ollama servesupervision, model preload, or loadednum_ctxverification inside the orchestrator.The Fix
OLLAMA_NUM_PARALLEL=${NEO_LOCAL_MODEL_NUM_PARALLEL:-1}OLLAMA_MAX_LOADED_MODELS=${NEO_LOCAL_MODEL_MAX_LOADED_MODELS:-2}DeploymentCookbook.mdstartup examples and environment inventory.Contract Ledger Matrix
local-modelcompose envenvconfig/config.go;ai/deploy/docker-compose.ymlOLLAMA_NUM_PARALLELandOLLAMA_MAX_LOADED_MODELSthroughNEO_LOCAL_MODEL_*varsNEO_LOCAL_MODEL_*overrides per deploymentlearn/agentos/DeploymentCookbook.mdDeploymentCookbook.mdlocal-model profileDecision Record impact
none. This is deployment-env parity and cookbook/test coverage; it does not change the cloud topology or accepted ADR authority.
Acceptance Criteria
local-modelservice exportsOLLAMA_NUM_PARALLELviaNEO_LOCAL_MODEL_NUM_PARALLELwith default1.local-modelservice exportsOLLAMA_MAX_LOADED_MODELSviaNEO_LOCAL_MODEL_MAX_LOADED_MODELSwith default2.Out of Scope
ollama servefrom the orchestrator.num_ctxor verifying the loaded context window.Avoided Traps
Related
Parent: #13852 Related: #13853, #13854
Retrieval Hint:
OLLAMA_NUM_PARALLEL OLLAMA_MAX_LOADED_MODELS NEO_LOCAL_MODEL_CONTEXT_LENGTH local-model compose cloud-health