From 9830c53a0104c12b4f7f4275fce2e65ba9710673 Mon Sep 17 00:00:00 2001 From: Eliezer Steinbock <3090527+elie222@users.noreply.github.com> Date: Tue, 16 Sep 2025 14:58:39 +0300 Subject: [PATCH] limit reasoning tokens used --- apps/web/utils/llms/model.ts | 13 +++++++++---- version.txt | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/web/utils/llms/model.ts b/apps/web/utils/llms/model.ts index 72b1f968b1..d48b20a006 100644 --- a/apps/web/utils/llms/model.ts +++ b/apps/web/utils/llms/model.ts @@ -187,11 +187,15 @@ function selectModel( function createOpenRouterProviderOptions( providers: string, ): Record { + const order = providers + .split(",") + .map((p: string) => p.trim()) + .filter(Boolean); + return { openrouter: { - provider: { - order: providers.split(",").map((p: string) => p.trim()), - }, + provider: order.length > 0 ? { order } : undefined, + reasoning: { max_tokens: 20 }, }, }; } @@ -282,7 +286,8 @@ function selectDefaultModel(userAi: UserAIFields): SelectModel { let aiModel: string | null = null; const aiApiKey = userAi.aiApiKey; - const providerOptions: Record = {}; + const providerOptions: Record = + createOpenRouterProviderOptions(""); // If user has not api key set, then use default model // If they do they can use the model of their choice diff --git a/version.txt b/version.txt index 4c274f5667..9211bcd570 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v2.9.35 +v2.9.36