Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
Remove usage of `BACKEND_TYPE` (#539)
Sarah Wooders2857ae1c817d
diff --git a/memgpt/cli/cli_config.py b/memgpt/cli/cli_config.pyindex fcd5b279d..4a84e850d 100644--- a/memgpt/cli/cli_config.py+++ b/memgpt/cli/cli_config.py@@ -60,9 +60,6 @@ def configure_llm_endpoint(config: MemGPTConfig):if config.model_endpoint_type in backend_options:# set from previous configdefault_model_endpoint_type = config.model_endpoint_type- if os.getenv("BACKEND_TYPE") and os.getenv("BACKEND_TYPE") in backend_options:- # set form env variable (ok if none)- default_model_endpoint_type = os.getenv("BACKEND_TYPE")model_endpoint_type = questionary.select("Select LLM backend (select 'openai' if you have an OpenAI compatible proxy):",backend_options,diff --git a/memgpt/embeddings.py b/memgpt/embeddings.pyindex 8e3cd43c4..4dacab840 100644--- a/memgpt/embeddings.py+++ b/memgpt/embeddings.py@@ -121,14 +121,9 @@ def embedding_model():return embed_modelelse:# default to hugging face model running local+ # warning: this is a terrible modelfrom llama_index.embeddings import HuggingFaceEmbeddingos.environ["TOKENIZERS_PARALLELISM"] = "False"model = "BAAI/bge-small-en-v1.5"return HuggingFaceEmbedding(model_name=model)-- # TODO: add back if we decide to support custom embedding endpoints- # else:- # # use env variable OPENAI_API_BASE- # model = OpenAIEmbedding()- # return modeldiff --git a/memgpt/local_llm/chat_completion_proxy.py b/memgpt/local_llm/chat_completion_proxy.pyindex f249acb26..cae4d11fd 100644--- a/memgpt/local_llm/chat_completion_proxy.py+++ b/memgpt/local_llm/chat_completion_proxy.py@@ -19,8 +19,6 @@ from memgpt.local_llm.utils import get_available_wrappersfrom memgpt.prompts.gpt_summarize import SYSTEM as SUMMARIZE_SYSTEM_MESSAGEfrom memgpt.errors import LocalLLMConnectionError, LocalLLMError-endpoint = os.getenv("OPENAI_API_BASE")-endpoint_type = os.getenv("BACKEND_TYPE") # default None == ChatCompletionDEBUG = False# DEBUG = True@@ -103,7 +101,7 @@ def get_chat_completion(result = get_vllm_completion(endpoint, model, prompt, context_window, user)else:raise LocalLLMError(- f"BACKEND_TYPE is not set, please set variable depending on your backend (webui, lmstudio, llamacpp, koboldcpp)"+ f"Invalid endpoint type {endpoint_type}, please set variable depending on your backend (webui, lmstudio, llamacpp, koboldcpp)")except requests.exceptions.ConnectionError as e:raise LocalLLMConnectionError(f"Unable to connect to endpoint {endpoint}")diff --git a/memgpt/openai_tools.py b/memgpt/openai_tools.pyindex 14f8c2375..257a2f179 100644--- a/memgpt/openai_tools.py+++ b/memgpt/openai_tools.py@@ -10,10 +10,6 @@ from box import Boxfrom memgpt.local_llm.chat_completion_proxy import get_chat_completion-HOST = os.getenv("OPENAI_API_BASE")-HOST_TYPE = os.getenv("BACKEND_TYPE") # default None == ChatCompletion-R = TypeVar("R")-def is_context_overflow_error(exception):from memgpt.utils import printd