Skip to content

feat: add DeepSeek LLM provider integration - #2

Open
akdira wants to merge 3 commits into
Rayyan9477:mainfrom
akdira:feat/deepseek-integration
Open

feat: add DeepSeek LLM provider integration#2
akdira wants to merge 3 commits into
Rayyan9477:mainfrom
akdira:feat/deepseek-integration

Conversation

@akdira

@akdira akdira commented Jun 9, 2026

Copy link
Copy Markdown
  • 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

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

    • Added LLM__DEEPSEEK_API_KEY to settings and .env.example.
    • Exposed DeepSeek in provider status (list_llm_providers) with default model deepseek-chat.
    • Registered deepseek_api_key in the LiteLLM client key map.
    • Updated BrowserAgent to honor preferred_provider and fall back OpenAI → DeepSeek → Groq.
    • Added ChatOpenAI builder with optional base_url (https://api.deepseek.com/v1) for DeepSeek.
  • Migration

    • Set LLM__DEEPSEEK_API_KEY in your environment to enable DeepSeek.
    • Install langchain-openai; install langchain-groq only if using Groq fallback.

Written for commit bc15452. Summary will update on new commits.

Review in cubic

- 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
Copilot AI review requested due to automatic review settings June 9, 2026 15:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_key to 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 thread backend/app/core/automation/agent.py Outdated
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,
}
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.

4 participants