From f2ca866069fc0c36d4e2590d0dafeec53ba53e94 Mon Sep 17 00:00:00 2001 From: Neil Mehta Date: Thu, 27 Feb 2025 16:18:20 -0500 Subject: [PATCH 1/2] Update code snippets in README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 30119d4..57b62b4 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,9 @@ Using this convenience API, requesting text completion from an already loaded LLM is as straightforward as: ```python -import lmstudio as lm +import lmstudio as lms -llm = lm.llm() +llm = lms.llm() llm.complete("Once upon a time,") ``` @@ -35,15 +35,15 @@ setting up a `Chat` helper to manage the chat history and include it in response prediction requests: ```python -import lmstudio as lm +import lmstudio as lms EXAMPLE_MESSAGES = ( "My hovercraft is full of eels!", "I will not buy this record, it is scratched." ) -llm = lm.llm() -chat = lm.Chat("You are a helpful shopkeeper assisting a foreign traveller") +llm = lms.llm() +chat = lms.Chat("You are a helpful shopkeeper assisting a foreign traveller") for message in EXAMPLE_MESSAGES: chat.add_user_message(message) print(f"Customer: {message}") From 54e7e1d2ed6801fcf6f7e1e4c3e53f44fb46dfaa Mon Sep 17 00:00:00 2001 From: Neil Mehta Date: Thu, 27 Feb 2025 16:25:54 -0500 Subject: [PATCH 2/2] Rename llm variable to model --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 57b62b4..62534f3 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ loaded LLM is as straightforward as: ```python import lmstudio as lms -llm = lms.llm() -llm.complete("Once upon a time,") +model = lms.llm() +model.complete("Once upon a time,") ``` Requesting a chat response instead only requires the extra step of @@ -42,12 +42,12 @@ EXAMPLE_MESSAGES = ( "I will not buy this record, it is scratched." ) -llm = lms.llm() +model = lms.llm() chat = lms.Chat("You are a helpful shopkeeper assisting a foreign traveller") for message in EXAMPLE_MESSAGES: chat.add_user_message(message) print(f"Customer: {message}") - response = llm.respond(chat) + response = model.respond(chat) chat.add_assistant_response(response) print(f"Shopkeeper: {response}") ```