Add Ollama local LLM provider support #20
Merged
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.
Summary
This PR adds support for Ollama, enabling users to run large language models locally without API costs. The implementation includes a new
OllamaProviderclass and integrates it into the existing LLM factory pattern.Key Changes
New OllamaProvider class (
quantcoder/llm/providers.py):Updated LLMFactory (
quantcoder/llm/providers.py):api_keyparameter optional (not required for Ollama)base_urlparameter to support local provider configurationConfiguration updates (
quantcoder/config.py):ollama_base_urlandollama_modelfields toModelConfigto_dict()method for configuration serializationBug fix: Fixed typo in LLMFactory.PROVIDERS ("Mistral Provider" → "MistralProvider")
Implementation Details
http://localhost:11434/v1withllama3.2model