feat(ollama): Add API key support for Ollama Cloud#2278
feat(ollama): Add API key support for Ollama Cloud#2278naorpeled merged 1 commit intoqodo-ai:mainfrom
Conversation
Add support for OLLAMA.API_KEY configuration to enable authentication with Ollama Cloud (ollama.com). Previously only local Ollama instances were supported without authentication. - Pass api_key to litellm completion calls when configured - Update secrets template with documentation for the new api_key field - Clarify api_base comment to distinguish between Ollama Cloud and local
Review Summary by QodoAdd API key support for Ollama Cloud authentication
WalkthroughsDescription• Add API key support for Ollama Cloud authentication • Pass configured api_key to litellm completion calls • Update secrets template with api_key documentation • Clarify api_base distinction between cloud and local Diagramflowchart LR
A["OLLAMA.API_KEY config"] -- "read from settings" --> B["litellm_ai_handler"]
B -- "set litellm.api_key" --> C["litellm initialization"]
B -- "pass api_key in kwargs" --> D["chat_completion call"]
D -- "authenticate with" --> E["Ollama Cloud"]
File Changes1. pr_agent/algo/ai_handlers/litellm_ai_handler.py
|
Code Review by Qodo
1. kwargs['api_key'] set unconditionally
|
naorpeled
left a comment
There was a problem hiding this comment.
LGTM! Thanks for this 🙏
Once my comment is addressed, will gladly merge this
didn't you forget? |
Sorry, missed your reply. |
)" This reverts commit 5c0a4c9.
Revert "feat(ollama): Add API key support for Ollama Cloud (qodo-ai#2278)"
- It make gemini model was failed when call api Refs: qodo-ai#2278
- It make gemini model was failed when call api Refs: qodo-ai#2278
Add API key support for Ollama Cloud authentication
This change enables PR-Agent to authenticate with Ollama Cloud (ollama.com)
by adding support for the
OLLAMA.API_KEYconfiguration option. Previously,only local Ollama instances without authentication were supported.
The API key is now passed through to litellm completion calls when configured,
allowing users to leverage hosted Ollama models that require authentication.
Also updates the secrets template documentation to clarify the distinction
between Ollama Cloud and local Ollama deployments.
Fixes #2267