Skip to main content
Ollama runs open-source models locally and exposes an OpenAI-compatible Chat Completions API at http://localhost:11434/v1. Because the client side speaks the OpenAI protocol, Arize AX captures every Ollama call via the openinference-instrumentation-openai package — the same instrumentor that covers OpenAI’s hosted API.

Llama 3.2 + Ollama Tracing Tutorial (Google Colab)

Prerequisites

  • Python 3.9+
  • An Arize AX account (sign up)
  • Ollama installed and running locally (ollama serve)
  • A small instruction-tuned model pulled (this guide uses llama3.2:1b):

Launch Arize AX

  1. Sign in to your Arize AX account.
  2. From Space Settings, copy your Space ID and API Key. You will set them as ARIZE_SPACE_ID and ARIZE_API_KEY below.

Install

Configure credentials

Ollama does not require an API key — the OpenAI client passes a literal placeholder. No external provider key is needed.

Setup tracing

Run Ollama

Expected output

Verify in Arize AX

  1. Open your Arize AX space and select project ollama-tracing-example.
  2. You should see a new trace within ~30 seconds containing a ChatCompletion LLM span with the prompt, response, and token usage attached. The model name on the span will be the Ollama model you ran (e.g. llama3.2:1b).
  3. If no traces appear, see Troubleshooting.

Check from the skill, CLI, or SDK

Confirm spans are actually reaching your Arize AX project. Use whichever fits your workflow — the skill and CLI work for any framework; the SDK check is shown for each language.
Install the Arize Skills plugin and let your coding agent check for you:
Then prompt your agent:
Use the arize-trace skill to export and analyze recent traces from my project. Confirm spans are arriving, and summarize any errors or latency issues.

Troubleshooting

  • No traces in Arize AX. Confirm ARIZE_SPACE_ID and ARIZE_API_KEY are set in the same shell that runs example.py. Enable OpenTelemetry debug logs with export OTEL_LOG_LEVEL=debug and re-run.
  • Connection refused or ConnectError to localhost:11434. The Ollama daemon is not running. Start it with ollama serve (in another terminal, or as a background service).
  • model "llama3.2:1b" not found, try pulling it first. Pull the model: ollama pull llama3.2:1b. Run ollama list to see what’s pulled locally.
  • Different model. Swap llama3.2:1b for any model in the Ollama library you’ve pulled — llama3.3, mistral, qwen2.5, etc. The OpenAIInstrumentor doesn’t care which model serves the response.
  • Spans show but with the wrong model name. Ollama reports the model alias you passed to the API; if you renamed the model locally (ollama cp), use that alias.

Resources

Ollama OpenAI Compatibility Documentation

OpenInference OpenAI Instrumentor (used for Ollama)

Ollama GitHub