Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
黄南光
/
wiki_knowledge
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cb6bb140
authored
Oct 15, 2026
by
黄南光
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
将deepseek模型改成4.1
1 parent
0bff09ec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
10 deletions
config.py
src/rag/core/config.py
src/utils/llm_models.py
tests/utils/test_llm_model_temperature.py
config.py
View file @
cb6bb14
...
...
@@ -74,8 +74,8 @@ API_KEY = os.environ.get("DASHSCOPE_API_KEY") or os.environ.get("OPENAI_API_KEY"
# 分场景模型
INGEST_MODEL_NAME
=
os
.
environ
.
get
(
"INGEST_MODEL_NAME"
,
"qwen3.7-plus"
)
QUERY_MODEL_NAME
=
os
.
environ
.
get
(
"QUERY_MODEL_NAME"
,
"deepseek-v4-flash"
)
LINT_MODEL_NAME
=
os
.
environ
.
get
(
"LINT_MODEL_NAME"
,
"deepseek-v4-flash"
)
QUERY_MODEL_NAME
=
os
.
environ
.
get
(
"QUERY_MODEL_NAME"
,
"deepseek-v4
.1
-flash"
)
LINT_MODEL_NAME
=
os
.
environ
.
get
(
"LINT_MODEL_NAME"
,
"deepseek-v4
.1
-flash"
)
# 摄入是抽取任务,低温可减少字段幻觉与 JSON/YAML 格式漂移;query/lint 不受影响,
# 仍用 llm_models 各模型 profile 的默认温度。
...
...
@@ -85,7 +85,7 @@ INGEST_MODEL_TEMPERATURE = float(os.environ.get("INGEST_MODEL_TEMPERATURE") or 0
def
is_multimodal
(
model_name
:
str
)
->
bool
:
"""是否为带视觉的多模态模型(content 走 list-of-blocks)。
判定:显式视觉标记 -vl / qvq,或 qwen3.7 系列(qwen3.7-plus 支持图像+文本)。
deepseek-v4-flash / qwen-flash / qwen3.6-flash 均为纯文本,返回 False。
deepseek-v4
.1
-flash / qwen-flash / qwen3.6-flash 均为纯文本,返回 False。
"""
return
is_multimodal_model
(
model_name
)
...
...
src/rag/core/config.py
View file @
cb6bb14
...
...
@@ -21,8 +21,8 @@ QDRANT_COLLECTION = os.environ.get("QDRANT_COLLECTION", "rag_chunks")
# ---------------------------------------------------------
# RAG 链路使用的模型:回答、意图识别、向量化。
# 换模型改环境变量即可(如 qwen-flash / qwen3.7-plus),不要在此处堆注释块。
RAG_ANSWER_MODEL
=
os
.
environ
.
get
(
"RAG_ANSWER_MODEL"
,
"deepseek-v4-flash"
)
RAG_INTENT_MODEL
=
os
.
environ
.
get
(
"RAG_INTENT_MODEL"
,
"deepseek-v4-flash"
)
RAG_ANSWER_MODEL
=
os
.
environ
.
get
(
"RAG_ANSWER_MODEL"
,
"deepseek-v4
.1
-flash"
)
RAG_INTENT_MODEL
=
os
.
environ
.
get
(
"RAG_INTENT_MODEL"
,
"deepseek-v4
.1
-flash"
)
# 意图识别优先走低延迟路径:默认显式关闭支持该参数模型的 thinking/reasoning 模式。
RAG_INTENT_ENABLE_THINKING
=
os
.
environ
.
get
(
"RAG_INTENT_ENABLE_THINKING"
,
"false"
)
...
...
src/utils/llm_models.py
View file @
cb6bb14
...
...
@@ -22,10 +22,9 @@ SUPPORTED_CHAT_MODELS = tuple(
"qwen3.6-flash"
,
"qwen3.5-flash"
,
"qwen-flash"
,
"deepseek-v4-flash"
,
"deepseek-v4
.1
-flash"
,
"deepseek-v4-pro"
,
"deepseek-v3.2"
,
"deepseek-v4-flash"
,
)
)
)
...
...
@@ -68,8 +67,8 @@ _CHAT_MODEL_PROFILES: dict[str, ChatModelProfile] = {
supports_enable_thinking
=
True
,
),
"qwen-flash"
:
ChatModelProfile
(
name
=
"qwen-flash"
),
"deepseek-v4-flash"
:
ChatModelProfile
(
name
=
"deepseek-v4-flash"
,
"deepseek-v4
.1
-flash"
:
ChatModelProfile
(
name
=
"deepseek-v4
.1
-flash"
,
supports_enable_thinking
=
True
,
temperature
=
None
,
),
...
...
tests/utils/test_llm_model_temperature.py
View file @
cb6bb14
...
...
@@ -21,7 +21,7 @@ class LlmModelTemperatureTest(unittest.TestCase):
显式取值不得把它冲掉,否则调用会被模型端拒绝。
"""
for
model
in
(
"deepseek-v4-pro"
,
"deepseek-v4-flash"
,
"deepseek-v3.2"
):
for
model
in
(
"deepseek-v4-pro"
,
"deepseek-v4
.1
-flash"
,
"deepseek-v3.2"
):
kwargs
=
build_model_init_kwargs
(
model
,
api_key
=
"k"
,
purpose
=
"INGEST"
,
temperature
=
0.1
)
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment