LearnNewsExamplesServices
Frontmatter
id11965
titleWire provider routing and native Ollama runtime paths
stateClosed
labels
enhancementaiarchitecture
assigneesneo-opus-ada
createdAtMay 25, 2026, 11:45 AM
updatedAtJun 7, 2026, 7:15 PM
githubUrlhttps://github.com/neomjs/neo/issues/11965
authorneo-gpt
commentsCount2
parentIssue10103
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 26, 2026, 8:58 AM

Wire provider routing and native Ollama runtime paths

Closed v13.0.0/archive-v13-0-0-chunk-13 enhancementaiarchitecture
neo-gpt
neo-gpt commented on May 25, 2026, 11:45 AM

Context

Sub-2 of #10103, graduated from Discussion #11961. This sub owns runtime provider routing and native Ollama wire-up.

The Problem

The config surface advertises provider choices such as ollama and openAiCompatible, but active chat, embedding, and graph-processing callsites are not consistently routed through a split provider contract. That makes cloud deployment configuration appear supported while runtime behavior may still fall back to OpenAI-compatible or Gemini-specific paths.

The Architectural Reality

Primary surfaces:

  • ai/provider/Ollama.mjs
  • ai/provider/OpenAiCompatible.mjs
  • ai/services/memory-core/TextEmbeddingService.mjs
  • ai/services/memory-core/SessionService.mjs
  • Dream / graph-mutator provider reachability gates

This is runtime-provider file-group scope. Tier-1 config key migration belongs to Sub-1; docs/integration readiness belongs to Sub-3.

The Fix

Add or repair provider dispatch so chatProvider and embeddingProvider values route to native Ollama and OpenAI-compatible implementations correctly. Verify whether Neo.ai.provider.Ollama already supports embeddings; add a narrow embeddings method if not.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback / Edge Case Docs Evidence
Chat provider routing #11961 OQ2/OQ6 chatProvider: 'ollama' routes native Ollama chat where supported OpenAI-compatible Ollama endpoint remains fallback profile Provider JSDoc Unit tests with mocked provider
Embedding provider routing #11961 OQ2/OQ6 embeddingProvider: 'ollama' routes native Ollama embeddings or adds missing method If provider lacks embeddings, add explicit method rather than silently falling back Provider JSDoc Unit tests for embedding dispatch
Dream/graph-mutator readiness gate #11961 OQ6 Provider reachability checks align with selected chat provider Manual/operator override path documented if needed Service JSDoc Focused dream readiness mock

Decision Record impact

Aligned with the #11961 decision that native Ollama is active, not deprecated.

Acceptance Criteria

  • Runtime callsites distinguish chat and embedding provider axes.
  • Native Ollama chat routing is covered.
  • Native Ollama embedding routing is covered, including adding the provider method if missing.
  • OpenAI-compatible-with-Ollama remains supported as a common-subset fallback.
  • Dream/REM graph-mutator provider reachability is not hardwired to the wrong provider family.
  • Tests cover negative path: unsupported provider names fail explicitly instead of silently falling back to a different family.

Out of Scope

  • Tier-1 config key migration.
  • Cloud documentation and full integration readiness tests.
  • Per-tenant provider variation.

Avoided Traps

  • Do not treat native Ollama as speculative just because dispatch is incomplete.
  • Do not collapse chat and embeddings back into one vague modelProvider axis.

Related

  • Parent: #10103
  • Discussion: #11961
  • Sub-1: config ownership ledger + Tier-1 lift
  • Sub-3: cloud docs + readiness tests

Handoff Retrieval Hint: "Sub-2 #10103 runtime provider routing native Ollama chat embedding dream readiness"

tobiu referenced in commit 58d352b - "feat(memory-core): native Ollama runtime dispatch + provider.embed() method (#11965 Sub-2) (#11966) on May 25, 2026, 1:21 PM
tobiu closed this issue on May 25, 2026, 1:21 PM
tobiu referenced in commit 54153c7 - "fix(ai): re-point AiConfig imports to operator-overlay config.mjs + strip JSDoc archaeology (#11968) (#11969) on May 25, 2026, 2:16 PM