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