Ollama Provider

Use local Ollama models with PraisonAI TypeScript

Diagram

Input

Agent

Output

Ollama Provider

Run models locally with Ollama.

Environment Variables

bash
export OLLAMA_BASE_URL=http://localhost:11434

Supported Modalities

ModalitySupported
Text/Chat✅
Embeddings✅
Tools✅

Prerequisites

  1. Install Ollama: https://ollama.ai
  2. Pull a model: ollama pull llama3.2

Quick Start

  1. Simple Usage
    typescript
    import { Agent } from 'praisonai';
    
    const agent = new Agent({
      name: 'LocalAgent',
      instructions: 'You are a helpful assistant.',
      llm: 'ollama/llama3.2'
    });
    
    const response = await agent.chat('Hello!');
  2. With Configuration

    Adjust provider credentials and model settings for production — see the sections above.

Available Models

ModelDescription
llama3.2Llama 3.2
llama3.1Llama 3.1
mistralMistral 7B
codellamaCode Llama
phi3Phi-3

Related