Context
Sibling of #13853 (both sub of epic #12740). #13853 fixes the local (LM Studio / openAiCompatible) chat-model path — switch to the gemma-4-26b-a4b MoE, no-think, provider json_schema. The cloud/production path uses ollama (aiConfig.ollama.model, NEO_OLLAMA_MODEL, default gemma4:31b). The same root cause (dense 31B slow cold-prefill) likely applies on the cloud unless its GPU is materially faster — unverified. This ticket is the ollama-side parity, scoped to proceed in parallel with #13853.
Release classification: post-release (cloud REM pipeline; not release-blocking) → boardless.
The Problem
The ollama path differs from LM Studio in three ways, each requiring verification (NOT yet empirically confirmed — V-B-A required at implementation, unlike #13853 which was fully benchmarked):
- Model tag — the MoE's ollama identifier differs from LM Studio's
google/gemma-4-26b-a4b (ollama uses its own registry tags; today gemma4:31b). The MoE tag must be found / ollama pull-ed and set in NEO_OLLAMA_MODEL.
- Structured output — ollama's native chat API uses a
format: <JSON schema> field, not OpenAI-style response_format:{type:'json_schema'}. The ollama provider path must emit the caller schema in ollama's expected shape.
- No-think toggle — ollama may not honor
reasoning_effort; the gemma-MoE no-think mechanism under ollama may be a prompt token (/no_think) or a different param. Verify, then wire to the same per-task reasoningEffort config leaves introduced in #13853.
The Architectural Reality
- The ollama provider path (
ai/provider/Ollama.mjs or the ollama branch of the provider dispatch — confirm at implementation).
aiConfig.ollama.model leaf (default gemma4:31b).
- The cloud deployment runs ollama via compose-managed
OLLAMA_* env (context length, parallel, keep-alive). Deployment specifics live in the private deployment repo — not here.
- Reuses #13853's per-task
reasoningEffort config leaves (summaryReasoningEffort / graphReasoningEffort).
The Fix
- Verify + set the ollama MoE model tag (
NEO_OLLAMA_MODEL); document the ollama pull step.
- Ollama provider emits structured output via ollama's native
format field (with the caller's JSON schema).
- Verify + wire the ollama no-think mechanism to the per-task
reasoningEffort leaves.
- Cloud benchmark — measure the ollama MoE cold-prefill vs the dense
gemma4:31b on the cloud hardware; confirm the prefill win, or document if the cloud GPU makes the dense 31B acceptable (in which case the model-switch is local-only).
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
aiConfig.ollama.model |
config leaf (ADR 0019) |
default → ollama MoE tag |
env NEO_OLLAMA_MODEL |
config.template.mjs JSDoc |
pending cloud benchmark |
| ollama provider structured output |
ollama provider path |
emit native format:<schema> |
prompt-only |
provider JSDoc |
pending V-B-A (ollama format) |
| ollama no-think |
ollama provider / prompt |
wire to reasoningEffort leaves |
thinking-on |
method JSDoc |
pending V-B-A (ollama no-think) |
Decision Record impact
aligned-with ADR 0019 (config leaves resolved at use-site). Sibling of #13853; both realize epic #12740 (per-task model routing) for their respective providers.
Acceptance Criteria
Out of Scope
- The local LM Studio /
openAiCompatible path (#13853).
- The orchestrator ollama serving lifecycle (#13852 —
ollama serve ensure + num_ctx preload); this ticket is model-choice + structured-output + no-think, not serving.
Avoided Traps
- Assuming ollama == LM Studio. ollama's structured-output (
format) and no-think mechanisms are NOT the same as LM Studio's response_format:json_schema / reasoning_effort — each is a verify-then-wire task, not a copy of #13853.
- Assuming the cloud has the same prefill problem. Unverified — the cloud GPU may prefill the dense 31B acceptably; the benchmark decides whether the switch is cloud-needed.
Related
- Local sibling: #13853.
- Parent epic: #12740 (per-task model routing).
- Adjacent: #13852 (ollama serving lifecycle), #13851 (context verification).
Origin Session ID
2439c28b-245e-425a-85a7-ca7ee4aa0336
Handoff Retrieval Hints
query_summaries: "ollama gemma MoE structured output format no-think cloud benchmark #13853"
- Live latest-open sweep: checked open issues at 2026-06-22T10:08Z; no equivalent (closest #13852 = serving lifecycle, not model-choice). Scoped for parallel pickup per operator direction.
Context
Sibling of #13853 (both sub of epic #12740). #13853 fixes the local (LM Studio /
openAiCompatible) chat-model path — switch to thegemma-4-26b-a4bMoE, no-think, providerjson_schema. The cloud/production path uses ollama (aiConfig.ollama.model,NEO_OLLAMA_MODEL, defaultgemma4:31b). The same root cause (dense 31B slow cold-prefill) likely applies on the cloud unless its GPU is materially faster — unverified. This ticket is the ollama-side parity, scoped to proceed in parallel with #13853.Release classification: post-release (cloud REM pipeline; not release-blocking) → boardless.
The Problem
The ollama path differs from LM Studio in three ways, each requiring verification (NOT yet empirically confirmed — V-B-A required at implementation, unlike #13853 which was fully benchmarked):
google/gemma-4-26b-a4b(ollama uses its own registry tags; todaygemma4:31b). The MoE tag must be found /ollama pull-ed and set inNEO_OLLAMA_MODEL.format: <JSON schema>field, not OpenAI-styleresponse_format:{type:'json_schema'}. The ollama provider path must emit the caller schema in ollama's expected shape.reasoning_effort; the gemma-MoE no-think mechanism under ollama may be a prompt token (/no_think) or a different param. Verify, then wire to the same per-taskreasoningEffortconfig leaves introduced in #13853.The Architectural Reality
ai/provider/Ollama.mjsor the ollama branch of the provider dispatch — confirm at implementation).aiConfig.ollama.modelleaf (defaultgemma4:31b).OLLAMA_*env (context length, parallel, keep-alive). Deployment specifics live in the private deployment repo — not here.reasoningEffortconfig leaves (summaryReasoningEffort/graphReasoningEffort).The Fix
NEO_OLLAMA_MODEL); document theollama pullstep.formatfield (with the caller's JSON schema).reasoningEffortleaves.gemma4:31bon the cloud hardware; confirm the prefill win, or document if the cloud GPU makes the dense 31B acceptable (in which case the model-switch is local-only).Contract Ledger Matrix
aiConfig.ollama.modelNEO_OLLAMA_MODELformat:<schema>format)reasoningEffortleavesDecision Record impact
aligned-with ADR 0019 (config leaves resolved at use-site). Sibling of #13853; both realize epic #12740 (per-task model routing) for their respective providers.
Acceptance Criteria
ollama pull-documented, set asNEO_OLLAMA_MODELdefault (or env).formatfield with the caller schema; extraction + summary produce valid schema-correct JSON.reasoningEffortleaves (#13853).gemma4:31b; result documented (win confirmed, or dense-31B-acceptable-on-cloud-GPU noted).Out of Scope
openAiCompatiblepath (#13853).ollama serveensure +num_ctxpreload); this ticket is model-choice + structured-output + no-think, not serving.Avoided Traps
format) and no-think mechanisms are NOT the same as LM Studio'sresponse_format:json_schema/reasoning_effort— each is a verify-then-wire task, not a copy of #13853.Related
Origin Session ID
2439c28b-245e-425a-85a7-ca7ee4aa0336
Handoff Retrieval Hints
query_summaries: "ollama gemma MoE structured output format no-think cloud benchmark #13853"