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