Skip to content

ollama support - read for review #187

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonathanalexander229
Copy link

@jonathanalexander229 jonathanalexander229 commented Mar 19, 2025

Here's a summary of the changes we made to add Ollama support to your AI hedge fund application:

  1. Environment Configuration:

    • Added OLLAMA_BASE_URL and OLLAMA_MODEL to .env.example to allow configuration of the Ollama instance and model
    • These variables are loaded by the existing dotenv configuration in main.py
  2. Dependencies:

    • Added langchain-community package to pyproject.toml for Ollama integration
    • This package provides the ChatOllama implementation
  3. Model Provider Updates in models.py:

    • Added import for ChatOllama: from langchain_community.chat_models import ChatOllama
    • Added OLLAMA to the ModelProvider enum
    • Added a single Ollama model entry to the AVAILABLE_MODELS list
    • Updated the get_model function to handle the Ollama provider type
  4. Simplified Implementation:

    • Added error handling to check for environment variables
    • Kept the implementation simple and aligned with other model providers
    • Pulls the actual model name from environment variables when needed

These changes allow your application to use locally hosted Ollama models alongside the cloud-based LLM options, all configured through your .env file.

@jonathanalexander229 jonathanalexander229 force-pushed the add-ollama-support branch 2 times, most recently from d93af59 to dda1397 Compare March 29, 2025 19:14
@jonathanalexander229 jonathanalexander229 changed the title ollama support testing ollama support - read for review Mar 29, 2025
@jonathanalexander229 jonathanalexander229 marked this pull request as ready for review March 29, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant