Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

nonfunctional 404 quickstart command w/ some other typo corrections

cpacker9c8ed92ad7b9
diff --git a/memgpt/cli/cli.py b/memgpt/cli/cli.py
index 9ad3adf24..c374ced80 100644
--- a/memgpt/cli/cli.py
+++ b/memgpt/cli/cli.py
@@ -1,5 +1,6 @@
import typer
import json
+import requests
import sys
import io
import logging
@@ -25,6 +26,34 @@ from memgpt.embeddings import embedding_model
from memgpt.server.constants import WS_DEFAULT_PORT, REST_DEFAULT_PORT
+class QuickstartChoice(Enum):
+ # openai = "openai"
+ # azure = "azure"
+ memgpt_hosted = "memgpt"
+
+
+def quickstart(
+ type: QuickstartChoice = typer.Option("memgpt", help="Quickstart setup type"),
+):
+ """Set the base config file with a single command"""
+ if type == QuickstartChoice.memgpt_hosted:
+ # Download the latest memgpt hosted config
+ url = "https://raw.githubusercontent.com/cpacker/MemGPT/main/configs/memgpt_hosted.json"
+ response = requests.get(url)
+
+ # Check if the request was successful
+ if response.status_code == 200:
+ # Parse the response content as JSON
+ config = response.json()
+ # Output a success message and the first few items in the dictionary as a sample
+ print("JSON file downloaded and loaded into a dictionary successfully.")
+ else:
+ print(f"Failed to download config from {url}. Status code:", response.status_code)
+
+ else:
+ raise NotImplementedError(type)
+
+
def open_folder():
"""Open a folder viewer of the MemGPT home directory"""
try:
diff --git a/memgpt/local_llm/chat_completion_proxy.py b/memgpt/local_llm/chat_completion_proxy.py
index 8a1954f18..58d193b9d 100644
--- a/memgpt/local_llm/chat_completion_proxy.py
+++ b/memgpt/local_llm/chat_completion_proxy.py
@@ -54,7 +54,7 @@ def get_chat_completion(
# Warn the user that we're using the fallback
if not has_shown_warning:
print(
- f"{CLI_WARNING_PREFIX}no wrapper specified for local LLM, using the default wrapper (you can remove this warning by specifying the wrapper with --wrapper)"
+ f"{CLI_WARNING_PREFIX}no wrapper specified for local LLM, using the default wrapper (you can remove this warning by specifying the wrapper with --model-wrapper)"
)
has_shown_warning = True
if endpoint_type in ["koboldcpp", "llamacpp", "webui"]:
diff --git a/memgpt/local_llm/vllm/api.py b/memgpt/local_llm/vllm/api.py
index 5033d04bd..71cb2c79f 100644
--- a/memgpt/local_llm/vllm/api.py
+++ b/memgpt/local_llm/vllm/api.py
@@ -18,7 +18,7 @@ def get_vllm_completion(endpoint, model, prompt, context_window, user, settings=
# Settings for the generation, includes the prompt + stop tokens, max length, etc
request = settings
request["prompt"] = prompt
- request["max_tokens"] = int(context_window - prompt_tokens)
+ request["max_tokens"] = 3000 # int(context_window - prompt_tokens)
request["stream"] = False
request["user"] = user
diff --git a/memgpt/main.py b/memgpt/main.py
index 8bc3e00e3..af2033b14 100644
--- a/memgpt/main.py
+++ b/memgpt/main.py
@@ -21,7 +21,7 @@ from memgpt.interface import CLIInterface as interface # for printing to termin
import memgpt.agent as agent
import memgpt.system as system
import memgpt.constants as constants
-from memgpt.cli.cli import run, attach, version, server, open_folder
+from memgpt.cli.cli import run, attach, version, server, open_folder, quickstart
from memgpt.cli.cli_config import configure, list, add
from memgpt.cli.cli_load import app as load_app
from memgpt.connectors.storage import StorageConnector
@@ -35,6 +35,7 @@ app.command(name="list")(list)
app.command(name="add")(add)
app.command(name="server")(server)
app.command(name="folder")(open_folder)
+app.command(name="quickstart")(quickstart)
# load data commands
app.add_typer(load_app, name="load")