Skip to content

Claude/add api compatible ollama 011 c urd mqq1x q jv scwxg gu1q#3

Open
CesarPetrescu wants to merge 2 commits into
vedas-dixit:mainfrom
CesarPetrescu:claude/add-api-compatible-ollama-011CUrdMqq1xQJvScwxgGU1q
Open

Claude/add api compatible ollama 011 c urd mqq1x q jv scwxg gu1q#3
CesarPetrescu wants to merge 2 commits into
vedas-dixit:mainfrom
CesarPetrescu:claude/add-api-compatible-ollama-011CUrdMqq1xQJvScwxgGU1q

Conversation

@CesarPetrescu
Copy link
Copy Markdown

No description provided.

- Added OLLAMA_BASE_URL, OLLAMA_CHAT_MODEL, OLLAMA_EMBED_MODEL, and OLLAMA_TEMPERATURE to .env.template
- Updated agent.py to use Ollama environment variables for ChatOllama initialization
- Updated retriever.py to use Ollama environment variables for OllamaEmbeddings
- Updated tools/summarize_text.py to use Ollama environment variables
- Created .env file as a working example (not tracked in git)
- Now supports both local Ollama (http://localhost:11434) and remote/API Ollama instances

Users can now configure Ollama to point to any API-compatible endpoint by setting OLLAMA_BASE_URL in their .env file.
This commit adds comprehensive support for multiple LLM providers, allowing users to easily switch between different services:

New Features:
- Multi-provider architecture supporting Ollama, LM Studio, OpenAI, and OpenAI-compatible APIs
- API key authentication support for all providers
- Unified configuration through .env file
- Easy provider switching via LLM_PROVIDER and EMBEDDING_PROVIDER variables

Supported Providers:
- Ollama (local/remote with optional API key)
- LM Studio (local OpenAI-compatible server)
- OpenAI (official API)
- OpenAI-Compatible (OpenRouter, Together.ai, Groq, Fireworks, etc.)

Changes:
- Created utils/llm_config.py - Centralized LLM provider management
- Updated .env.template - Added configuration for all providers
- Updated agent.py - Now uses provider configuration system
- Updated retriever.py - Now uses provider configuration for embeddings
- Updated tools/summarize_text.py - Now uses provider configuration
- Updated requirements.txt - Added langchain-openai dependency
- Added PROVIDER_EXAMPLES.md - Comprehensive configuration examples and troubleshooting

Users can now:
1. Use local models (Ollama, LM Studio)
2. Use cloud APIs (OpenAI, OpenRouter, Groq, Together.ai, Fireworks)
3. Mix providers (e.g., Groq for chat, OpenAI for embeddings)
4. Switch providers by changing a single environment variable
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.

2 participants