ITADN

Not possible to pass `think = FALSE` to Ollama models via `chat_ollama()`

#940OpenAdaemmerP 创建于 2026-03-14
A
AdaemmerPcommented
I’m using `chat_ollama()` with a local Ollama model (`qwen3.5:4b`). Ollama allows to [disable reasoning](https://ollama.com/blog/thinking) for thinking models using the `think = false` parameter (CLI flag `--think=false`). The provided Python code works. However, I haven’t found a way to pass this parameter through `chat_ollama()` with ellmer. From looking at the implementation, it seems that: * `chat_ollama()` uses the OpenAI-compatible API (`/v1/chat/completions`). * The `chat_params()` method for `ProviderOllama` maps only a limited set of parameters (`temperature`, `top_p`, `max_tokens`, etc.): ```r method(chat_params, ProviderOllama) <- function(provider, params) { standardise_params( params, c( frequency_penalty = "frequency_penalty", presence_penalty = "presence_penalty", seed = "seed", stop = "stop_sequences", temperature = "temperature", top_p = "top_p", top_k = "top_k", max_tokens = "max_tokens" ) ) } ``` I added `max_tokens = "max_tokens"` locally to the package and re-installed it, but that did not change anything. I also tried passing the argument via `api_args`: ```r chat <- chat_ollama( model = "qwen3.5:4b", api_args = list(think = FALSE) ) ``` but this also does not seem to propagate the parameter to the Ollama request. Is there currently a supported way to pass `think = FALSE` to Ollama models when using `chat_ollama()` or is this limitation due to using the OpenAI-compatible endpoint instead of the native Ollama API?
0 条评论