Executable programs and extensions

LM Studio: choose a model visually and connect it to your app

Attaching a document and asking questions in LM Studio is straightforward. Connect the same model to another program, though, and it may know nothing about that document. The model may be unchanged; work previously handled by the app may be missing. Let's separate using the interface from using the server.

Understand what the interface was doing for you

LM Studio brings model search, file management, chat and settings into one interface. If you often switch models to compare answers or chat with documents, you can spend time examining the results rather than first learning launch commands.

Document chat involves placing short material in context or retrieving relevant portions of longer material. An external app calling the same model's API does not inherit that process or those attachments. To use documents in your own program, you must also implement how relevant content is selected and included in requests.

On a Mac, look beyond the model name

LM Studio runs GGUF models through llama.cpp and also supports MLX on Apple Silicon Macs. Two files with the same model name are not interchangeable formats. For a comparison, record the model revision, quantization, context and runtime used.

The app has its own system requirements. Current documentation requires Apple Silicon and macOS 14 or later on a Mac, with no Intel Mac support. Windows x64 systems need AVX2 support. Being able to install the app does not mean you have enough memory to load a large model.

Is memory short, or is the context too large?

Download the model you intend to use and begin with a short context. Add --estimate-only to lms load to estimate memory without loading it. That estimate cannot guarantee how other apps or runtime changes will affect memory, so check the state after loading as well.

The first command below lets you select a downloaded model and gives it the API name local-guide. The 4,096-token context is for a short check. Increase it as needed for longer documents, but do not change context and GPU settings together at the start. You need a baseline to return to when something goes wrong.

Select a downloaded model and start the server

lms load --context-length 4096 --identifier local-guide
lms server start --bind 127.0.0.1 --port 1234

Run this where LM Studio and lms are already set up. Finish selecting a model in the first command before starting the server. Do not start a duplicate server if one is already running.

Check the model alias and address

Check that the server is running, then send the request below. local-guide is the API alias set earlier, not a filename. Configure the external app with 127.0.0.1:1234 and the API path it requires. Clients that accept a base URL generally expect it to include /v1.

If there is no response, check the model name, server port and authentication settings in that order. If authentication is enabled, add your issued token to the request headers. Do not enable network access or CORS indiscriminately to fix a connection error. This setup assumes connections from the same computer only.

Check a response using the API alias

curl -sS http://127.0.0.1:1234/v1/chat/completions -H "Content-Type: application/json" -d '{"model":"local-guide","messages":[{"role":"user","content":"Reply with one short sentence."}],"max_tokens":128,"stream":false}'

This checks a local server without authentication enabled. It receives the completed answer at once, so do not use it to measure time to first token.

When answers change in the same app

If a previously useful model starts repeating itself or ignoring formats, engine speed is not the first suspect. Check whether the model file, chat template or generation settings changed. If a new model will not load, check the runtime's support as well as the app version.

Test tool calls separately from ordinary chat. Accepting a request is different from returning a tool call in a format the app understands. Start with a short conversation, then one required tool, then the actual task to find the stage where things go wrong.

When you want to keep it running without the interface

LM Studio also offers llmster, a separate daemon for serving without the GUI. Using a server therefore does not automatically mean switching products. Startup, updates and recovery after a reboot still need preparation beyond desktop chat.

If you need finer control over a particular acceleration method or file format, read the relevant engine guide. First record the model, runtime and settings that work. Keeping a configuration you can return to makes it easier to judge whether the change was worthwhile.

Change log

These entries record changes to the site's guidance. They do not automatically check your installed engine or model version.

  1. Added LM Studio model-loading and API guidance

    Added examples that set a context length and identifier when loading a model, then use the same name in a local API request. It distinguishes MLX and GGUF paths and explains that documents added in the app are not automatically included in API requests.