LearnNewsExamplesServices
Frontmatter
id13852
titlefix(ai): orchestrator has no Ollama serving lifecycle — no `ollama serve` ensure + no `num_ctx` preload (native-Ollama hits #13851''s context-starvation with zero handling)
stateClosed
labels
bugaiarchitecture
assigneesneo-gpt, neo-opus-grace
createdAtJun 22, 2026, 5:28 AM
updatedAt3:20 PM
githubUrlhttps://github.com/neomjs/neo/issues/13852
authorneo-opus-grace
commentsCount6
parentIssue13624
subIssues
13862 Cap local-model Ollama serving envelope in compose
13865 Native Ollama readiness enforces loaded context
13867 Supervise native Ollama serve lifecycle in Orchestrator
subIssuesCompleted3
subIssuesTotal3
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJun 24, 2026, 6:22 PM

fix(ai): orchestrator has no Ollama serving lifecycle — no ollama serve ensure + no num_ctx preload (native-Ollama hits #13851's context-starvation with zero handling)

Closed v13.1.0/archive-v13-1-0-chunk-5 bugaiarchitecture
neo-opus-grace
neo-opus-grace commented on Jun 22, 2026, 5:28 AM

Context (sibling of #13851)

#13851 found the no-digestion / golden-path-starvation root: the extraction model loaded at the wrong context window. For LM Studio (openAiCompatible) the orchestrator already HAS the serving lifecycle — an lms server start task (orchestrator.lms.enabled = leaf(true)) + loadLmsModel(--context-length, --parallel) fed by buildLmsPreloadConfig — so #13851 is "enforce the already-correct config."

For native Ollama there is no equivalent lifecycle at all:

  • buildLmsPreloadConfig (providerReadinessHelper.mjs:297) is LM-Studio-only — it explicitly excludes Ollama-routed roles ("never infer activity from non-null model leaves… only includes roles whose selector targets the OpenAI-compatible surface that LM Studio serves").
  • No ollama serve ensure task in taskDefinitions.mjs (the supervised set is dev-server / neural-link bridge / mlx / lms / Chroma / embed).
  • No model preload with num_ctx = contextLimitTokens, no keep_alive residency, no parallel/KV budget.

So if modelProvider / graphProvider / embeddingProvider route to native ollama, the orchestrator does not start the Ollama server, does not preload the model at the configured context, and does not enforce it — Ollama hits the same context-default starvation as #13851 (Ollama default num_ctx ≈ 2048-4096) with zero orchestrator handling. The config already carries Ollama settings (ollama.keep_alive = -1, ollama.requireParallelModels = 2, ai/config.mjs:167-168) — they're just not consumed by any serving lifecycle.

The Fix (Ollama parity with the LM Studio lifecycle)

  1. Orchestrator task that ensures ollama serve is running when a role routes to native ollama (gated on an orchestrator.ollama.enabled flag mirroring orchestrator.lms.enabled).
  2. A preload ensuring the configured model is available + loaded with num_ctx = contextLimitTokens (the Ollama equivalent of lms load --context-length) + keep_alive resident.
  3. The same #13851-style readiness enforcement: verify the loaded num_ctx ≥ configured (+ a sane parallel/KV budget), reload if wrong — not merely "is the server up."

Acceptance Criteria

  • Orchestrator ensures ollama serve (when a role targets native ollama), gated on an enable flag.
  • Model preloaded with num_ctx = contextLimitTokens + keep_alive resident.
  • Readiness verifies the loaded num_ctx ≥ configured; reloads if insufficient (parity with #13851).
  • A buildOllamaPreloadConfig (or a unified provider-preload abstraction) consuming the role selectors, mirroring buildLmsPreloadConfig.
  • Live evidence: with the provider set to native ollama, a heavy session digests (non-null tri-vector) after orchestrator boot.

Out of Scope

  • The LM Studio enforcement (#13851). The choke/extraction internals (#12439).

Related

  • Sibling of #13851 (LM Studio enforcement). Parent: #13624 (orchestrator). Root: #13750 (golden-path PRIO-zero).

Origin Session ID: e96a0867-4c28-4877-b2f4-f56173ee9fd1

tobiu
tobiu Jun 24, 2026, 6:22 PM

not code ready for an epic in disguise with 3 resolved subs. disagreed. resolved.

  • 2026-07-02T01:31:37Z @neo-opus-grace cross-referenced by #14418