> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# LM Studio

> Run local models with LM Studio in Agno agents.

[LM Studio](https://lmstudio.ai) runs open-source models locally through a desktop app with an OpenAI-compatible local server.

LM Studio supports multiple open-source models. See the library [here](https://lmstudio.ai/models).

We recommend experimenting to find the best-suited model for your use case. Here are some general recommendations:

* `llama3.3` models are good for most basic use cases.
* `qwen` models perform specifically well with tool use.
* `deepseek-r1` models have strong reasoning capabilities.
* `phi4` models offer strong performance at a small size.

## Set up a model

Install [LM Studio](https://lmstudio.ai), download the model you want to use, and run it.

## Example

After you have the model locally, use the `LMStudio` model class to access it. It uses the OpenAI client, so install the `openai` package:

```bash theme={null}
uv pip install -U openai agno
```

<CodeGroup>
  ```python agent.py theme={null}
  from agno.agent import Agent
  from agno.models.lmstudio import LMStudio

  agent = Agent(
      model=LMStudio(id="qwen2.5-7b-instruct-1m"),
      markdown=True
  )

  # Print the response in the terminal
  agent.print_response("Share a 2 sentence horror story.")
  ```
</CodeGroup>

<Note> View more examples [here](/models/providers/local/lmstudio/usage/basic-stream). </Note>

## Params

| Parameter  | Type            | Default                      | Description                                             |
| ---------- | --------------- | ---------------------------- | ------------------------------------------------------- |
| `id`       | `str`           | `"qwen2.5-7b-instruct-1m"`   | The id of the LMStudio model to use                     |
| `name`     | `str`           | `"LMStudio"`                 | The name of the model                                   |
| `provider` | `str`           | `"LMStudio"`                 | The provider of the model                               |
| `api_key`  | `Optional[str]` | `"not-provided"`             | The API key for LMStudio (usually not needed for local) |
| `base_url` | `str`           | `"http://127.0.0.1:1234/v1"` | The base URL for the local LMStudio server              |

`LMStudio` is a subclass of the [OpenAILike](/models/providers/openai-like) class and has access to the same params.
