Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.org
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- Removed bad interactions made in Ollama tool calls
- Fixed Ollama tool calling requests
- Fixed Ollama reasoning, whose API has changed
- Added gpt-oss, supported low/medium/high reasoning with Ollama
- Run tools in the original buffer
* Version 0.28.3
- Fixed breakage in Ollama streaming tool calling
Expand Down
7 changes: 6 additions & 1 deletion llm-models.el
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,12 @@ REGEX is a regular expression that can be used to identify the model, uniquely (
:name "BGE-M3" :symbol 'bge-m3
:capabilities '(embedding free-software) ;; MIT license
:context-length 8192
:regex "bge-m3")))
:regex "bge-m3")
(make-llm-model
:name "gpt-oss" :symbol 'gpt-oss
:capabilities '(generation free-software reasoning tool-use) ; Apache license
:context-length 128000
:regex "gpt-oss")))

(defun llm-models-by-symbol (symbol)
"Return the model with SYMBOL."
Expand Down
18 changes: 13 additions & 5 deletions llm-ollama.el
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,19 @@ PROVIDER is the llm-ollama provider."
(llm-ollama--response-format
(llm-chat-prompt-response-format prompt)))))
(setq request-plist (plist-put request-plist :stream (if streaming t :false)))
(when (llm-chat-prompt-reasoning prompt)
(setq request-plist (plist-put request-plist :think
(if (eq 'none (llm-chat-prompt-reasoning prompt))
:false
't))))
(let ((model (llm-models-match (llm-ollama-chat-model provider))))
(when (and (llm-chat-prompt-reasoning prompt)
(member 'reasoning (llm-model-capabilities model))
(not (eq 'none (llm-chat-prompt-reasoning prompt))))
(setq request-plist (plist-put request-plist :think
(if (eq 'gpt-oss model)
(pcase (llm-chat-prompt-reasoning prompt)
('light "low")
('medium "medium")
('maximum "high"))
(if (eq 'none (llm-chat-prompt-reasoning prompt))
:false
't))))))
(when (llm-chat-prompt-temperature prompt)
(setq options (plist-put options :temperature (llm-chat-prompt-temperature prompt))))
(when (llm-chat-prompt-max-tokens prompt)
Expand Down