You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced-usage/local-models.md
+33-10Lines changed: 33 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,39 +23,62 @@ Roo Code currently supports two main local model providers:
23
23
24
24
## Setting Up Ollama
25
25
26
-
1.**Download and Install Ollama:** Download the Ollama installer for your operating system from the [Ollama website](https://ollama.com/). Follow the installation instructions.
26
+
1.**Download and Install Ollama:** Download the Ollama installer for your operating system from the [Ollama website](https://ollama.com/). Follow the installation instructions. Make sure Ollama is running
27
+
28
+
```bash
29
+
ollama serve
30
+
```
27
31
28
32
2. **Download a Model:** Ollama supports many different models. You can find a list of available models on the [Ollama website](https://ollama.com/library). Some recommended models for coding tasks include:
29
33
30
34
*`codellama:7b-code` (good starting point, smaller)
31
35
*`codellama:13b-code` (better quality, larger)
32
36
*`codellama:34b-code` (even better quality, very large)
*`deepseek-coder:6.7b-base` (good for coding tasks)
35
40
*`llama3:8b-instruct-q5_1` (good for general tasks)
36
41
37
42
To download a model, open your terminal and run:
38
43
39
44
```bash
40
-
ollama run<model_name>
45
+
ollama pull<model_name>
41
46
```
42
47
43
48
For example:
44
49
45
50
```bash
46
-
ollama run codellama:7b-code
51
+
ollama pull qwen2.5-coder:32b
52
+
```
53
+
54
+
3. **Configure the Model:** by default, Ollama uses a context window size of 2048 tokens, which is too small for Roo Code requests. You need to have at least 12k to get decent results, ideally - 32k. To configure a model, you actually need to set its parameters and save a copy of it.
55
+
56
+
Load the model (we will use `qwen2.5-coder:32b` as an example):
57
+
58
+
```bash
59
+
ollama run qwen2.5-coder:32b
60
+
```
61
+
62
+
Change context size parameter:
63
+
64
+
```bash
65
+
/set parameter num_ctx 32768
66
+
```
67
+
68
+
Save the model with a new name:
69
+
70
+
```bash
71
+
/save your_model_name
47
72
```
48
-
49
-
This will download the model and then run it in your terminal. You can type`/bye` to exit the model.
50
-
51
-
**Important:** The first time you run a model, Ollama *must* be running. If you run with a model and Ollama is not open, VSCode may hang.
73
+
52
74
53
-
3. **Configure Roo Code:**
75
+
4. **Configure Roo Code:**
54
76
* Open the Roo Code sidebar (🚀 icon).
55
77
* Click the settings gear icon (⚙️).
56
78
* Select "ollama" as the API Provider.
57
-
* Enter the Model ID (e.g., `codellama:7b-code`).
79
+
* Enter the Model name from the previous step (e.g., `your_model_name`).
58
80
* (Optional) You can configure the base URL if you're running Ollama on a different machine. The default is `http://localhost:11434`.
81
+
* (Optional) Configure Model context size in Advanced settings, so Roo Code knows how to manage its sliding window.
59
82
60
83
## Setting Up LM Studio
61
84
@@ -85,4 +108,4 @@ Roo Code currently supports two main local model providers:
85
108
86
109
* **Slow Response Times:** Local models can be slower than cloud-based models, especially on less powerful hardware. If performance is an issue, try using a smaller model.
87
110
88
-
* **Model Not Found:** Ensure you have typed in the name of the model correctly. If you're using Ollama, use the same name that you provide in the `ollama run` command.
111
+
* **Model Not Found:** Ensure you have typed in the name of the model correctly. If you're using Ollama, use the same name that you provide in the `ollama run` command.
0 commit comments