Skip to main content

Overview

Ollama lets you run large language models locally. LiteLLM provides seamless integration with Ollama, supporting chat, embeddings, function calling, and reasoning models.

Quick Start

1

Install Ollama

Download and install Ollama from ollama.ai
2

Install LiteLLM

3

Make Your First Call

Meta’s Llama models.

Configuration

Streaming

Function Calling

Ollama 0.4+ supports native function calling.

Reasoning Models

Use reasoning capabilities with compatible models.

JSON Mode

Vision Models

Use vision-capable models with images.

Embeddings

Advanced Configuration

Supported Parameters

Error Handling

LiteLLM Proxy

Best Practices

  • Pull models before use: ollama pull model-name
  • Use keep_alive to keep frequently-used models loaded
  • Monitor system resources (RAM, GPU memory)
  • Use GPU acceleration when available
  • Adjust num_ctx based on your needs
  • Smaller models (7B/8B) for speed, larger (70B+) for quality
  • Requires Ollama 0.4+
  • Not all models support function calling equally
  • Test with your specific model before production

Troubleshooting

  • Use smaller models or quantized versions
  • Reduce num_ctx to lower memory usage
  • Close other applications