> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cline.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# Ollama

> A quick guide to setting up Ollama for local AI model execution with Cline.

### Prerequisites

* Windows, macOS, or Linux computer
* Cline installed in VS Code

### Setup Steps

#### 1. Install Ollama

* Visit [ollama.com](https://ollama.com)
* Download and install for your operating system

<Frame>
  <img src="https://storage.googleapis.com/cline_public_images/docs/assets/image%20(2)%20(1)%20(1).png" alt="Ollama download page" />
</Frame>

#### 2. Choose and Download a Model

* Browse models at [ollama.com/search](https://ollama.com/search)
* Select model and copy command:

  ```bash theme={"system"}
  ollama run [model-name]
  ```

<Frame>
  <img src="https://storage.googleapis.com/cline_public_images/docs/assets/ollama-model-grab%20(2).gif" alt="Selecting a model in Ollama" />
</Frame>

* Open your Terminal and run the command:

  * Example:

    ```bash theme={"system"}
    ollama run llama2
    ```

<Frame>
  <img src="https://storage.googleapis.com/cline_public_images/docs/assets/starting-ollama-terminal%20(2).gif" alt="Running Ollama in terminal" />
</Frame>

Your model is now ready to use within Cline.

#### 3. Configure Cline

<Frame>
  <img src="https://storage.googleapis.com/cline_public_images/docs/assets/ollama-setup.gif" alt="Complete Ollama setup process" />
</Frame>

Open VS Code and configure Cline:

1. Click the Cline settings icon
2. Select "Ollama" as your API provider
3. Base URL: `http://localhost:11434/` (default, usually no need to change)
4. Select your model from the dropdown

### Recommended Models

For the best experience with Cline, use **Qwen 2.5 Coder 32B**. This model provides strong coding capabilities and reliable tool use for local development.

To download it:

```bash theme={"system"}
ollama pull qwen2.5-coder:32b
```

Other capable models include:

* `mistral-small:latest` - Good balance of performance and speed
* `codellama:34b-code` - Optimized for coding tasks

### Important Notes

* Start Ollama before using with Cline
* Keep Ollama running in background
* First model download may take several minutes

### Enable Compact Prompts

For better performance with local models, enable compact prompts in Cline settings. This reduces the prompt size by 90% while maintaining core functionality.

Navigate to Cline Settings → Features → Use Compact Prompt and toggle it on.

### Troubleshooting

If Cline can't connect to Ollama:

1. Verify Ollama is running
2. Check base URL is correct
3. Ensure model is downloaded

Need more info? Read the [Ollama Docs](https://github.com/ollama/ollama/blob/main/docs/api.md).
