-
Notifications
You must be signed in to change notification settings - Fork 511
Adding ollama support #184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for the Ollama LLM and embedding provider via the official Python package. Key changes include:
- New Ollama-specific implementation files for LLM and embeddings and wiring them into the existing wrappers.
- Documentation, configuration, and environment updates to enable Ollama setup.
- Updates to connectivity checks, requirements, and README to reflect the new provider.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
docs/setup-ollama.md | New setup instructions for Ollama |
code/requirements.txt | Added ollama>=0.5.1 dependency |
code/llm/ollama.py | New OllamaProvider implementation |
code/llm/llm.py | Registered ollama in LLM factory |
code/embedding/ollama_embedding.py | New embedding functions for Ollama |
code/embedding/embedding.py | Integrated Ollama embedding into main dispatcher |
code/config/config_llm.yaml | Added Ollama LLM endpoint configuration |
code/config/config_embedding.yaml | Added Ollama embedding provider configuration |
code/azure-connectivity.py | Added check_ollama_api connectivity test |
code/README.md | Documented new Ollama files |
code/.env.template | Added OLLAMA_URL default to .env template |
Comments suppressed due to low confidence (4)
code/llm/ollama.py:152
- [nitpick] The alias
get_llama_completion
is misleading for an Ollama provider; consider renaming toget_ollama_completion
for clarity.
get_llama_completion = provider.get_completion
docs/setup-ollama.md:31
- [nitpick] Single-dot lines in the fenced code block are unclear; replace with an ellipsis (
...
) or remove them to better indicate omitted content.
.
code/config/config_llm.yaml:77
- The added
llm_type: ollama
field isn't used by the provider implementation; remove it or document its purpose to avoid confusion.
ollama:
code/llm/ollama.py:1
- No tests were added for the new Ollama provider; consider adding unit tests for successful responses, timeouts, and error handling.
# Copyright (c) 2025 Microsoft Corporation.
Ran into some behavior with smaller models and less powerful GPU. Suggest you modify the embedding to a higher timeout from 60 to timeout: int = 300 |
Ok I'll increase the default timeout to 300 |
c669986
to
a296bb2
Compare
Hello,
I have added support for Ollama using their official Python package.
I have tested the code and ran the application using "deepseek-r1:1.5b" and "qwen2.5:0.5b", both the embedding and the llm. Unfortunately I don't have access to any high spec computers so I wasn't able to test it using higher end models. I'd appreciate it if others can test it to see if everything is ok. I have tested the code and ran the application. It is behaving as expected after I tweak some of the code like running the asynchronous tasks sequentially and increasing the timeout.
Let me know if I need to add any other things.