| 1 | --- |
| 2 | title: "LM Studio" |
| 3 | --- |
| 4 | |
| 5 | [LM Studio](https://lmstudio.ai) is an application for Mac, Windows, and Linux that makes it easy to locally run open-source models and comes with a great UI. To get started with LM Studio, download from the website, use the UI to download a model, and then start the local inference server. Continue can then be configured to use the `LMStudio` LLM class: |
| 6 | |
| 7 | <Tabs> |
| 8 | <Tab title="YAML"> |
| 9 | ```yaml title="config.yaml" |
| 10 | models: |
| 11 | - name: LM Studio |
| 12 | provider: lmstudio |
| 13 | model: llama2-7b |
| 14 | ``` |
| 15 | </Tab> |
| 16 | <Tab title="JSON"> |
| 17 | ```json title="config.json" |
| 18 | { |
| 19 | "models": [ |
| 20 | { |
| 21 | "title": "LM Studio", |
| 22 | "provider": "lmstudio", |
| 23 | "model": "llama2-7b" |
| 24 | } |
| 25 | ] |
| 26 | } |
| 27 | ``` |
| 28 | </Tab> |
| 29 | </Tabs> |
| 30 | |
| 31 | ### Embeddings model |
| 32 | |
| 33 | LMStudio supports embeddings endpoints, and comes with the `nomic-ai/nomic-embed-text-v1.5-GGUF` model (as of Nov 2024, check your models) |
| 34 | |
| 35 | <Tabs> |
| 36 | <Tab title="YAML"> |
| 37 | ```yaml title="config.yaml" |
| 38 | models: |
| 39 | - name: Nomic Embed Text |
| 40 | provider: lmstudio |
| 41 | model: nomic-ai/nomic-embed-text-v1.5-GGUF |
| 42 | roles: |
| 43 | - embed |
| 44 | ``` |
| 45 | </Tab> |
| 46 | <Tab title="JSON"> |
| 47 | ```json title="config.json" |
| 48 | { |
| 49 | "embeddingsProvider": { |
| 50 | "provider": "lmstudio", |
| 51 | "model": "nomic-ai/nomic-embed-text-v1.5-GGUF" |
| 52 | } |
| 53 | } |
| 54 | ``` |
| 55 | </Tab> |
| 56 | </Tabs> |
| 57 | |
| 58 | ## Setting up a remote instance |
| 59 | |
| 60 | To configure a remote instance of LM Studio, add the `"apiBase"` property to your model in config.json: |
| 61 | |
| 62 | <Tabs> |
| 63 | <Tab title="YAML"> |
| 64 | ```yaml title="config.yaml" |
| 65 | models: |
| 66 | - name: Nomic Embed Text |
| 67 | provider: lmstudio |
| 68 | model: nomic-ai/nomic-embed-text-v1.5-GGUF |
| 69 | roles: |
| 70 | - embed |
| 71 | ``` |
| 72 | </Tab> |
| 73 | <Tab title="JSON"> |
| 74 | ```json title="config.json" |
| 75 | { |
| 76 | "embeddingsProvider": { |
| 77 | "provider": "lmstudio", |
| 78 | "model": "nomic-ai/nomic-embed-text-v1.5-GGUF" |
| 79 | } |
| 80 | } |
| 81 | ``` |
| 82 | </Tab> |
| 83 | </Tabs> |
| 84 | |
| 85 | This `apiBase` will now be used instead of the default `http://localhost:1234/v1`. |
| 86 | |
| 87 | [View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/LMStudio.ts) |