Skip to content

Commit a490177

Browse files
authored
docs: Update Ollama guide documentation (#7215)
* fix: links * Address PR review feedback from Patrick - Simplify section headers (remove redundant 'How to') - Add version check command after Ollama installation - Expand model recommendations with specific models and memory requirements - Add concrete examples for advanced settings with YAML configuration - Include diagnostic commands (ollama ps, ollama logs) for troubleshooting - Fix Python code formatting in FastAPI example - Update version references to current versions (Ollama v0.5.x, Continue v0.9.x) * Add link to recommended models documentation Link 'Choose models based on your specific needs' section to the official recommended models documentation for additional model options and guidance. * Fix link to use local path instead of full URL Convert external URL to local documentation link for recommended models section. * Update version references to current versions Update Ollama version to v0.11.x and Continue version to v1.1.x to reflect current software versions. * fix: title * docs: fix formatting and add rerank/autocomplete roles to Ollama guide - Fix code block formatting in hub blocks warning section - Add rerank and autocomplete roles to autodetect configuration - Clarify that some roles may need manual configuration with autodetect * fix: mintlify cloud checks links now
1 parent e609c34 commit a490177

File tree

3 files changed

+116
-71
lines changed

3 files changed

+116
-71
lines changed

.github/workflows/docs.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/customize/model-providers/top-level/ollama.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ To configure a remote instance of Ollama, add the `"apiBase"` property to your m
123123
]
124124
}
125125
```
126-
</Tab>
126+
</Tab>
127127
</Tabs>
128128

129129
## How to Configure Model Capabilities in Ollama

docs/guides/ollama-guide.mdx

Lines changed: 115 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Before getting started, ensure your system meets these requirements:
1414

1515
## How to Install Ollama - Step-by-Step
1616

17-
### Step 1: How to Install Ollama
17+
### Step 1: Install Ollama
1818

1919
Choose the installation method for your operating system:
2020

@@ -29,7 +29,7 @@ curl -fsSL https://ollama.ai/install.sh | sh
2929
# Download from ollama.ai
3030
```
3131

32-
### Step 2: How to Start Ollama
32+
### Step 2: Start Ollama Service
3333

3434
After installation, start the Ollama service:
3535

@@ -40,12 +40,17 @@ ollama serve
4040
# Verify it's running
4141
curl http://localhost:11434
4242
# Should return "Ollama is running"
43+
44+
# Check Ollama version
45+
ollama --version
4346
```
4447

45-
### Step 3: How to Download Models
48+
### Step 3: Download Models
4649

4750
<Warning>
48-
**Important**: Always use `ollama pull` instead of `ollama run` to download models. The `run` command starts an interactive session which isn't needed for Continue.
51+
**Important**: Always use `ollama pull` instead of `ollama run` to download
52+
models. The `run` command starts an interactive session which isn't needed for
53+
Continue.
4954
</Warning>
5055

5156
Download models using the exact tag specified:
@@ -62,12 +67,15 @@ ollama list
6267
```
6368

6469
**Common Model Tags:**
70+
6571
- `:latest` - Default version (used if no tag specified)
6672
- `:32b`, `:7b`, `:1.5b` - Parameter count versions
6773
- `:instruct`, `:base` - Model variants
6874

6975
<Note>
70-
If a model page shows `deepseek-r1:32b` on Ollama's website, you must pull it with that exact tag. Using just `deepseek-r1` will pull `:latest` which may be a different size.
76+
If a model page shows `deepseek-r1:32b` on Ollama's website, you must pull it
77+
with that exact tag. Using just `deepseek-r1` will pull `:latest` which may be
78+
a different size.
7179
</Note>
7280

7381
## How to Configure Ollama with Continue
@@ -76,10 +84,9 @@ There are multiple ways to configure Ollama models in Continue:
7684

7785
### Method 1: Using Hub Model Blocks in Local config.yaml
7886

