Skip to content

Conversation

jordibeen
Copy link
Contributor

@jordibeen jordibeen commented Aug 10, 2025

While experimenting with Ollama's thinking control feature using "think": false, I discovered this parameter wasn't being respected. This is because this plugin currently uses Ollama's OpenAI-compatible endpoint (/api/v1/chat/completions) rather than the native API.

According to Ollama's documentation, their OpenAI compatibility is "experimental and subject to major adjustments including breaking changes," while recommending their native API for "fully-featured access." This limitation prevents access to Ollama-specific features like thinking control.

This PR implements native Ollama API support to unlock these features.

Changes Made

Native API Response Parsing - Added Ollama-specific streaming response handler for {"message":{"content":"text"}} format with robust error handling
Thinking Parameter Support - Implemented think parameter control for models like Qwen, with example ChatQwen3-8B agent configuration
Proper Parameter Structure - Refactored payload to follow Ollama API specification with parameters nested under options object (temperature, top_p, min_p, num_ctx, top_k)
Authentication Handling - Removed unnecessary auth headers for Ollama's local API

@jordibeen jordibeen changed the title feat: Add native Ollama API support with "think" control feat: add native Ollama API support with "think" control Aug 11, 2025
@Robitx Robitx merged commit b910a54 into Robitx:main Aug 11, 2025
1 check failed
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.

2 participants