From ac1a4ffca324ac0902eecc91eaf5f33e69d15037 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Mon, 3 Feb 2025 07:41:00 +1100 Subject: [PATCH 1/2] DEV: raise timeout for reasoning LLMs --- lib/completions/endpoints/base.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/completions/endpoints/base.rb b/lib/completions/endpoints/base.rb index 439b54f55..58ff9c2ae 100644 --- a/lib/completions/endpoints/base.rb +++ b/lib/completions/endpoints/base.rb @@ -7,7 +7,11 @@ class Base attr_reader :partial_tool_calls CompletionFailed = Class.new(StandardError) - TIMEOUT = 60 + # 6 minutes + # Reasoning LLMs can take a very long time to respond, generally it will be under 5 minutes + # The alternative is to have per LLM timeouts but that would make it extra confusing for people + # configuring. Let's try this simple solution first. + TIMEOUT = 360 class << self def endpoint_for(provider_name) From 97f20f0001233301826fc558668ec7eb830083ee Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Mon, 3 Feb 2025 07:56:15 +1100 Subject: [PATCH 2/2] FIX: use id to identify llms, not model_name model_name is not unique, in the case of reasoning models you may configure the same llm multiple times using different reasoning levels. --- .../connectors/composer-fields/persona-llm-selector.gjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse/connectors/composer-fields/persona-llm-selector.gjs b/assets/javascripts/discourse/connectors/composer-fields/persona-llm-selector.gjs index a5240197b..951d754ae 100644 --- a/assets/javascripts/discourse/connectors/composer-fields/persona-llm-selector.gjs +++ b/assets/javascripts/discourse/connectors/composer-fields/persona-llm-selector.gjs @@ -152,7 +152,7 @@ export default class BotSelector extends Component { resetTargetRecipients() { if (this.allowLLMSelector) { const botUsername = this.currentUser.ai_enabled_chat_bots.find( - (bot) => bot.model_name === this.llm + (bot) => bot.id === this.llm ).username; this.composer.set("targetRecipients", botUsername); } else { @@ -170,7 +170,7 @@ export default class BotSelector extends Component { return availableBots.map((bot) => { return { - id: bot.model_name, + id: bot.id, name: bot.display_name, }; });