feat: add Ollama provider support with streaming inference#162
Open
independenter wants to merge 1 commit into
Open
feat: add Ollama provider support with streaming inference#162independenter wants to merge 1 commit into
independenter wants to merge 1 commit into
Conversation
- Add ollama dependency handling in lib/inference/__init__.py - Implement __ollama_text_generation__ and __ollama_chat_generation__ methods - Add api_url field to ProviderDetails and Provider entities - Register Ollama routes in server/app.py - Update models.json with Ollama model configurations (gemma4:e4b) - Add comprehensive documentation in docs/添加大模型提供商指南.md - Support both text generation and chat generation with streaming responses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds comprehensive support for the Ollama LLM provider, enabling users to run local models through Ollama with full streaming support.
Changes Made
ProviderDetailsand Provider entities in [server/lib/entities.py](server/lib/entities.py) for custom API endpointsgemma2,llama3)docs/添加大模型提供商指南.mdFeatures
http://localhost:11434)top_p,top_k, etc.)How to Test
ollama pull llama3orollama pull gemma2http://localhost:11434)Configuration Example
Add to [server/models.json](server/models.json):
{ "ollama": { "models": { "llama3": { "enabled": true, "status": "ready", "parameters": { "temperature": 0.7, "topP": 0.9, "topK": 40, "maximumLength": 512 } } }, "requiresAPIKey": false, "remoteInference": true, "apiURL": "http://localhost:11434" } }