LM Studio CLI: Speed Up Your AI App Development (100% Local + UI)
Key Takeaways
This video tutorial demonstrates how to use LM Studio CLI to integrate large language models into applications, including downloading and loading models, starting a local server, and creating a user interface with Chainlit.
Full Transcript
this is amazing now we have LM Studio CLI so what is CLI you are able to run LM Studio from your terminal like this you are able to download large language models you are able to load the large language model same like you do it for Olo you can load and unload llms or large language Model start stop local server debug your workloads this is going to be super useful for developers who want to integrate a large language model in their application or for those who create AI application I'm going to show you how you can use LM Studio CLI and use it more efficiently how to integrate that with your python application and finally teach you how to create a user interface such as a chatboard like this where you can ask give me a meal plan for today or any question and it can automatically generate response which is directly linked with LM Studio that's exactly what we're going to see today let's get started hi everyone I'm really excited to show you about LMS LMS is LM studio in your terminal I'm going to take you through step by step on how to install this application show you the different commands which you can use to access this application and finally create a user interface like this but before that I regularly create videos in regards to Artificial Intelligence on my YouTube channel so do subscribe and click the Bell icon to stay tuned make sure you click the like button so this video can be helpful for many ofs like you in this video going to see how to to download a large language model then how to start the server using CLI then how to load the model via CLI then finally how to integrate that in your own application so first go to LM studio. a website there you can download LM Studio application after that open that application and search for the model which you want to use I'm going to use llama 3 8B instruct by clicking the download button of your choice you can download the model here I'm going to use llama 3 which you can see I have downloaded that here so the next step is to stop the server so instead of using the application I'm coming to the terminal here make sure you have downloaded nodejs you can download nodejs from nodejs.org website after that you can type npix LM Studio install hyphen CLI and then click enter this will install the CLI package next pip install open AI chain lit and then click enter we are using open a as a proxy for our LM Studio server using Chang it we are going to set up a chatbot like user interface now we are ready to start the server just type LMS server start and then click enter now you can see the server got started in port number 1 2 3 4 so that is Local Host colon 2 34 next you can see the list of models downloaded by just typing LMS LS and then click enter here you can see the list of models I've downloaded and totally it's taking 7 22 GB of disk space and next step is to load the launch language model to do that LMS load llama 3 hyphen hyphen GPU equals Max and then click enter now you can see the Llama 3 Model is loading model loaded successfully now you can test if the server has started or Not by typing curl and the end point Local Host 1 2 3 4 chat completions and then click enter now you can see the response is getting generated and it is done so this confirms it is working fine I can even stop the streaming by just typing stream equals false and then click answer now I got a response instantly without streaming so this is all working in the terminal now we're going to integrate that in the python application to do that let's create a file called app.py and let's open it inside the file from open AI import open AI next Define the open AI function next chat completions create function here we are providing the lar language model name that is meta Lama 38b instruct ggf if you want to get the information of this you can even get that from your terminal by typing LMS LS and click enter and here you can see the loaded model so you can just copy this model name and then paste that here that's it then you're providing the usual information the messages temperature finally you're going to print the response that's it now I'm going to run this code in your terminal Python app.py and then click enter and here is a response so I asked introduce yourself and here's the response I'm a lost language model my name is llama it's true I'll chat with you and see this conversation through because we gave a instruction saying that always answer in Rhymes that's why you saw the response as Rhymes to scream the response I just modify stream equals true and added this four Loop that's it now let's see running this the question I'm going to ask is give me a meal plan for today you are a Heth F chatbot as the instruction now I'm going to run this Python stream. piy and click enter now we can see the response is getting generated by streaming now the final step is to integrate this with your chain L application or user interface to do that I'm using Asing open AI function then added all the settings in one settings variable then I have two chain lit decorator one is cl. onchat start and second is CL do on message so this is triggered when the UI starts this is triggered when you send a message in the chat interface so here you can see it's getting all the history so that it can remember the context of the conversation same as before we are using client. chat. completion. Create and there we pause the message history and the stream equals true same as the full loop which we had before here we have a for Loop we are appending the result to the message history and finally message. update that's it now we have successfully created a user interface for our AI application which is going to look like a chatbot now I'm going to run this code in your terminal chain lit run ui. piy and then click enter now the application is running in port number 8,000 which you can see here I'm going to open this URL and here is the user interface I'm going to ask a question give me a meal plan for me today and clicking enter and you can see the response is getting generated this is directly from LM Studio which we started using our CLI now here is asking a few more questions do you have any food allergies are there any specific interest I'm going to say everything is your choice and you can see it's generating the response using the context we provided earlier now we have successfully created a chatbot which is directly interacting with LM Studio running completely locally on your computer few other commands which I want to tell you one is LMS unload so just type LMS unload hyphen hyphen all and then click enter so now it unloaded one model so initially if you saw we loaded one model which is llama 3 and now we have unloaded it now I'm going to test LMS LS and click enter here now you can see there's no model loaded based on the command we entered I'm going to load the model again and there's LMS log stream this will automatically stream the log that means whenever this endpoint is used or API is used or the server is used you can see the log here so for example I'm going to run this parall write an email to my manager about holiday and then click answer now you can see immediately you can see the log on the right hand side similarly whenever you start typing you can see the log on the right hand side in this way you are able to track if any error occurs finally you can stop the server by typing LMS server stop and then click enter I stopped the server on port number 1 2 3 4 now it's all done now you are able to create an application like this or chatbot like this and able to integrate that with LM Studio I'm really excited about this I'm going to create more videos similar to this so stay tuned I hope you like this video do like share and subscribe and thanks for watching
Original Description
🚀 Dive into the world of AI with our comprehensive tutorial on LM Studio CLI! In this video, I'll guide you step-by-step on how to effectively use LM Studio CLI to integrate large language models into your applications, straight from your terminal. 🖥️
🔗 Starting with the basics, learn how to download, install, and manage models. Then, I'll show you how to set up a local server, debug processes, and integrate a fully functional chatbot interface into your Python applications. Whether you're a seasoned developer or just starting out, this video has everything you need to leverage AI for your projects!
👇 Key Features You'll Learn:
How to install and configure LM Studio CLI
Commands for managing models and servers
Integrating AI into applications with Python
Creating a responsive chatbot UI
🔗 Resources:
Sponsor a Video: https://mer.vin/contact/
Do a Demo of Your Product: https://mer.vin/contact/
Patreon: https://patreon.com/MervinPraison
Ko-fi: https://ko-fi.com/mervinpraison
Discord: https://discord.gg/nNZu5gGT59
Twitter / X : https://twitter.com/mervinpraison
Code: https://mer.vin/2024/05/lm-studio-chainlit/
📌 Timestamps:
0:00 - Introduction to LM Studio CLI
0:35 - Setting up LM Studio CLI
1:39 - Downloading and Managing Models
2:34 - Starting and Testing the Server
3:45 - Building a Chatbot Interface
6:07 - Final Overview & How to Unload Models
🌟 Don’t forget to like, share, and subscribe for more AI tutorials and tips! Click the bell icon to stay updated on all our latest content.
#LMstudio #CLI #local #Ai #LMStudioTutorial #LMStudio #ArtificialIntelligence #LLM #OpenSourceLLM #LMStudioFirstSteps #LMStudioAI #LMStudioGuide #Llama #HowToLMStudioLLM #UsingLMStudioQuickGuide #LMStudioServer #Llama3LMStudio #LMStudioInstallGuide #LMStudioLLM #PresetsInLMStudio #HowToConfigureLMStudio #LocalServerOnLMStudio #RunAILocally #OpenSourceLLMs #OpenSourceLLM #LLMLocalOnPC #RunLLMsLocally
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Mervin Praison · Mervin Praison · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Build GCP Infra using Pulumi in YAML format
Mervin Praison
How to Convert a Pulumi YAML File to Python Format
Mervin Praison
Speed Up AWS EKS: A Complete Guide to Performance Tuning & Debugging!
Mervin Praison
Learn GCP GKE to AWS EKS Migration in Just 5 Minutes: Quick Guide
Mervin Praison
AWS & Kubernetes: The Definitive Guide to Data Persistence with PV and PVC
Mervin Praison
ChatGPT Voice Conversation RELEASED! It's AMAZING!! (Demo)
Mervin Praison
How to Install Mistral 7B in Minutes: Quick & Easy Guide! ✅
Mervin Praison
Code Llama Install Locally: 🐍💻 Elevate Your Python Skills!
Mervin Praison
Orca Mini: Your Ultimate Guide to Install and Test on Mac & Linux 💻
Mervin Praison
Quick & Easy Vicuna Setup on Mac and Linux 💻
Mervin Praison
Quick Guide: Llama2 Local Installation and ChatGPT with pip! Python🛠️
Mervin Praison
Query PDFs Like a Pro with Local GPT: Full Setup Guide! 📜
Mervin Praison
LM Studio: EASIEST way to Run Large Language Models Locally!
Mervin Praison
AMAZING ChatGPT Vision is OUT! 🤯 14+ Examples (Step-by-Step) FULL Tutorial
Mervin Praison
Unbelievable! Build ANY App Instantly with Smol AI! 😲🔥
Mervin Praison
Amazing! AutoGen Made Easy: A Step-by-Step Beginners Guide 📚
Mervin Praison
How to Set Up LoLLMS and Run LLMs Locally! 🚀 Step-by-Step Tutorial
Mervin Praison
GPT4All: INSANE Way to Run Large Language Models Locally! 😲 Step-By-Step Tutorial
Mervin Praison
Incredible AI-Powered NPCs in Unity Game Engine: Step by Step Tutorial!🤯
Mervin Praison
MemGPT 🧠 LLM as Operating System. It's INSANE! Step-by-Step Tutorial 🤯
Mervin Praison
Text Generation Web UI: MIND-BLOWING Way to Run LLM Locally! 🤯
Mervin Praison
Unlock the INSANE Power of OpenAI GPT-4 with C#/.NET! 😲
Mervin Praison
Integrate Langchain and Ollama for Local AI Power 🤯 Indeed POWERFUL!
Mervin Praison
ChatDev: INSANE Virtual AI Agents! Future of Software Development 😲
Mervin Praison
Query PDFs Using Mistral: Unlock INSANE Power! 🤯
Mervin Praison
AutoGen + Open-Source LLMs: UNBELIEVABLE! Step-by-Step Tutorial You Can't Miss! 🤯
Mervin Praison
AutoGen + Text Generation WebUI: Unbelievable 100% Local Private Setup 🤯
Mervin Praison
MemGPT: Amazing! External Context for LLM #ai #llm #memgpt #generativeai #mem #gpt #openai #chatgpt
Mervin Praison
GeniA: Kubernetes + AI for MIND-BLOWING Operational Efficiency! 🤯 FULL Tutorial
Mervin Praison
VertexAI Meets LangChain for Mind-Blowing AI Conversations! 😲 Step by Step Tutorial
Mervin Praison
Simplified ChatGPT API Setup on Node.js for Newbies! 😍 Step by Step Tutorial
Mervin Praison
Autogen: Ollama integration 🤯 Step by Step Tutorial. Mind-blowing!
Mervin Praison
LiteLLM: One-Function Call to ANY Large Language Model! 🤯 UNBELIEVABLE!
Mervin Praison
ChatGPT Chatbot in Less Time Than You Think! 🚀😎 Step-by-Step Tutorial
Mervin Praison
LiteLLM Chatbot: Build Your Own in MINUTES! INSANE! 🤖🔥
Mervin Praison
Create Chatbot: Turn ANY Open-Source LLM into a Conversation Pro! 🤖
Mervin Praison
Create Chatbot: Ollama Integration Made UNBELIEVABLY Easy! 🎉
Mervin Praison
LlamaIndex + ChatGPT: Ingest Data and Experience UNBELIEVABLE Query Results! 🌟
Mervin Praison
INSANE! OpenAgents: Automated Data Analysis with Kaggle 🤯
Mervin Praison
React.js LLM Agent for Next-Gen Coding using ChatGPT 🚀 Mind-Blowing 🤯
Mervin Praison
MemGPT + Any LLM 🚀 100% Local & Private Integration Unveiled! Unlimited Memory
Mervin Praison
MemGPT + AutoGen 🧠🤖 Unlimited Memory & Autonomous AI Agents! INSANE🤯
Mervin Praison
AutoGen + Google's Palm LLM & More! Revolutionary AI Integration 🚀
Mervin Praison
MemGPT & LM Studio Integration Revealed! 🔥 Next-Level AI
Mervin Praison
🚀 AutoLLM: Unlock the Power of 100+ Language Models! Step-by-Step Tutorial
Mervin Praison
AutoLLM & Gradio Integration You Won't Believe! 🤯 Mind-Blowing
Mervin Praison
AutoLLM & FastAPI Tutorial: Query 100+ Language Models! 😱
Mervin Praison
Quivr: LLM's Second Brain - Transforming Data Management & Advanced Query with AI! 🤯
Mervin Praison
AutoGen & MemGPT with Local LLM: A Complete Setup Tutorial! 🧠 AMAZING 🤯
Mervin Praison
LocalAI: Free, Open Source OpenAI Alternative 🚀 INSANE 🤯 Step-by-Step Tutorial
Mervin Praison
Yarn Mistral 7B 128k LARGE context window, Small size 🤯 INSANE 🚀 Setup Tutorial!
Mervin Praison
Zephyr-7B: The Small and Mighty LLM 🤯 Step by Step Tutorial! 📘
Mervin Praison
Promptfoo: How to Test Your LLM ? 🚀 VERY EASY!
Mervin Praison
Pydantic: How to Validate LLM Responses? 🚀 Quality Response. VERY EASY!!!!
Mervin Praison
Pydantic: FORCE Your AI to Respond Back in UPPERCASE! 🤯 Step-by-Step Tutorial 🔥
Mervin Praison
Pydantic: How to use LLM to convert unstructured data to structured data?
Mervin Praison
AutoGen Function Calling: INSANE 🚀 Custom Integrations! Step-by-Step Tutorial 🤯
Mervin Praison
OpenAI Assistants API + Python 🤖 How to get started? (FULL Tutorial) 🤯 INSANE
Mervin Praison
GPT-4 Vision API 🤯 INSANE Video Recognition Powers! Step-by-Step Tutorial 🚀
Mervin Praison
GPT-4 Vision API 🚀 The Future of Image Recognition! 🤯 Step-by-Step Tutorial
Mervin Praison
More on: LLM Foundations
View skill →Related Reads
📰
📰
📰
📰
How Pulse matches you with the right provider — semantic AI search vs keyword lookup. BizNode Pulse uses embedding-based...
Dev.to AI
Prompt Chaining: How to Break Down Complex Tasks Into Simple Steps
Dev.to AI
High-Performance MoE Inference: Qwen3.6–35B-A3B on an AI PC with OpenVINO
Medium · Machine Learning
The Use Of Ai In Today’s World
Medium · Deep Learning
Chapters (6)
Introduction to LM Studio CLI
0:35
Setting up LM Studio CLI
1:39
Downloading and Managing Models
2:34
Starting and Testing the Server
3:45
Building a Chatbot Interface
6:07
Final Overview & How to Unload Models
🎓
Tutor Explanation
DeepCamp AI