Elffuss BraidHub

kikocis/continue public

8eb3ae7b8d16 · 2.4 KiBRawPermalink
1---
2title: "LM Studio"
3description: "Configure LM Studio with Continue to run open-source models locally, including setup for Llama3.1 8B for chat, embedding models, and instructions for connecting to remote instances"
4---
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## Chat model
9
10We recommend configuring **Llama3.1 8B** as your chat model.
11
12<Tabs>
13 <Tab title="YAML">
14 ```yaml title="config.yaml"
15 models:
16 - name: Llama3.1 8B Instruct
17 provider: lmstudio
18 model: meta-llama-3.1-8b-instruct
19 ```
20 </Tab>
21 <Tab title="JSON">
22 ```json title="config.json"
23 {
24 "models": [
25 {
26 "title": "Llama3.1 8B Instruct",
27 "provider": "lmstudio",
28 "model": "meta-llama-3.1-8b-instruct"
29 }
30 ]
31 }
32 ```
33 </Tab>
34</Tabs>
35
36## Embeddings model
37
38LMStudio supports embeddings endpoints, and comes with the `nomic-ai/nomic-embed-text-v1.5-GGUF` model (as of Nov 2024, check your models)
39
40<Tabs>
41 <Tab title="YAML">
42 ```yaml title="config.yaml"
43 models:
44 - name: Nomic Embed Text
45 provider: lmstudio
46 model: nomic-ai/nomic-embed-text-v1.5-GGUF
47 roles:
48 - embed
49 ```
50 </Tab>
51 <Tab title="JSON">
52 ```json title="config.json"
53 {
54 "embeddingsProvider": {
55 "provider": "lmstudio",
56 "model": "nomic-ai/nomic-embed-text-v1.5-GGUF"
57 }
58 }
59 ```
60 </Tab>
61</Tabs>
62
63## Setting up a remote instance
64
65To configure a remote instance of LM Studio, add the `"apiBase"` property to your model in config.json:
66
67<Tabs>
68 <Tab title="YAML">
69 ```yaml title="config.yaml"
70 models:
71 - name: Llama3.1 8B Instruct
72 provider: lmstudio
73 model: meta-llama-3.1-8b-instruct
74 apiBase: http://<MY ENDPOINT>/v1
75 ```
76 </Tab>
77 <Tab title="JSON">
78 ```json title="config.json"
79 {
80 "models": [
81 {
82 "title": "Llama3.1 8B Instruct",
83 "provider": "lmstudio",
84 "model": "meta-llama-3.1-8b-instruct",
85 "apiBase": "http://<MY ENDPOINT>/v1"
86 }
87 ]
88 }
89 ```
90 </Tab>
91</Tabs>
92
93This `apiBase` will now be used instead of the default `http://localhost:1234/v1`.
94
95[View the source](https://github.com/continuedev/continue/blob/main/core/llm/llms/LMStudio.ts)