Use LM Studio as a coding agent

Load a model in LM Studio, start its local server, and run oharness -m lmstudio/<model-id>. The lmstudio provider is built in at localhost:1234 with no key.

Three steps

  1. Load a tool-calling model in LM Studio and set its context length to 32K or more.
  2. Start the server from the Developer tab, or with lms server start.
  3. Start the agent with the model id LM Studio shows. Only the first slash separates the provider, so ids with a slash of their own work as they are.
npm install -g oharness
oharness -m lmstudio/qwen/qwen3-coder-30b

Worth knowing

  • /models lists what the LM Studio server has loaded; /models refresh asks again after you load another.
  • If the context length is left low, long sessions are truncated by the server before OHarness compacts them.
  • Running fully offline covers the remaining network traffic.

Common questions

Can LM Studio run a coding agent?

LM Studio serves the model; the agent loop comes from a harness. OHarness connects to LM Studio's local server at localhost:1234 as a built-in provider, with no key.

What model id do I use for LM Studio in OHarness?

The id LM Studio shows for the loaded model, prefixed with lmstudio/ — for example oharness -m lmstudio/qwen/qwen3-coder-30b.

LM Studio reference

Provider idlmstudio
Base URLhttp://localhost:1234/v1
ProtocolOpenAI-compatible chat completions
API keyNone — the endpoint is local.
Model discoveryYes — the model list is asked of the endpoint rather than shipped.

Connecting it

Nothing to configure and no key to obtain. Start the server on its usual port and the provider appears in the model picker; the harness asks it for its own model list rather than shipping one.

Models on LM Studio

The newest models LM Studio serves that can call tools, from the models.dev snapshot OHarness ships. The harness also asks the endpoint for its live list, so a model released after this snapshot still appears in the picker.

Model idContext / output$/M in / cached / outReasoning
openai/gpt-oss-20b131K / 33K0 / — / 0Yes
qwen/qwen3-30b-a3b-2507262K / 16K0 / — / 0No
qwen/qwen3-coder-30b262K / 66K0 / — / 0No

List prices in USD per million tokens, read from models.dev on 2026-09-19. LM Studio changes its prices and models; its own pricing page is the authority. Start a session on the newest:

oharness -m lmstudio/openai/gpt-oss-20b

Pointing it somewhere else

A regional host, a gateway, or a server of your own. Overrides in ~/.oharness/config.json are field level, so changing the endpoint does not mean restating the rest of the provider — this is the whole block, shown holding the default so the shape is clear:

{
  "providers": {
    "lmstudio": {
      "baseUrl": "http://localhost:1234/v1"
    }
  }
}

What you get either way

The same agent loop, the same tools, the same MCP servers and the same permission rules, whichever provider is underneath — and switching between them mid-session converts nothing, because history is never stored in a vendor’s shape. What an agent harness is covers why that is the hard part, and the providers reference covers the catalogue itself.

All 34 providers · Install OHarness