79-
The easiest way is to use pre-configured model blocks from the Continue Hub in your local configuration:
87+
The easiest way is to use [pre-configured model blocks](/reference#local-blocks) from the Continue Hub in your local configuration:
8088

81-
```yaml
82-
# ~/.continue/assistants/My Local Assistant.yaml
89+
```yaml title="~/.continue/assistants/My Local Assistant.yaml"
8390
name: My Local Assistant
8491
version: 0.0.1
8592
schema: v1
@@ -90,20 +97,20 @@ models:
9097
```
9198
9299
<Warning>
93-
**Important**: Hub blocks only provide configuration - you still need to pull the model locally. The hub block `ollama/deepseek-r1-32b` configures Continue to use `model: deepseek-r1:32b`, but the actual model must be installed:
94-
```bash
95-
# Check what the hub block expects (view on hub.continue.dev)
96-
# Then pull that exact model tag locally
97-
ollama pull deepseek-r1:32b # Required for ollama/deepseek-r1-32b hub block
98-
```
99-
If the model isn't installed, Ollama will return: `404 model "deepseek-r1:32b" not found, try pulling it first`
100+
**Important**: Hub blocks only provide configuration - you still need to pull
101+
the model locally. The hub block `ollama/deepseek-r1-32b` configures Continue
102+
to use `model: deepseek-r1:32b`, but the actual model must be installed:
103+
```bash # Check what the hub block expects (view on hub.continue.dev) # Then
104+
pull that exact model tag locally ollama pull deepseek-r1:32b # Required for
105+
ollama/deepseek-r1-32b hub block ``` If the model isn't installed, Ollama will
106+
return: `404 model "deepseek-r1:32b" not found, try pulling it first`
100107
</Warning>
101108

102109
### Method 2: Using Autodetect
103110

104111
Continue can automatically detect available Ollama models. You can configure this in your YAML:
105112

106-
```yaml
113+
```yaml title="~/.continue/config.yaml"
107114
models:
108115
- name: Autodetect
109116
provider: ollama
@@ -112,6 +119,8 @@ models:
112119
- chat
113120
- edit
114121
- apply
122+
- rerank
123+
- autocomplete
115124
```
116125

117126
Or use it through the GUI:
@@ -122,7 +131,12 @@ Or use it through the GUI:
122131
4. Select your desired model from the detected list
123132

124133
<Note>
125-
The Autodetect feature scans your local Ollama installation and lists all available models. When set to `AUTODETECT`, Continue will dynamically populate the model list based on what's installed locally via `ollama list`. This is useful for quickly switching between models without manual configuration.
134+
The Autodetect feature scans your local Ollama installation and lists all
135+
available models. When set to `AUTODETECT`, Continue will dynamically populate
136+
the model list based on what's installed locally via `ollama list`. This is
137+
useful for quickly switching between models without manual configuration. For
138+
any roles not covered by the detected models, you may need to manually
139+
configure them.
126140
</Note>
127141

128142
You can update `apiBase` with the IP address of a remote machine serving Ollama.
@@ -135,12 +149,12 @@ For custom configurations or models not on the hub:
135149
models:
136150
- name: DeepSeek R1 32B
137151
provider: ollama
138-
model: deepseek-r1:32b # Must match exactly what `ollama list` shows
152+
model: deepseek-r1:32b # Must match exactly what `ollama list` shows
139153
apiBase: http://localhost:11434
140154
roles:
141155
- chat
142156
- edit
143-
capabilities: # Add if not auto-detected
157+
capabilities: # Add if not auto-detected
144158
- tool_use
145159
- name: Qwen2.5-Coder 1.5B
146160
provider: ollama
@@ -161,14 +175,16 @@ models:
161175
provider: ollama
162176
model: deepseek-r1:latest
163177
capabilities:
164-
- tool_use # Add this to enable tools
178+
- tool_use # Add this to enable tools
165179
```
166180
167181
<Warning>
168-
**Known Issue**: Some models like DeepSeek R1 may show "Agent mode is not supported" or "does not support tools" even with capabilities configured. This is a known limitation where the model's actual tool support differs from its advertised capabilities.
182+
**Known Issue**: Some models like DeepSeek R1 may show "Agent mode is not
183+
supported" or "does not support tools" even with capabilities configured. This
184+
is a known limitation where the model's actual tool support differs from its
185+
advertised capabilities.
169186
</Warning>
170187
171-
172188
#### If Agent Mode Shows "Not Supported"
173189
174190
1. First, add `capabilities: [tool_use]` to your model config
@@ -181,29 +197,70 @@ See the [Model Capabilities guide](/customize/deep-dives/model-capabilities) for
181197

182198
For optimal performance, consider these advanced configuration options:
183199

184-
- Memory optimization: Adjust `num_ctx` for context window size
185-
- GPU acceleration: Use `num_gpu` to control GPU layers
186-
- Custom model parameters: Temperature, top_p, top_k settings
187-
- Performance tuning: Batch size and threading options
200+
```yaml
201+
models:
202+
- name: Optimized DeepSeek
203+
provider: ollama
204+
model: deepseek-r1:32b
205+
contextLength: 8192 # Adjust context window (default varies by model)
206+
completionOptions:
207+
temperature: 0.7 # Controls randomness (0.0-1.0)
208+
top_p: 0.9 # Nucleus sampling threshold
209+
top_k: 40 # Top-k sampling
210+
num_predict: 2048 # Max tokens to generate
211+
# Ollama-specific options (set via environment or modelfile)
212+
# num_gpu: 35 # Number of GPU layers to offload
213+
# num_thread: 8 # CPU threads to use
214+
```
215+
216+
For GPU acceleration and memory tuning, create an Ollama Modelfile:
217+
218+
```
219+
# Create custom model with optimizations
220+
FROM deepseek-r1:32b
221+
PARAMETER num_gpu 35
222+
PARAMETER num_thread 8
223+
PARAMETER num_ctx 4096
224+
```
188225

189226
## What Are the Best Practices for Ollama
190227

191228
### How to Choose the Right Model
192229

193-
Choose models based on your specific needs:
230+
Choose models based on your specific needs (see [recommended models](/customization/models#recommended-models) for more options):
231+
232+
1. **Code Generation**:
233+
234+
- `qwen2.5-coder:7b` - Excellent for code completion
235+
- `codellama:13b` - Strong general coding support
236+
- `deepseek-coder:6.7b` - Fast and efficient
237+
238+
2. **Chat & Reasoning**:
194239

195-
1. **Code Generation**: Use CodeLlama or Mistral
196-
2. **Chat**: Llama2 or Mistral
197-
3. **Specialized Tasks**: Domain-specific models
240+
- `llama3.1:8b` - Latest Llama with tool support
241+
- `mistral:7b` - Fast and versatile
242+
- `deepseek-r1:32b` - Advanced reasoning capabilities
243+
244+
3. **Autocomplete**:
245+
246+
- `qwen2.5-coder:1.5b` - Lightweight and fast
247+
- `starcoder2:3b` - Optimized for code completion
248+
249+
4. **Memory Requirements**:
250+
- 1.5B-3B models: ~4GB RAM
251+
- 7B models: ~8GB RAM
252+
- 13B models: ~16GB RAM
253+
- 32B models: ~32GB RAM
198254

199255
### How to Optimize Performance
200256

201257
To get the best performance from Ollama:
202258

203-
- Monitor system resources
204-
- Adjust context window size
205-
- Use appropriate model sizes
206-
- Enable GPU acceleration when available
259+
- Monitor system resources with `ollama ps` to see memory usage
260+
- Adjust context window size based on available RAM
261+
- Use appropriate model sizes for your hardware
262+
- Enable GPU acceleration when available (NVIDIA CUDA or AMD ROCm)
263+
- Use `ollama logs` to debug performance issues
207264

208265
## How to Troubleshoot Ollama Issues
209266

@@ -214,7 +271,8 @@ To get the best performance from Ollama:
214271
This error occurs when the model isn't installed locally:
215272

216273
**Problem**: Using a hub block or config that references a model not yet pulled
217-
**Solution**:
274+
**Solution**:
275+
218276
```bash
219277
# Check what models you have
220278
ollama list
@@ -227,6 +285,7 @@ ollama pull model-name:tag # e.g., deepseek-r1:32b
227285

228286
**Problem**: `ollama pull deepseek-r1` installs `:latest` but hub block expects `:32b`
229287
**Solution**: Always pull with the exact tag:
288+
230289
```bash
231290
# Wrong - pulls :latest
232291
ollama pull deepseek-r1
@@ -239,6 +298,7 @@ ollama pull deepseek-r1:32b
239298

240299
**Problem**: Model doesn't support tools/function calling
241300
**Solutions**:
301+
242302
1. Add `capabilities: [tool_use]` to your model config
243303
2. If still not working, the model may not actually support tools
244304
3. Switch to a model with confirmed tool support (Llama 3.1, Mistral)
@@ -247,6 +307,7 @@ ollama pull deepseek-r1:32b
247307

248308
**Problem**: Unclear how to use hub models locally
249309
**Solution**: Create a local assistant file:
310+
250311
```yaml
251312
# ~/.continue/assistants/Local.yaml
252313
name: Local Assistant
@@ -269,13 +330,29 @@ models:
269330
- Model too large: Check available memory with `ollama ps`
270331
- GPU issues: Verify CUDA/ROCm installation for GPU acceleration
271332
- Slow generation: Adjust `num_gpu` layers in model configuration
333+
- Check system diagnostics: `ollama ps` for active models and memory usage
272334

273335
## What Are Example Workflows with Ollama
274336

275337
### How to Use Ollama for Code Generation
276338

277-
```
278-
# Example: Generate a FastAPI endpointdef create_user_endpoint(): # Continue will help generate the implementation pass
339+
```python
340+
# Example: Generate a FastAPI endpoint
341+
from fastapi import FastAPI, HTTPException
342+
from pydantic import BaseModel
343+
344+
app = FastAPI()
345+
346+
class User(BaseModel):
347+
name: str
348+
email: str
349+
age: int
350+
351+
@app.post("/users/")
352+
async def create_user(user: User):
353+
# Continue will help complete this implementation
354+
# Use Cmd+I (Mac) or Ctrl+I (Windows/Linux) to generate code
355+
pass
279356
```
280357

281358
### How to Use Ollama for Code Review
@@ -293,4 +370,4 @@ Ollama with Continue provides a powerful local development environment for AI-as
293370

294371
---
295372

296-
_This guide is based on Ollama v0.1.x and Continue v0.8.x. Please check for updates regularly._
373+
_This guide is based on Ollama v0.11.x and Continue v1.1.x. Please check for updates regularly._

0 commit comments

Comments
 (0)