Skip to main content
Watch: I Built an AI App Without Leaving Databricks

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

  1. Step 1.

    Install aider.

    Terminal
    python -m pip install aider-install
    aider-install
  2. 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
  3. 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.

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.