From 31eb8c33034f2aef40c6d95b94dd8c8ad0c24650 Mon Sep 17 00:00:00 2001 From: jze9 Date: Tue, 14 Jul 2026 15:39:47 +0500 Subject: [PATCH] =?UTF-8?q?LLM=20max=5Ftokens=201000=E2=86=928000:=20reaso?= =?UTF-8?q?ning-=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D0=B8=20=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D1=82=D0=B8=D0=BB=D0=B8=20=D0=B2=D0=B5=D1=81=D1=8C=20=D0=BB?= =?UTF-8?q?=D0=B8=D0=BC=D0=B8=D1=82=20=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D0=BC=D1=8B=D1=88=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B8=20?= =?UTF-8?q?=D0=B2=D0=BE=D0=B7=D0=B2=D1=80=D0=B0=D1=89=D0=B0=D0=BB=D0=B8=20?= =?UTF-8?q?=D0=BF=D1=83=D1=81=D1=82=D0=BE=D0=B9=20=D0=BE=D1=82=D0=B2=D0=B5?= =?UTF-8?q?=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .env | 2 +- api/config.py | 3 ++- api/lib/llm.py | 3 ++- api/route/pipeline.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 068deae..94b26f2 100644 --- a/.env +++ b/.env @@ -23,5 +23,5 @@ LLM_BASE_URL= LLM_API_KEY= LLM_MODEL= LLM_TIMEOUT=120 -LLM_MAX_TOKENS=1000 +LLM_MAX_TOKENS=8000 LLM_TEMPERATURE=0.3 diff --git a/api/config.py b/api/config.py index 91891e4..fb9c4d7 100644 --- a/api/config.py +++ b/api/config.py @@ -20,7 +20,8 @@ class Settings(BaseSettings): LLM_API_KEY: str = os.getenv("LLM_API_KEY", "") LLM_MODEL: str = os.getenv("LLM_MODEL", "") LLM_TIMEOUT: int = int(os.getenv("LLM_TIMEOUT", "120")) - LLM_MAX_TOKENS: int = int(os.getenv("LLM_MAX_TOKENS", "1000")) + # reasoning-модели тратят max_tokens и на размышления — 1000 им мало + LLM_MAX_TOKENS: int = int(os.getenv("LLM_MAX_TOKENS", "8000")) LLM_TEMPERATURE: float = float(os.getenv("LLM_TEMPERATURE", "0.3")) @property diff --git a/api/lib/llm.py b/api/lib/llm.py index ec1a674..5660e58 100644 --- a/api/lib/llm.py +++ b/api/lib/llm.py @@ -36,7 +36,8 @@ class LLMConfig(BaseModel): # before the user has picked one. model: str = "" timeout: int = 120 - max_tokens: int = 1000 + # у reasoning-моделей сюда входят и токены размышлений + max_tokens: int = 8000 temperature: float = 0.3 extra_headers: dict[str, str] = Field(default_factory=dict) diff --git a/api/route/pipeline.py b/api/route/pipeline.py index 6ecde63..51d1ca2 100644 --- a/api/route/pipeline.py +++ b/api/route/pipeline.py @@ -18,7 +18,7 @@ class LLMOverride(BaseModel): api_key: str = "" model: str timeout: int = 120 - max_tokens: int = 1000 + max_tokens: int = 8000 temperature: float = 0.3 extra_headers: dict[str, str] = {} system_prompt: str | None = None