Setup guide - Documented by Aider
Use LM Studio in Aider
Aider documents LM Studio through the lm_studio/ model prefix plus the LM_STUDIO_API_KEY and LM_STUDIO_API_BASE environment variables.
Last verified 3 steps1 official source
Steps
- Step 1.
Install aider.
Terminalpython -m pip install aider-install aider-install - Step 2.
Configure your API key and endpoint. A value must be set for the key even if it is a dummy value.
Terminal# Must set a value here even if its a dummy value export LM_STUDIO_API_KEY=dummy-api-key # Mac/Linux setx LM_STUDIO_API_KEY dummy-api-key # Windows, restart shell after setx # LM Studio default server URL is http://localhost:1234/v1 export LM_STUDIO_API_BASE=http://localhost:1234/v1 # Mac/Linux setx LM_STUDIO_API_BASE http://localhost:1234/v1 # Windows, restart shell after setx - Step 3.
Start working with aider and LM Studio on your codebase.
Terminal# Change directory into your codebase cd /to/your/project aider --model lm_studio/<your-model-name>
Caveats
- Aider note: 'Even though LM Studio doesn't require an API Key out of the box the LM_STUDIO_API_KEY must have a dummy value like dummy-api-key set or the client request will fail trying to send an empty Bearer token.'
- Aider warns about models it is not familiar with (see aider.chat/docs/llms/warnings.html). The page gives no specific model id.
More setup guides
Same tool, other providers
Related reading
- LM Studio Bionic: A Local-First AI Agent for Open ModelsLM Studio launches Bionic, a standalone agent harness for open models with local inference, voice input, and zero data retention cloud options.
- Ollama vs LM Studio vs vLLM vs llama.cpp: Picking a Local Runtime for Coding AgentsOllama vs LM Studio vs vLLM vs llama.cpp for coding agents: what each local runtime is for, where they overlap, and which to pick for your setup.
- Aider vs Claude Code in 2026: Git-First Open Source vs Subagent RuntimeAider vs Claude Code: git-first, model-agnostic Aider against the Claude Code runtime of subagents and hooks. Compare architecture, cost, governance and fit.
- Aider vs Claude Code: Open Source vs Commercial AI Coding CLIAider is open source and works with any model. Claude Code is Anthropic's commercial agent. Here is how they compare for TypeScript.
FAQ
How do I use LM Studio in Aider?
Aider documents LM Studio through the lm_studio/ model prefix plus the LM_STUDIO_API_KEY and LM_STUDIO_API_BASE environment variables.
Which environment variables does Aider need for LM Studio?
Set LM_STUDIO_API_KEY and LM_STUDIO_API_BASE. Requests go to http://localhost:1234/v1.
Is this an official LM Studio and Aider setup?
Aider documents this setup in its own docs. It was last checked against 1 official page on October 17, 2026.
Sources
Last verified against 1 official page.
Newsletter
New models, set up the day they ship
One email per week. New model releases, the coding tools that support them and how to wire them up.