From 4edcc5e3311f3f999eea833d27b7be0ada071a2b Mon Sep 17 00:00:00 2001 From: Karrot0 Date: Sun, 27 Oct 2024 23:16:07 -0400 Subject: [PATCH 1/4] LM Studio Integration --- .env.example | 5 + app/components/chat/BaseChat.tsx | 3 + app/lib/.server/llm/api-key.ts | 2 + app/lib/.server/llm/model.ts | 14 +- app/utils/constants.ts | 22 +- package-lock.json | 23450 +++++++++++++++++++++++++++++ vite.config.ts | 2 +- worker-configuration.d.ts | 1 + 8 files changed, 23494 insertions(+), 5 deletions(-) create mode 100644 package-lock.json diff --git a/.env.example b/.env.example index d5cfc5cb3..53e157dd6 100644 --- a/.env.example +++ b/.env.example @@ -40,5 +40,10 @@ OPENAI_LIKE_API_KEY= # You only need this environment variable set if you want to use Mistral models MISTRAL_API_KEY= +# Get LMStudio Base URL from LM Studio Developer Console +# Make sure to enable CORS +# Example: http://localhost:1234 +LMSTUDIO_API_BASE_URL= + # Include this environment variable if you want more logging for debugging locally VITE_LOG_LEVEL=debug diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index c1175f700..68f852af7 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -48,6 +48,9 @@ const ModelSelector = ({ model, setModel, modelList, providerList }) => { +