Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

DeepSeek-OCR model name was hardcoded as default in DeepSeekOCRConfig, limiting model flexibility despite DS_OCR_MODEL env var support.

Changes

  • Make model field required (no default) in DeepSeekOCRConfig, consistent with api_key
  • Users must explicitly set DS_OCR_MODEL in .env (already present in env.example)
# Before
model: str = Field(
    default="deepseek-ai/DeepSeek-OCR",
    description="DeepSeek-OCR Model Name"
)

# After
model: str = Field(..., description="DeepSeek-OCR Model Name")
Original prompt

This section details on the original issue you should resolve

<issue_title>DeepSeek-OCR model name hardcoded - limits model flexibility</issue_title>
<issue_description>## 问题描述
DeepSeek-OCR 模型名称硬编码,限制模型灵活性。

受影响的文件

  • src/config.py 行 102

硬编码值

  • default="deepseek-ai/DeepSeek-OCR"

问题

虽然有 DS_OCR_MODEL 环境变量,但代码默认值也硬编码。

解决方案

应该保持一致,建议移除硬编码的默认值。</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

将 model 字段从有默认值 "deepseek-ai/DeepSeek-OCR" 改为必填字段,
用户需要在 .env 文件中显式设置 DS_OCR_MODEL 环境变量。

修复 issue: DeepSeek-OCR model name hardcoded - limits model flexibility

Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove hardcoded default model name in DeepSeek-OCR Remove hardcoded DeepSeek-OCR model default value Dec 15, 2025
Copilot AI requested a review from BukeLy December 15, 2025 09:41
@BukeLy BukeLy marked this pull request as ready for review December 15, 2025 09:42
Copilot AI review requested due to automatic review settings December 15, 2025 09:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the hardcoded default value for the DeepSeek-OCR model name in the configuration, making it a required field that must be explicitly set via the DS_OCR_MODEL environment variable. The change aims to improve model flexibility by eliminating the hardcoded default value while relying on users to configure this in their .env file (as shown in env.example).

Key Changes:

  • Changed model field in DeepSeekOCRConfig from having a default value ("deepseek-ai/DeepSeek-OCR") to being required (Field(...))
  • Users must now explicitly set DS_OCR_MODEL in their .env file for the application to start

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

default="deepseek-ai/DeepSeek-OCR",
description="DeepSeek-OCR Model Name"
)
model: str = Field(..., description="DeepSeek-OCR Model Name")
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

Making the model field required creates an inconsistency with other configuration classes in this codebase. LLMConfig (line 24), EmbeddingConfig (line 46-49), and RerankConfig (line 74-77) all provide default values for their model fields.

This inconsistency means that:

  1. Users must explicitly set DS_OCR_MODEL or the application will fail to start
  2. Other services can start with sensible defaults even if their model env vars are missing
  3. The configuration pattern is not uniform across the codebase

Consider either:

  • Keeping the default value to maintain consistency with other configs
  • Or updating all other config classes to also require explicit model specification (if that's the desired pattern)
Suggested change
model: str = Field(..., description="DeepSeek-OCR Model Name")
model: str = Field(default="deepseek-ocr-base", description="DeepSeek-OCR Model Name")

Copilot uses AI. Check for mistakes.
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.

DeepSeek-OCR model name hardcoded - limits model flexibility

2 participants