Add Ollama provider option for LLMs and embeddings#475
Merged
Conversation
Co-authored-by: sudoleg <54912398+sudoleg@users.noreply.github.com>
Co-authored-by: sudoleg <54912398+sudoleg@users.noreply.github.com>
Co-authored-by: sudoleg <54912398+sudoleg@users.noreply.github.com>
Co-authored-by: sudoleg <54912398+sudoleg@users.noreply.github.com>
Co-authored-by: sudoleg <54912398+sudoleg@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Ollama as LLM provider for local execution
Add Ollama provider option for LLMs and embeddings
Dec 13, 2025
sudoleg
approved these changes
Dec 14, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds Ollama as an alternative LLM provider to OpenAI, enabling fully local execution without requiring an OpenAI API key. The implementation includes model discovery, pulling capabilities, and embedding support with appropriate provider-specific handling throughout the application.
Key changes:
- Added Ollama helper functions for availability checks, model listing/filtering, and model pulling
- Updated UI to support provider selection with appropriate warnings and model availability checks
- Modified summary and chat pages to instantiate provider-specific LLM and embedding models
- Fixed typo in function name from
get_preffered_languagestoget_preferred_languages
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/helpers.py | Added Ollama integration functions (availability check, model listing with embedding detection, model pulling), fixed typo in language preference function name, updated token counting with fallback |
| modules/ui.py | Added provider selection dropdown, model availability checks with warnings for both OpenAI and Ollama |
| modules/summary.py | Changed to use BaseChatModel interface, added Ollama context window detection via ollama.show(), instantiate provider-specific chat models |
| pages/summary.py | Added provider readiness checks and conditional LLM instantiation for OpenAI/Ollama with appropriate warnings |
| pages/chat.py | Added embedding provider metadata storage, provider-specific embedding model selection with pull button for Ollama, validation of embedding availability during retrieval |
| modules/youtube.py | Fixed typo: get_preffered_languages → get_preferred_languages |
| tests/test_ollama_helpers.py | Added unit tests for Ollama helper functions (availability check, model filtering, pull failure handling) |
| tests/test_summary.py | Commented out context window test that needs updating for multi-provider support |
| requirements.txt | Added langchain-ollama==1.0.1 and ollama==0.6.1 dependencies |
| docker-compose.yml | Commented out Ollama service configuration |
| README.md | Updated documentation to mention Ollama support and configuration requirements |
Comments suppressed due to low confidence (1)
tests/test_summary.py:75
- This comment appears to contain commented-out code.
# def test_transcript_too_long_exception(mock_llm):
# # Create a transcript that exceeds the context window
# transcript = "word " * OPENAI_CONTEXT_WINDOWS["gpt-3.5-turbo"]["total"]
#
# with pytest.raises(
# expected_exception=TranscriptTooLongForModelException,
# match="Your transcript exceeds the context window of the chosen model",
# ) as exc_info:
# get_transcript_summary(transcript_text=transcript, llm=mock_llm)
…gth exception test
…h local ollama server
…ken counting logic in transcript summary
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: sudoleg <54912398+sudoleg@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This reverts commit 37b673e.
…model for non-English videos
sudoleg
approved these changes
Dec 21, 2025
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.
Enables choosing Ollama as an alternative to OpenAI for chat/summarization and embeddings, including model discovery and pull flows, so the app can run fully locally without an OpenAI key.
langchain-ollamaandollamadeps; new unit tests for Ollama helpers.Example:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.