Appearance
Ollama
Run open-source models locally with OllamaModel — no cloud API key required. Ideal for offline development and testing agents against local LLMs.
For standalone invoke / stream usage, see LLM Models — Ollama.
Local setup
bash
# Install Ollama (macOS/Linux)
curl -fsSL https://ollama.com/install.sh | sh
# Pull a model (downloads to ~/.ollama/models on your machine)
ollama pull llama3.2
# Confirm the local server is running
ollama listInstall
bash
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ elsai-agents==0.3.1
pip install --extra-index-url https://core-packages.elsai.ai/root/ "elsai-model[ollama]==2.1.0"Setup
bash
export OLLAMA_HOST=http://localhost:11434 # optional — local server default
export OLLAMA_MODEL_NAME=llama3.2 # must match a pulled local modelAgent — basic
python
import os
from elsai import Agent
from elsai_model import LLM, Provider
model = LLM(
provider=Provider.OLLAMA,
model=os.getenv("OLLAMA_MODEL_NAME", "llama3.2"),
host=os.getenv("OLLAMA_HOST", "http://localhost:11434"),
temperature=0.2,
)
agent = Agent(
model=model,
system_prompt="You are a concise assistant.",
)
result = agent("Summarize what an AI agent is in two sentences.")
print(result)Popular models
bash
ollama pull llama3.2
ollama pull mistral
ollama pull codellama
ollama pull phi3