Skip to main content
Ollama allows you to run large language models locally on your machine, providing privacy, offline capability, and no API costs. Avante.nvim has full support for Ollama.

Prerequisites

You must have Ollama installed and running before using this provider.
1

Install Ollama

Download and install from ollama.ai
2

Start Ollama service

By default, Ollama runs on http://127.0.0.1:11434
3

Pull a model

Quick Start

Configuration

Basic Configuration

Model Selection

Ollama supports many models. Some recommended for coding:

Environment Setup

Enabling the Provider

By default, Ollama is disabled. You must provide an is_env_set implementation:
Or use a custom check:

Custom Endpoint

For remote Ollama instances:

Model Parameters

Ollama uses the options object for model parameters:

Parameter Details

List Available Models

List all models installed in Ollama:
Or via command line:

Model Management

Pull Models

Remove Models

Check Model Info

ReAct Prompting

Ollama uses ReAct-style prompting by default for tool use:
This enables better tool calling through XML-based prompting.

Advanced Configuration

Keep-Alive Settings

Control how long models stay in memory:

Context Window Optimization

Adjust based on your hardware:

Authentication

For secured Ollama instances:

Troubleshooting

If you see connection errors:
  1. Check if Ollama is running:
  2. Start Ollama:
  3. Verify endpoint in config matches Ollama’s address
Error: “model ‘model-name’ not found”
  1. List installed models:
  2. Pull the model:
If Ollama crashes or runs out of memory:
  1. Use a smaller model (e.g., qwen2.5-coder:7b instead of :14b)
  2. Reduce num_ctx
  3. Close other applications
  4. Consider upgrading RAM/VRAM
If responses are too slow:
  1. Use GPU acceleration (should be automatic)
  2. Try a smaller model
  3. Reduce num_ctx
  4. Ensure no other heavy processes are running

Performance Tips

Model Size

  • Larger ≠ always better
  • 7B models: Fast, good for simple tasks
  • 14B models: Balanced performance
  • 34B+ models: Best quality, slower

Context Window

  • Larger context uses more memory
  • Start with 8192-16384
  • Increase only if needed
  • Monitor memory usage

Hardware

  • GPU: Much faster than CPU
  • RAM: 16GB+ recommended
  • VRAM: 8GB+ for larger models
  • SSD: Faster model loading

Keep-Alive

  • Longer = faster responses
  • Shorter = less memory usage
  • Balance based on usage pattern

Best Practices

Model Selection

For different use cases:

Resource Management

Example Configurations