Connect Continue in VS Code to LM Studio by adding a model with provider lmstudio and the chat role in Continue’s local configuration. Use LM Studio’s loopback API address and the exact model ID its server returns. Select that model in Continue Chat and send a small code question whose answer you can verify.
This guide assumes the Continue extension and LM Studio are installed, with a text model downloaded in LM Studio. Open a normal local VS Code window on the same Mac as the model server. A remote editor window can run extensions in a different environment, where your Mac’s loopback address has a different meaning. The steps below use the local desktop setup and a single chat role to make the result easy to verify. Continue’s LM Studio provider configuration · Run a first local chat in LM Studio
Use a scratch folder for the first editor checks. That gives you control over the context included in the conversation and makes the expected result visible without opening a development project. Keep the example in a local directory. If you usually develop in a remote editor session, open a separate local window for the trial. The loopback address applies to the process that makes the connection, so local and remote editor setups need to be verified in their own contexts.
Check the model ID in LM Studio
Open the LM Studio Developer tab and start the API server if needed. Keep Serve on Local Network off for this same-Mac setup. Load the local chat model you intend to use and note the port shown in LM Studio. The usual port is 1234. Use the actual local port consistently if you changed it. Start the LM Studio API server.
Continue will need the model identifier that the server accepts in API requests. The model may have a friendlier name in its chooser. Confirm the server’s exact ID from its OpenAI-compatible model list. This example uses the default local port. If you require authentication in LM Studio, include a Bearer header with your local token as described in the server documentation.
curl -sS -i --noproxy 127.0.0.1 --max-time 10 \
'http://127.0.0.1:1234/v1/models'
Look for a successful HTTP response and locate the selected model’s id in the JSON. The list can include downloaded models available for loading when just-in-time loading is enabled. Checking your intended model in LM Studio before continuing makes the first inference easier to interpret. If the request fails, fix the address, port, server state, or authentication before switching to VS Code. LM Studio’s model-list endpoint · LM Studio’s API token guide.
Add a chat-only entry in Continue’s local YAML
Open the Continue Chat sidebar. Use the configuration selector above the chat input and click the gear next to Local Config. On macOS the local file is normally ~/.continue/config.yaml. If it already contains models or settings you use, save a copy in your local configuration folder. Then add the following entry under the existing models list. For a fresh configuration, the whole example shows the surrounding fields. How to open the Continue local configuration.
name: Local Chat
version: 1.0.0
schema: v1
models:
- name: LM Studio on this Mac
provider: lmstudio
model: "REPLACE_WITH_ID_FROM_MODEL_LIST"
apiBase: "http://127.0.0.1:1234/v1"
roles:
- chat
Replace the quoted placeholder with the full ID from the API response. The name field is the label you choose for Continue, while model is the identifier sent to the server. Keep the apiBase value at the version root. Continue uses the base address to send its own requests. If the model list works at a different port, change the port in the configuration to match.
The explicit chat role gives this entry one task. Continue’s configuration supports separate model roles for actions such as autocomplete and applying edits. Chatting with the model and seeing an inline code suggestion are separate checks. This entry is intended for the chat panel, so you can confirm the route before deciding whether to set up anything else. Continue’s model roles and YAML reference.
If your config already has an autocomplete or editing model, leave its role and settings in place. Add the new chat entry as another item at the same level in the models list. Giving this entry a distinctive display name helps you select the model intentionally in the chat dropdown. After saving, check that the active config contains the new entry and that the chat dropdown shows it. This gives you an independent editor-side confirmation before a request goes to the local server.
Use a local token if the server requires one
If Require Authentication is off, leave the token field out of the example. If it is on, use an LM Studio token in Continue’s supported secret configuration. In your private local ~/.continue/.env file, add a variable named LOCAL_LM_STUDIO_TOKEN containing the token. Then add this line at the same indentation level as provider in the model’s YAML entry.
apiKey: ${{ secrets.LOCAL_LM_STUDIO_TOKEN }}
Continue documents a search order that includes workspace secrets and global local secrets. An existing variable with the same name in a test workspace can take precedence. Choose a unique name if you need to avoid a collision. Keep the secret value in the local environment file, outside shared configuration. Save the changes and restart VS Code after adding or changing secrets, following Continue’s instructions. Continue’s local secret configuration.
Ask one small code question in Continue Chat
Save the configuration and select Local Config. Continue normally reloads the saved YAML automatically. Check the model dropdown and pick LM Studio on this Mac or the display name you chose. Open a new chat in Chat mode. Start with a scratch question that you can paste directly into the message, with no project context or attachments required.
Here is a Python function.
def dispatch_label(priority):
if priority == "rush":
return "Blue"
return "Gray"
What string does dispatch_label("rush") return?
Answer with just the string.
The expected answer is Blue. Check that the reply completes and look for corresponding activity in LM Studio at the time you send the question. This distinguishes the selected model working through Continue from a working LM Studio chat on its own. Checking server activity also helps if multiple Continue configurations show similar model names.
In a fresh chat, ask what the same function returns for "standard". The expected answer is Gray. A changed result from a new question is a useful repeat check. You can then try a short piece of your own code in the same chat mode. Keep the first tests small enough to tell whether the editor route works before comparing model capabilities on a larger task.
Verify one explicit piece of editor context
Paste the function into a new scratch file and save it under a name you can recognize. In the editor, change Blue to Amber and save the file. Start a fresh Continue chat and select the function in the editor. Press Command-L to include that selection in the new chat, as described in Continue’s VS Code shortcuts. Inspect the chat input to confirm the intended code was attached before asking what the function returns for rush.
The expected answer is now Amber. The changed return value gives you evidence that the current selection reached the chat. If the reply says Blue, check the selection and any older conversation content first. Reopen a fresh chat and send only the current function. The initial pasted question and this editor selection check exercise two different inputs while keeping the same local connection. Continue’s guide to attaching selected code.
With the LM Studio command-line tool installed, you can also monitor HTTP request logs from a second Terminal window. Watch the new chat request and its status while comparing the result in Continue. Stop the log stream when you finish the test. If the presence of the selected code remains uncertain, LM Studio’s model-input log stream can show the formatted prompt for the scratch example. That makes it possible to compare what the extension sent with the selection in your editor. LM Studio’s model and server log streams.
lms log stream --source server
Find the first failing part
If Continue reports a configuration error, check the YAML structure before changing the connection. Use spaces for indentation and keep the model entry under the existing models list. Use the config selector to reopen the active local file. A second top-level key or an entry placed outside the list can prevent Continue from loading the profile. Check the editor’s YAML diagnostics and verify the entry appears in the chat model selector after you save.
If the entry appears and the connection fails, run the model-list command again from the Mac. A refused connection points you to the server state and port. An authentication error from a token-protected server calls for checking the LM Studio token and the secret Continue reads. If the list works and the server reports an unknown model on a chat request, compare the exact ID in the list with the model value in YAML. Use the ID in a direct chat request if you need to distinguish a working listing from working inference. LM Studio’s direct chat endpoint.
If the direct request works and Continue produces no corresponding local server activity, check that you are in the local VS Code window and have selected the intended configuration and chat model. Remove any unrelated context from the next prompt. Restore the saved local config copy if you need to return to your prior setup. Once the small test passes, keep a note of the API address, actual model ID, and passing prompt so you can repeat the check after a model or editor update.
If your first request with selected code completes and a later long thread stalls, try a fresh chat with a shorter section of the same code. Keep the model and base address fixed. A connection problem and a request that exceeds the model’s usable context call for different changes. A passing short request gives you a practical way to narrow the failure before switching settings. Record whether extra editor context was attached and roughly how large it was so you can reproduce the same test.