From 302b07bd2b073b20bb2670784de90bacbab8e9c1 Mon Sep 17 00:00:00 2001 From: jnjpng Date: Thu, 7 Aug 2025 20:02:56 -0700 Subject: [PATCH] fix: lmstudio tests and integration Co-authored-by: Jin Peng --- letta/schemas/providers/lmstudio.py | 4 ++-- tests/configs/llm_model_configs/lmstudio.json | 2 +- tests/integration_test_send_message.py | 6 +----- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/letta/schemas/providers/lmstudio.py b/letta/schemas/providers/lmstudio.py index 910e37da..b04d9825 100644 --- a/letta/schemas/providers/lmstudio.py +++ b/letta/schemas/providers/lmstudio.py @@ -55,7 +55,7 @@ class LMStudioOpenAIProvider(OpenAIProvider): LLMConfig( model=model_name, model_endpoint_type="openai", - model_endpoint=self.base_url, + model_endpoint=self.model_endpoint_url, context_window=context_window_size, handle=self.get_handle(model_name), compatibility_type=compatibility_type, @@ -94,7 +94,7 @@ class LMStudioOpenAIProvider(OpenAIProvider): EmbeddingConfig( embedding_model=model_name, embedding_endpoint_type="openai", - embedding_endpoint=self.base_url, + embedding_endpoint=self.model_endpoint_url, embedding_dim=768, # Default embedding dimension, not context window embedding_chunk_size=DEFAULT_EMBEDDING_CHUNK_SIZE, # NOTE: max is 2048 handle=self.get_handle(model_name), diff --git a/tests/configs/llm_model_configs/lmstudio.json b/tests/configs/llm_model_configs/lmstudio.json index a0f7cd93..31623160 100644 --- a/tests/configs/llm_model_configs/lmstudio.json +++ b/tests/configs/llm_model_configs/lmstudio.json @@ -2,7 +2,7 @@ "context_window": 8192, "model": "qwen2.5-7b-instruct-1m", "model_endpoint_type": "openai", - "model_endpoint": "http://127.0.0.1:1234/v1", + "model_endpoint": "http://127.0.0.1:1234/api/v0", "model_wrapper": null, "provider_name": "lmstudio_openai" } diff --git a/tests/integration_test_send_message.py b/tests/integration_test_send_message.py index 1e1b3556..ed44ed67 100644 --- a/tests/integration_test_send_message.py +++ b/tests/integration_test_send_message.py @@ -110,11 +110,7 @@ USER_MESSAGE_BASE64_IMAGE: List[MessageCreate] = [ ] # configs for models that are to dumb to do much other than messaging -limited_configs = [ - "ollama.json", - "together-qwen-2.5-72b-instruct.json", - "vllm.json", -] +limited_configs = ["ollama.json", "together-qwen-2.5-72b-instruct.json", "vllm.json", "lmstudio.json"] all_configs = [ "openai-gpt-4o-mini.json",