You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: sofai_graph_coloring example fails — Ollama model runner crash with phi:2.7b #806
docs/examples/sofai/sofai_graph_coloring.py fails consistently, including when run standalone:
uv run pytest docs/examples/sofai/sofai_graph_coloring.py -s -v
Error
ollama._types.ResponseError: model runner has unexpectedly stopped, this may be
due to resource limitations or an internal error, check ollama server logs for
details (status code: 500)
The crash occurs during the S1 solver's first attempt (phi:2.7b), before any iteration completes:
S1 Solver: 0%| | 0/3 [00:01<?, ?it/s]
Reproduction
Fails on macOS Apple Silicon (32 GB), not memory-related — phi:2.7b is ~1.7 GB and no other models are loaded. Reproduces both standalone and within the full test suite.
Possible causes
phi:2.7b model incompatibility with current Ollama version
The model ID may need updating (e.g. to phi3:mini or another small model)
The model phi:2.7b is very old (2023) -- and the error relates to an issue with the quantization. This has also been seen with very new models, but may be indicative of this old model also no longer being supported with current ollama
OLLAMA_DEBUG=1 shows the crash is an assertion failure in the GGUF sampler:
Assertion failed: (found), function llama_sampler_dist_apply, file llama-sampling.cpp, line 660.
This is a known incompatibility between phi:2.7b (older GGUF quant) and current Ollama versions — not a memory or resource issue.
Pre-existing test bug
The example also had an incorrect problem definition:
graph dict defined a path (A—B—C): {"A": ["B"], "B": ["A", "C"], "C": ["B"]}
graph_description string described a triangle (A—B—C—A): "A is adjacent to B and C; B is adjacent to A and C; C is adjacent to A and B"
Only 2 colors offered (Red, Blue) — insufficient for the triangle the LLM reads in the prompt
The LLM correctly determines the prompted triangle needs 3 colors, introduces "Green", and the validator rejects it. The SOFAI loop never demonstrated what it was supposed to.
Fix
Model replacement:phi:2.7b → granite4:micro (S1), pielee/qwen3-4b-thinking-2507_q8:latest → granite4:latest (S2). Both already pulled for other tests.
Problem fix — simple option considered but rejected: Making graph and description consistent as K₃ + 3 colors fixes correctness, but the problem is trivial — the LLM solves it first try and the SOFAI retry loop is never exercised.
Problem fix — adopted: Changed to an odd 5-cycle (A—B—C—D—E—A) with 3 colors. This is non-trivial enough that granite4:micro consistently fails (wraps JSON in markdown, gets adjacency wrong), triggering S1→S2 escalation. Deterministic with seed=42, temperature=0.1. Verified passing twice standalone.
Activity
planetf1 commentedon Apr 9, 2026
Ran ollama 0.20.4 with debug.
The model
phi:2.7bis very old (2023) -- and the error relates to an issue with the quantization. This has also been seen with very new models, but may be indicative of this old model also no longer being supported with current ollamaplanetf1 commentedon Apr 9, 2026
Investigation findings
Crash root cause
OLLAMA_DEBUG=1shows the crash is an assertion failure in the GGUF sampler:This is a known incompatibility between
phi:2.7b(older GGUF quant) and current Ollama versions — not a memory or resource issue.Pre-existing test bug
The example also had an incorrect problem definition:
graphdict defined a path (A—B—C):{"A": ["B"], "B": ["A", "C"], "C": ["B"]}graph_descriptionstring described a triangle (A—B—C—A): "A is adjacent to B and C; B is adjacent to A and C; C is adjacent to A and B"Red,Blue) — insufficient for the triangle the LLM reads in the promptThe LLM correctly determines the prompted triangle needs 3 colors, introduces "Green", and the validator rejects it. The SOFAI loop never demonstrated what it was supposed to.
Fix
Model replacement:
phi:2.7b→granite4:micro(S1),pielee/qwen3-4b-thinking-2507_q8:latest→granite4:latest(S2). Both already pulled for other tests.Problem fix — simple option considered but rejected: Making graph and description consistent as K₃ + 3 colors fixes correctness, but the problem is trivial — the LLM solves it first try and the SOFAI retry loop is never exercised.
Problem fix — adopted: Changed to an odd 5-cycle (A—B—C—D—E—A) with 3 colors. This is non-trivial enough that
granite4:microconsistently fails (wraps JSON in markdown, gets adjacency wrong), triggering S1→S2 escalation. Deterministic withseed=42, temperature=0.1. Verified passing twice standalone.fix: sofai graph coloring example — broken model and incorrect problem (
fix: sofai graph coloring example — broken model and incorrect problem (
fix: sofai graph coloring example — broken model and incorrect problem (
fix: sofai graph coloring example — broken model and incorrect problem (