fix(ollama): support gpt-oss thinking parameter - #3263
Conversation
Use a low thinking level for gpt-oss models while preserving the existing behavior for other models.
Add regression coverage for model-specific Ollama think parameters and structured output.
Mock the async Ollama client context used by the native structured-output path.
|
Thanks for catching #3246! I opened #3344 as an alternative approach. Instead of the model-name heuristic ( Proposing #3344 supersede this one — but the fix is entirely thanks to your diagnosis here. |
handnewb
left a comment
There was a problem hiding this comment.
LGTM! Ollama recently added native thinking/reasoning support — gpt-oss parameter enables this. 1-line change in openai_compatible_llm.py + comprehensive test. Good catch!
Summary
Fix Ollama native structured-output requests for gpt-oss models.
Previously,
thinkwas hardcoded toFalse, which causes structuredfact extraction to fail with gpt-oss models.
This change uses
think="low"for gpt-oss models while preservingthe existing
think=Falsebehavior for other Ollama reasoning models.Testing
thinkparameter for both gpt-oss and non-gpt-oss models.Fixes #3246