Remove hardcoded DeepSeek-OCR model default value#31
Conversation
将 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>
There was a problem hiding this comment.
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
modelfield inDeepSeekOCRConfigfrom having a default value ("deepseek-ai/DeepSeek-OCR") to being required (Field(...)) - Users must now explicitly set
DS_OCR_MODELin their.envfile 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") |
There was a problem hiding this comment.
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:
- Users must explicitly set
DS_OCR_MODELor the application will fail to start - Other services can start with sensible defaults even if their model env vars are missing
- 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)
| model: str = Field(..., description="DeepSeek-OCR Model Name") | |
| model: str = Field(default="deepseek-ocr-base", description="DeepSeek-OCR Model Name") |
DeepSeek-OCR model name was hardcoded as default in
DeepSeekOCRConfig, limiting model flexibility despiteDS_OCR_MODELenv var support.Changes
modelfield required (no default) inDeepSeekOCRConfig, consistent withapi_keyDS_OCR_MODELin.env(already present inenv.example)Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.