From 47c301c35f28a26b3c1c26c8f4623c462e4820e7 Mon Sep 17 00:00:00 2001 From: wuyang <5700876+banisherwy@user.noreply.gitee.com> Date: Wed, 8 Jul 2026 16:50:08 +0800 Subject: [PATCH] Stop overriding Ollama context size --- web/README.md | 1 + web/app.py | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web/README.md b/web/README.md index d89b9a4..7801ac8 100644 --- a/web/README.md +++ b/web/README.md @@ -38,6 +38,7 @@ https://lab.k1412.top/ - Search Agent 查询理解:`ChatGPT-5.6:light` - Search Agent 结果简报、搜索追问、论文对话:`ChatGPT-5.6:fast` - Ollama 请求单并发执行,并缓存结果到 `web/cache/ai/` +- 应用侧不下发 `num_ctx`,上下文长度由 Ollama 服务端 runner 统一控制 - arXiv 摘要缓存到 `web/cache/arxiv/` ## Knowledge Design diff --git a/web/app.py b/web/app.py index bf8c98e..bb00663 100644 --- a/web/app.py +++ b/web/app.py @@ -1219,19 +1219,18 @@ def clean_model_response(value: str) -> str: def call_ollama(model: str, prompt: str, mode: str) -> dict[str, Any]: options = { "temperature": 0.2, - "num_ctx": 4096, "num_predict": 520, } if mode == "translate": - options.update({"num_ctx": 3072, "num_predict": 700, "temperature": 0.1}) + options.update({"num_predict": 700, "temperature": 0.1}) elif mode == "deep": - options.update({"num_ctx": 8192, "num_predict": 900, "temperature": 0.25}) + options.update({"num_predict": 900, "temperature": 0.25}) elif mode in {"atlas", "topic", "path", "compare"}: - options.update({"num_ctx": 8192, "num_predict": 950, "temperature": 0.22}) + options.update({"num_predict": 950, "temperature": 0.22}) elif mode == "search_plan": - options.update({"num_ctx": 4096, "num_predict": 420, "temperature": 0.1}) + options.update({"num_predict": 420, "temperature": 0.1}) elif mode in {"search_summary", "search_followup", "paper_chat"}: - options.update({"num_ctx": 8192, "num_predict": 780, "temperature": 0.18}) + options.update({"num_predict": 780, "temperature": 0.18}) payload = { "model": model,