Skip to content

Route think and keep_alive to the top level of Ollama chat requests - #184

Open
james-333i wants to merge 1 commit into
huggingface:mainfrom
james-333i:fix/152-ollama-think
Open

Route think and keep_alive to the top level of Ollama chat requests#184
james-333i wants to merge 1 commit into
huggingface:mainfrom
james-333i:fix/152-ollama-think

Conversation

@james-333i

Copy link
Copy Markdown

Ollama's /api/chat endpoint reads think and keep_alive as top-level siblings of model and messages, so passing them through the custom options dictionary buried them inside options where the server ignores them.

Route those keys to the top level of the request body and keep every other custom key in options. Reserved request keys cannot be overridden. Adds request-encoding tests that run without a live Ollama server.

Fixes #152

Ollama's /api/chat endpoint reads think and keep_alive as top-level
siblings of model and messages, so passing them through the custom
options dictionary buried them inside options where the server
ignores them.

Route those keys to the top level of the request body and keep every
other custom key in options. Reserved request keys cannot be
overridden. Adds request-encoding tests that run without a live
Ollama server.

Fixes huggingface#152
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support top-level request parameters for OllamaLanguageModel (e.g. think)

2 participants