Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

Hardcoded model default values scattered across config classes make synchronization with env.example error-prone.

Changes

  • Extract model defaults to module-level constants with explicit mapping to env vars:
    • DEFAULT_LLM_MODELLLM_MODEL
    • DEFAULT_EMBEDDING_MODELEMBEDDING_MODEL
    • DEFAULT_RERANK_MODELRERANK_MODEL
    • DEFAULT_DS_OCR_MODELDS_OCR_MODEL
# ==================== Default Model Constants ====================
# These default values must stay in sync with env.example
# They are only used when the corresponding environment variable is not set:
#   - DEFAULT_LLM_MODEL       -> LLM_MODEL
#   - DEFAULT_EMBEDDING_MODEL -> EMBEDDING_MODEL
#   - DEFAULT_RERANK_MODEL    -> RERANK_MODEL
#   - DEFAULT_DS_OCR_MODEL    -> DS_OCR_MODEL

DEFAULT_LLM_MODEL = "seed-1-6-250615"
DEFAULT_EMBEDDING_MODEL = "Qwen/Qwen3-Embedding-0.6B"
DEFAULT_RERANK_MODEL = "Qwen/Qwen3-Reranker-8B"
DEFAULT_DS_OCR_MODEL = "deepseek-ai/DeepSeek-OCR"

Behavior unchanged—pydantic-settings still reads from env vars first, falling back to these constants only when unset.

Original prompt

This section details on the original issue you should resolve

<issue_title>Rerank model default hardcoded - should use env variable</issue_title>
<issue_description>## 问题描述
Rerank 模型默认值硬编码。

受影响的文件

  • src/config.py 行 75

硬编码值

  • default="Qwen/Qwen3-Reranker-8B"

问题

虽然有 RERANK_MODEL 环境变量,但代码中也硬编码。

解决方案

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

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove hardcoded default from rerank model configuration refactor(config): extract hardcoded model defaults to constants Dec 15, 2025
Copilot AI requested a review from BukeLy December 15, 2025 09:43
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.

Rerank model default hardcoded - should use env variable

2 participants