Commit 405b36619d32

Vincent Demeester <vincent@sbr.pm>
2026-01-07 15:40:59
fix(emacs): Disable streaming for Ollama to prevent gptel hang
- Set :stream nil to fix 'stuck typing' issue with gptel + Ollama - Update both init.el and documentation - Known issue: gptel has streaming compatibility problems with Ollama - Non-streaming mode works correctly and provides full responses
1 parent a01be4d
Changed files (2)
docs/emacs-ollama-config.el
@@ -15,9 +15,10 @@
 
 ;; Ollama backend with metrics tracking (RECOMMENDED - default choice)
 ;; Measured overhead: ~25ms (negligible - 0.5-1.25% on small models, <0.1% on larger models)
+;; Note: Streaming disabled due to gptel compatibility issues with Ollama streaming
 (gptel-make-ollama "Ollama (with metrics)"
   :host "192.168.1.23:8000"  ; Exporter endpoint for Prometheus metrics
-  :stream t
+  :stream nil  ; Set to nil to avoid "stuck typing" issue
   :models '(;; Tool Calling / OpenCode Support
             "llama3.1:8b"              ; Best for tool calling
             "mistral-nemo:latest"      ; Fast tool calling
@@ -41,7 +42,7 @@
 ;; Only use for benchmarking or when you explicitly don't want metrics
 (gptel-make-ollama "Ollama (direct)"
   :host "192.168.1.23:11434"  ; Direct Ollama, bypasses metrics collection
-  :stream t
+  :stream nil  ; Set to nil to avoid "stuck typing" issue
   :models '("llama3.1:8b"
             "qwen2.5-coder:7b"
             "phi3.5:3.8b"
tools/emacs/init.el
@@ -2189,7 +2189,7 @@ Add this function to the `after-save-hook'."
 			       openai/gpt-3.5-turbo))
   (gptel-make-ollama "Ollama (with metrics)"
 		     :host "192.168.1.23:8000"  ; Exporter endpoint for metrics
-		     :stream t
+		     :stream nil  ; Disabled due to gptel streaming issues with Ollama
 		     :models '(;; Tool Calling / OpenCode Support
 			       "llama3.1:8b"              ; Best for tool calling
 			       "mistral-nemo:latest"      ; Fast tool calling