Skip to content

Commit 153a818

Browse files
thecatontheflatmrubensellipsis-dev[bot]
authored
Added instructions for configuring Ollama models (#38)
* Update local-models.md * Update docs/advanced-usage/local-models.md Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --------- Co-authored-by: Matt Rubens <[email protected]> Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
1 parent 490213c commit 153a818

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

docs/advanced-usage/local-models.md

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,39 +23,62 @@ Roo Code currently supports two main local model providers:
2323

2424
## Setting Up Ollama
2525

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+
```
2731

2832
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:
2933

3034
* `codellama:7b-code` (good starting point, smaller)
3135
* `codellama:13b-code` (better quality, larger)
3236
* `codellama:34b-code` (even better quality, very large)
37+
* `qwen2.5-coder:32b`
3338
* `mistralai/Mistral-7B-Instruct-v0.1` (good general-purpose model)
3439
* `deepseek-coder:6.7b-base` (good for coding tasks)
3540
* `llama3:8b-instruct-q5_1` (good for general tasks)
3641

3742
To download a model, open your terminal and run:
3843

3944
```bash
40-
ollama run <model_name>
45+
ollama pull <model_name>
4146
```
4247

4348
For example:
4449

4550
```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
4772
```
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+
5274

53-
3. **Configure Roo Code:**
75+
4. **Configure Roo Code:**
5476
* Open the Roo Code sidebar (🚀 icon).
5577
* Click the settings gear icon (⚙️).
5678
* 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`).
5880
* (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.
5982
6083
## Setting Up LM Studio
6184
@@ -85,4 +108,4 @@ Roo Code currently supports two main local model providers:
85108
86109
* **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.
87110
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

Comments
 (0)