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.
PR Description
This PR adds Ollama as a new provider integration, enabling local or self-hosted LLM usage under the same consistent interface as other providers. Below is a brief summary of changes:
Ollama Integration
OllamaChatCompletionEndPoint
class to handle local chat completions from an Ollama server.match_endpoint.py
so that specifyingprovider="ollama"
routes requests to the Ollama endpoint.Configuration & Key Handling
IMODEL
constructor logic to acceptprovider="ollama"
and skip the usual API-key verification (since Ollama is local).model="ollama/mymodel"
orprovider="ollama", model="myModelName"
.Schema & Endpoint Adjustments
function_to_schema.py
for better handling of function calls and JSON schema creation.base.py
andimodel.py
to unify endpoint initialization logic, so that the same base structures can handle remote or local providers.Version Bump
0.9.5
to0.9.6
to reflect the new provider support.Why Ollama?
Ollama provides a local LLM runtime for secure and faster experimentation, removing external dependencies. This integration makes it easier to switch between remote (OpenAI, etc.) and local LLMs while reusing the same Lion-AGI code patterns.
Testing
ollama:latest
.Impacts
ollama
provider is now recognized, letting users specify{"provider": "ollama", "model": "<modelName>"}
to run local inference.Thanks for reviewing!