LM Studio (Local)
Local models with an OpenAI-compatible server
LM Studio is a desktop app for discovering, downloading, and running open-weight models locally — with a friendly GUI for picking quantizations and monitoring resource use. It exposes the models through a local OpenAI-style server that Nexgile Code connects to directly, so everything runs offline on your hardware.
Set up LM Studio
Section titled “Set up LM Studio”- Install LM Studio from
lmstudio.ai. - Use its built-in browser to download a model. Favor instruction-tuned models with tool-calling support and pick the largest quantization your RAM/VRAM handles comfortably.
- Start the local server — this is the step people miss. Open LM Studio’s server (Developer) tab, load your model, and start the server. By default it listens on
http://localhost:1234.
The product’s own settings panel reminds you of this: you must start LM Studio’s local server feature to use it with the agent.
Configure in Nx IDE
Section titled “Configure in Nx IDE”- Open Settings → Providers and choose LM Studio.
- Base URL (optional) — leave empty for the default
http://localhost:1234; set it only for a non-standard port or a server on another machine. - Model ID — the picker lists the models your LM Studio server currently exposes, e.g.
meta-llama-3.1-8b-instruct. If nothing shows up, the server isn’t running or has no model loaded.
Speculative decoding (optional)
Section titled “Speculative decoding (optional)”LM Studio supports speculative decoding: a small “draft” model proposes tokens that the main model verifies, which can speed up generation noticeably on capable hardware.
- Check Enable Speculative Decoding.
- Pick a Draft Model ID — the panel warns that the draft model must be from the same model family as the main model for this to work correctly (e.g. a 1B Llama drafting for an 8B Llama).
- Load the draft model in LM Studio too; if the panel reports no draft models found, confirm the server is running in server mode.
Picking models
Section titled “Picking models”- Coding-tuned first: models tuned for code and instruction following behave far better under the agent’s structured prompting than generic chat models.
- Context window: configure a generous context length when loading the model in LM Studio — agent prompts are large, and a small window silently truncates instructions. Symptoms of a too-small window: the agent “forgets” what it was doing or emits malformed tool calls.
- Bigger beats faster for agent reliability. If responses are poor, try a larger model or a less aggressive quantization before blaming the setup.
Behavior defaults
Section titled “Behavior defaults”Nexgile Code applies a default temperature of 0 for LM Studio models — deterministic output suits code edits, and small local models drift badly at higher temperatures. Override it with Use custom temperature in the profile if you want more variety; see Model Behavior & Costs.
A working profile looks like this:
Provider: LM StudioBase URL: (empty — uses http://localhost:1234)Model ID: meta-llama-3.1-8b-instructSpeculative: enabled, draft lmstudio-community/llama-3.2-1b-instructOffline use
Section titled “Offline use”Once the model files are downloaded, LM Studio needs no network at all. Combined with Nexgile Code the whole agent loop — prompts, code, diffs, terminal output — stays on your machine. The same realistic-expectations note from the settings panel applies here: the agent works best with highly capable models, and small local models may not handle complex multi-step tasks as expected. Keep tasks scoped, keep approvals on, and lean on checkpoints.
Choosing between the two local options: Ollama is CLI-first and scripts cleanly; LM Studio gives you a GUI, easy quantization switching, and speculative decoding. Nexgile Code treats both as first-class — run whichever fits your workflow, or both as separate configuration profiles.
Troubleshooting
Section titled “Troubleshooting”- Model picker is empty: the local server isn’t running, or no model is loaded into it. Start the server in LM Studio’s server tab and load a model, then reopen the settings panel.
- “No draft models found”: the panel shows this when speculative decoding is enabled but the server exposes no candidate drafts — confirm LM Studio is running with server mode enabled and the draft model is downloaded.
- Selected model flagged as unavailable: the panel warns when your saved Model ID no longer matches anything the server reports. Re-select from the picker.
- Requests time out on big prompts: raise
nexgile-code.apiRequestTimeout, and consider a smaller model or shorter context if generation is too slow for your hardware. - Garbled or non-working tool calls: the model is too small or not instruction-tuned for structured agent output; switch models rather than fighting the prompt.