Setting up LM Studio for local chat and reasoning
LM Studio lets CodeBot use local chat and reasoning models on your own computer. It provides a desktop app for finding, downloading and running local language models, plus a local OpenAI-compatible server that CodeBot can connect to.
Use LM Studio if you want a visual app for managing local language models.
What You Need
Before you start, make sure you have:
- A Mac, Windows PC or Linux PC that can run local language models.
- Enough free disk space for models. A single model can be several gigabytes.
- Time for the first model download.
Local models are useful for privacy, offline work and avoiding hosted AI credits. They are usually slower and less capable than the best hosted models, especially on small laptops.
Short Version
- Install LM Studio from the official download page.
- Open LM Studio.
- Download one model.
- Start LM Studio's local server.
- Add an LM Studio account in CodeBot with this URL: http://localhost:1234/v1
After that, choose the LM Studio account in CodeBot when you want to use a local chat model.
Install LM Studio
Download LM Studio from the official LM Studio download page: https://lmstudio.ai/download
Install it like a normal app for your platform.
On macOS and Windows, open the LM Studio app after installing it. On Linux, follow the install instructions shown on the LM Studio download page.
Add Your First Model
LM Studio needs at least one model before CodeBot can use it.
In LM Studio:
- Open the model search or discovery area.
- Search for a small or medium model.
- Download the model.
- Wait for the download to finish.
- Load the model, if LM Studio asks you to load it before use.
For a first test, choose a smaller model. You can add larger models later after you know the connection works.
Choose a Model
Start with one small or medium model. Bigger models can be smarter, but they need more memory and run more slowly.
| If you want | Try | Why |
|---|---|---|
| A simple first test | A small Llama or Qwen model | Easier to download and faster on laptops. |
| Coding help | A Qwen Coder model | Code-focused models are usually better for programming tasks. |
| Stronger local reasoning | A larger model that fits your computer's memory | Better answers, but slower and more demanding. |
| Quick experiments | Any model LM Studio marks as suitable for your machine | Good way to avoid downloading something too large. |
Do not download many models at once. Start with one model, test it, then add more only if you need them.
Start the Local Server
CodeBot talks to LM Studio through LM Studio's local server.
In LM Studio:
- Open the Developer tab.
- Find the local server section.
- Start the server.
- Use the default port unless you have a reason to change it.
LM Studio's OpenAI-compatible server usually runs at:
http://localhost:1234/v1
Keep LM Studio and its local server running while CodeBot is using it.
Add LM Studio to CodeBot
Once LM Studio is running, at least one model is downloaded, and the local server is started, add it in the app:
- Open the app's Settings.
- Go to CodeBot.
- Click Manage & Add Accounts.
- Add a Local LM Studio account.
- Set the URL to http://localhost:1234/v1
- Save the account.
You normally do not need an API key for local LM Studio.
Use It From CodeBot
Keep LM Studio running in the background. Make sure the local server is started. Then choose the LM Studio account in CodeBot.
CodeBot will ask LM Studio which models are available through the local server. If the model list is empty, download or load a model in LM Studio and try again.
LM Studio is for local chat and reasoning models.
Running LM Studio on Another Computer
You can run LM Studio on another computer on your local network, such as a faster desktop or server.
In that case:
- Configure LM Studio's server so other devices on the local network can reach it.
- Use that computer's local network address in the CodeBot account instead of
localhost.
For example:
http://192.168.1.25:1234/v1
Only do this on a trusted local network. Do not expose LM Studio directly to the public internet.
Troubleshooting
CodeBot Cannot Connect
Check these things:
- LM Studio is open.
- LM Studio's local server is started.
- The CodeBot account URL is http://localhost:1234/v1 if LM Studio is on the same computer.
- If LM Studio is on another computer, the URL uses that computer's local network address.
CodeBot Shows No Models
LM Studio probably does not have a model downloaded or loaded for the server.
Check these things in LM Studio:
- At least one model is downloaded.
- The model download finished successfully.
- The local server is running.
- If LM Studio asks you to load a model, load one and try again.
The Model Is Too Slow
Try a smaller model. Large models need more memory and more time.
Local model speed depends on your computer, available memory and the model size. A small laptop may be fine for short tests but slow for large coding tasks.
The Model Gives Weak Answers
Try a stronger model, a code-focused model, or a hosted provider for demanding work.
Local models can be very useful, but they are not all equally good at coding, planning, long context or tool use. If one local model struggles, try another model that better fits the task.
LM Studio or Ollama?
Both LM Studio and Ollama can run local language models for CodeBot.
Use LM Studio if you want a visual desktop app for browsing, downloading and running models.
Use Ollama if you prefer a simpler command-line workflow.
See Also
- Setting up Ollama for local chat and reasoning
- LM Studio Download
- LM Studio Local Server
- LM Studio Developer Docs