Update Ollama guide documentation

This commit is contained in:
Brian 'bdougie' Douglas 2025-08-18 10:44:43 -04:00
parent 28ff45686f
commit 33ecef9f22

View file

@ -29,57 +29,160 @@ curl -fsSL https://ollama.ai/install.sh | sh
# Download from ollama.ai
```
### Step 2: How to Download Models
### Step 2: How to Start Ollama
After installing Ollama, download the models you want to use. Here are some popular options:
After installation, start the Ollama service:
```bash
# Start Ollama (runs in background)
ollama serve
# Verify it's running
curl http://localhost:11434
# Should return "Ollama is running"
```
# Popular models for development
ollama pull mistral
ollama pull qwen2.5-coder:1.5b-base
ollama pull nomic-embed-text:latest
### Step 3: How to Download Models
<Warning>
**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.
</Warning>
Download models using the exact tag specified:
```bash
# Pull models with specific tags
ollama pull deepseek-r1:32b # 32B parameter version
ollama pull deepseek-r1:latest # Latest/default version
ollama pull mistral:latest
ollama pull qwen2.5-coder:1.5b
# List all downloaded models
ollama list
```
**Common Model Tags:**
- `:latest` - Default version (used if no tag specified)
- `:32b`, `:7b`, `:1.5b` - Parameter count versions
- `:instruct`, `:base` - Model variants
<Note>
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.
</Note>
## How to Configure Ollama with Continue
Configure Continue to work with your local Ollama instance:
There are multiple ways to configure Ollama models in Continue:
### How to Set Up Continue Configuration
### Method 1: Using Hub Model Blocks in Local config.yaml
The easiest way is to use pre-configured model blocks from the Continue Hub in your local configuration:
```yaml
# ~/.continue/assistants/My Local Assistant.yaml
name: My Local Assistant
version: 0.0.1
schema: v1
models:
- uses: ollama/deepseek-r1-32b
- uses: ollama/qwen2.5-coder-7b
- uses: ollama/mistral
```
<Warning>
**Important**: When using hub blocks like `ollama/deepseek-r1-32b`, you must first pull the exact model locally:
```bash
# The hub block name must match the pulled model
ollama pull deepseek-r1:32b # For ollama/deepseek-r1-32b hub block
```
If the model isn't pulled, you'll get: `Error: 404 model "deepseek-r1:32b" not found, try pulling it first`
</Warning>
### Method 2: Manual Configuration
For custom configurations or models not on the hub:
```yaml
models:
- name: mistral
- name: DeepSeek R1 32B
provider: ollama
model: deepseek-r1:32b # Must match exactly what `ollama list` shows
apiBase: http://localhost:11434
model: mistral
roles:
- chat
- edit
capabilities: # Add if not auto-detected
- tool_use
- name: Qwen2.5-Coder 1.5B
provider: ollama
model: qwen2.5-coder:1.5b
roles:
- autocomplete
```
### Method 3: Using Autodetect
Continue can automatically detect available Ollama models. You can configure this in your YAML:
```yaml
models:
- name: Autodetect
provider: ollama
model: AUTODETECT
roles:
- chat
- edit
- apply
- name: Qwen2.5-Coder 1.5B
provider: ollama
apiBase: http://localhost:11434
model: qwen2.5-coder:1.5b-base
roles:
- autocomplete
- name: Nomic Embed
provider: ollama
apiBase: http://localhost:11434
model: nomic-embed-text:latest
roles:
- embed
```
Or use it through the GUI:
1. Click on the model selector dropdown
2. Select "Autodetect" option
3. Continue will scan for available Ollama models
4. Select your desired model from the detected list
<Note>
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.
</Note>
You can update `apiBase` with the IP address of a remote machine serving Ollama.
### Model Capabilities and Tool Support
Some Ollama models support tools (function calling) which is required for Agent mode. However, not all models that claim tool support work correctly:
#### Checking Tool Support
```yaml
models:
- name: DeepSeek R1
provider: ollama
model: deepseek-r1:latest
capabilities:
- tool_use # Add this to enable tools
```
<Warning>
**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.
</Warning>
#### If Agent Mode Shows "Not Supported"
1. First, add `capabilities: [tool_use]` to your model config
2. If you still get errors, the model may not actually support tools despite documentation
3. Use a different model known to work with tools (e.g., Llama 3.1, Mistral)
See the [Model Capabilities guide](/customize/deep-dives/model-capabilities) for more details.
### How to Configure Advanced Settings
For optimal performance, consider these advanced configuration options:
- Memory optimization
- GPU acceleration
- Custom model parameters
- Performance tuning
- Memory optimization: Adjust `num_ctx` for context window size
- GPU acceleration: Use `num_gpu` to control GPU layers
- Custom model parameters: Temperature, top_p, top_k settings
- Performance tuning: Batch size and threading options
## What Are the Best Practices for Ollama
@ -102,30 +205,68 @@ To get the best performance from Ollama:
## How to Troubleshoot Ollama Issues
### What Are Common Issues
### Common Configuration Problems
Here are solutions to common problems you might encounter:
#### "404 model not found, try pulling it first"
#### How to Fix Connection Problems
This error occurs when the model isn't installed locally:
- Check Ollama service status
- Verify port availability
- Review firewall settings
**Problem**: Using a hub block or config that references a model not yet pulled
**Solution**:
```bash
# Check what models you have
ollama list
#### How to Resolve Performance Issues
# Pull the exact model version needed
ollama pull model-name:tag # e.g., deepseek-r1:32b
```
- Insufficient RAM
- Model too large for system
- GPU compatibility
#### Model Tag Mismatches
### How to Apply Solutions
**Problem**: `ollama run deepseek-r1` installs `:latest` but hub block expects `:32b`
**Solution**: Always pull with the exact tag:
```bash
# Wrong - pulls :latest
ollama run deepseek-r1
Try these solutions in order:
# Right - pulls specific version
ollama pull deepseek-r1:32b
```
1. Restart Ollama service
2. Clear model cache
3. Update to latest version
4. Check system requirements
#### "Agent mode is not supported"
**Problem**: Model doesn't support tools/function calling
**Solutions**:
1. Add `capabilities: [tool_use]` to your model config
2. If still not working, the model may not actually support tools
3. Switch to a model with confirmed tool support (Llama 3.1, Mistral)
#### Using Hub Blocks in Local Config
**Problem**: Unclear how to use hub models locally
**Solution**: Create a local assistant file:
```yaml
# ~/.continue/assistants/Local.yaml
name: Local Assistant
version: 0.0.1
schema: v1
models:
- uses: ollama/model-name
```
### How to Fix Connection Problems
- Verify Ollama is running: `curl http://localhost:11434`
- Check service status: `systemctl status ollama` (Linux)
- Ensure port 11434 is not blocked by firewall
- For remote connections, set `OLLAMA_HOST=0.0.0.0:11434`
### How to Resolve Performance Issues
- Insufficient RAM: Use smaller models (7B instead of 32B)
- Model too large: Check available memory with `ollama ps`
- GPU issues: Verify CUDA/ROCm installation for GPU acceleration
- Slow generation: Adjust `num_gpu` layers in model configuration
## What Are Example Workflows with Ollama