LM Studio is a desktop app for downloading and chatting with local models, but it can also serve those models over HTTP. If another app expects an OpenAI-style API, you can often point it at LM Studio on your PC instead of at a cloud endpoint.
Forge PC has not measured throughput through this server, and we have not audited every client library. The steps and URLs below come from LM Studio's official developer documentation.
This page assumes you already have LM Studio installed and at least one model downloaded. Our Ollama and LM Studio install guide covers that, and our guide to GGUF quantisation explains the file names you will see in the catalogue. This article does not walk through picking a model file again.
Start the server
LM Studio's developer docs say you can serve models from the Developer tab, on localhost or on the network.
To start it in the app, open the Developer tab and toggle Start server.
To start it from a terminal, use LM Studio's CLI:
lms server start
The official OpenAI-compatibility examples assume the server port is 1234, so a typical base URL is:
http://localhost:1234/v1
If you have changed the port in Server Settings, use that port instead. The documentation also covers serving on the local network, authentication, running LM Studio as a headless service, idle TTL and auto-evict. For a first test, leave the server on localhost only.
Load a model in LM Studio before you send a request, or the client will have nothing to talk to. The REST API can also list, load and unload models, but the app's own loader is the straightforward route for a first check.
Send an OpenAI-compatible request
LM Studio documents OpenAI-compatible endpoints including:
The official curl example for chat looks like this, with the model identifier taken from LM Studio rather than copied from OpenAI:
curl http://localhost:1234/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "use the model identifier from LM Studio here",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"temperature": 0.7
}'
Replace the model string with the identifier shown in LM Studio for the loaded model.
In Python, the official snippet is to point the OpenAI client at the local base URL:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:1234/v1")
Then call client.chat.completions.create as you would against OpenAI, using your local model name. The TypeScript example sets baseUrl to the same path.
LM Studio also implements POST /v1/responses, which its docs say is why Codex can be pointed at LM Studio. That is a compatibility note, not a requirement for ordinary chat scripts.
There is a separate LM Studio REST API, with its own quick start, that can report details such as tokens per second and whether a model is loaded. You do not need it for a first OpenAI-compatible chat request.
LM Studio and Ollama are different servers
If you already run Ollama, do not assume the two servers are interchangeable without changing the URL.
LM Studio's documented default is port 1234, base URL http://localhost:1234/v1.
Ollama's documented local OpenAI-compatible base URL is http://localhost:11434/v1.
They can both be installed on the same PC, but they should not both try to bind the same port, and a client must point at the server that actually has the model loaded. Keep both on localhost unless you have followed the vendor's guidance for authentication and network access.
If a request fails, check that the server toggle is on, that a model is loaded, that the port in the URL matches Server Settings, and that the model field matches an identifier LM Studio actually lists.
Keep the server local unless you mean to share it
LM Studio can serve on the local network, and the developer docs have separate pages for authentication, LM Link, and running the app as a headless service. Those are optional. A first setup should stay on localhost. If you later toggle "Serve on Local Network", you are letting other devices on that network reach a model that can read whatever you send it. Use the official authentication guidance before you do that, and do not port-forward 1234 to the internet as a shortcut.
If you start the server and a request still fails, work through a short list:
Is the Developer tab server switch on, or did lms server start actually succeed?
Is a model loaded, and does the model field match the identifier in the app?
Does the URL use the port shown in Server Settings, not an assumed 1234 after you changed it?
Is something else already bound to that port? The official default is 1234, which is easy to collide with if you have another local tool using it.
The REST API can list loaded versus unloaded models if you want to inspect state from a script. For everyday use, looking at the Developer tab is enough.
Our verdict
Open LM Studio's Developer tab, start the server, load a model, and point an OpenAI-compatible client at http://localhost:1234/v1. Use the model identifier from the app, and leave the server on localhost until you have a reason to share it. We have not benchmarked this API; the steps come from LM Studio's official developer documentation.