feat: add DeepSeek LLM provider integration - #2
Open
akdira wants to merge 3 commits into
Open
Conversation
- Add LLM__DEEPSEEK_API_KEY to settings/config - Register deepseek_api_key in LiteLLM client key map - Support DeepSeek (OpenAI-compatible) in BrowserAgent LLM fallback chain - Add DeepSeek to provider status list and .env.example defaults
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds DeepSeek as a configurable LLM provider and updates the automation agent to select an LLM based on a preferred provider with fallbacks.
Changes:
- Added
deepseek_api_keyto settings/config plumbing (.env example, settings model, provider listing, API key configuration). - Updated automation agent LLM selection to support DeepSeek (OpenAI-compatible base URL) and Groq fallback.
- Refactored ChatOpenAI construction into a helper to support custom
base_url.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/app/core/llm/client.py | Includes deepseek_api_key in API key configuration mapping. |
| backend/app/core/automation/agent.py | Adds preferred-provider selection, DeepSeek support (OpenAI-compatible), Groq fallback, and a ChatOpenAI builder. |
| backend/app/config/settings.py | Adds deepseek_api_key to LLMSettings. |
| backend/app/api/v1/settings.py | Exposes DeepSeek in the LLM providers status endpoint. |
| .env.example | Documents LLM__DEEPSEEK_API_KEY and includes DeepSeek in fallback providers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+138
to
+150
| # Try preferred provider in order | ||
| if preferred == "deepseek" and deepseek_key: | ||
| return self._build_chat_openai( | ||
| model=llm_config.default_model if "deepseek" in llm_config.default_model.lower() else "deepseek-chat", | ||
| api_key=deepseek_key, | ||
| base_url="https://api.deepseek.com/v1", | ||
| ) | ||
|
|
||
| if preferred != "deepseek" and openai_key: | ||
| return self._build_chat_openai( | ||
| model=llm_config.default_model, | ||
| api_key=openai_key, | ||
| ) |
Comment on lines
+130
to
+132
| settings = get_settings() | ||
| llm_config = settings.llm | ||
| preferred = llm_config.preferred_provider |
Comment on lines
+120
to
+122
| """Create a LangChain-compatible LLM based on the preferred provider. | ||
|
|
||
| Falls back through: OpenAI → DeepSeek (OpenAI-compatible) → Groq. |
Comment on lines
+194
to
+198
| kwargs: dict[str, Any] = { | ||
| "model": model, | ||
| "api_key": api_key, | ||
| "temperature": get_settings().llm.temperature, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 by cubic
Adds DeepSeek as an OpenAI-compatible LLM provider and wires it into the BrowserAgent selection with an OpenAI → DeepSeek → Groq fallback. Sets the DeepSeek default model to deepseek-chat.
New Features
LLM__DEEPSEEK_API_KEYto settings and.env.example.list_llm_providers) with default modeldeepseek-chat.deepseek_api_keyin theLiteLLMclient key map.BrowserAgentto honorpreferred_providerand fall back OpenAI → DeepSeek → Groq.base_url(https://api.deepseek.com/v1) for DeepSeek.Migration
LLM__DEEPSEEK_API_KEYin your environment to enable DeepSeek.langchain-openai; installlangchain-groqonly if using Groq fallback.Written for commit bc15452. Summary will update on new commits.