From 0d5bfe072a941984777f56a16b4633b971c65794 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Fri, 6 Dec 2024 05:00:58 -0500 Subject: [PATCH 1/3] Fix for LMStudio Changed baseUrl to baseURL Commented out the same part as in the ollama fix --- app/lib/.server/llm/model.ts | 2 +- app/utils/constants.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/lib/.server/llm/model.ts b/app/lib/.server/llm/model.ts index ecbcd6402..7b9f9572a 100644 --- a/app/lib/.server/llm/model.ts +++ b/app/lib/.server/llm/model.ts @@ -111,7 +111,7 @@ export function getOpenRouterModel(apiKey: OptionalApiKey, model: string) { export function getLMStudioModel(baseURL: string, model: string) { const lmstudio = createOpenAI({ - baseUrl: `${baseURL}/v1`, + baseURL: `${baseURL}/v1`, apiKey: '', }); diff --git a/app/utils/constants.ts b/app/utils/constants.ts index 1120bc1f2..4f6549ce8 100644 --- a/app/utils/constants.ts +++ b/app/utils/constants.ts @@ -393,9 +393,11 @@ async function getOpenRouterModels(): Promise { } async function getLMStudioModels(): Promise { - if (typeof window === 'undefined') { - return []; - } + /* + * if (typeof window === 'undefined') { + * return []; + * } + */ try { const baseUrl = import.meta.env.LMSTUDIO_API_BASE_URL || 'http://localhost:1234'; From 89a309906cb03cc38e62e8cf4e93e3e108588046 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sat, 7 Dec 2024 11:44:00 -0500 Subject: [PATCH 2/3] Update constants.ts --- app/utils/constants.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/utils/constants.ts b/app/utils/constants.ts index 4f6549ce8..a9c741d51 100644 --- a/app/utils/constants.ts +++ b/app/utils/constants.ts @@ -393,11 +393,9 @@ async function getOpenRouterModels(): Promise { } async function getLMStudioModels(): Promise { - /* - * if (typeof window === 'undefined') { - * return []; - * } - */ + if (typeof window === 'undefined') { + return []; + } try { const baseUrl = import.meta.env.LMSTUDIO_API_BASE_URL || 'http://localhost:1234'; From 17ab4fbb2083876eb9a531cbb55afe0d5f7d0da3 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sat, 7 Dec 2024 11:44:47 -0500 Subject: [PATCH 3/3] Update constants.ts --- app/utils/constants.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/utils/constants.ts b/app/utils/constants.ts index a9c741d51..1120bc1f2 100644 --- a/app/utils/constants.ts +++ b/app/utils/constants.ts @@ -393,9 +393,9 @@ async function getOpenRouterModels(): Promise { } async function getLMStudioModels(): Promise { - if (typeof window === 'undefined') { - return []; - } + if (typeof window === 'undefined') { + return []; + } try { const baseUrl = import.meta.env.LMSTUDIO_API_BASE_URL || 'http://localhost:1234';