Skip to main content
Ollama runs open-weight models locally. The OllamaInstrumentor traces native Ollama chat calls, including messages, responses, tool calls, and token counts, as OpenInference LLM spans in Arize AX.

Llama 3.2 + Ollama Tracing Tutorial (Google Colab)

Prerequisites

  • Python 3.10+
  • An Arize AX account (sign up)
  • Ollama installed and running locally
  • The llama3.2:1b model pulled: ollama pull 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 runs locally, so this example needs no provider API key.

Setup tracing

Import and instrument before importing or calling ollama. In particular, from ollama import chat captured before instrumentation is not traced.

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 with a Chat LLM span.
  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. Run OllamaInstrumentor().instrument(...) before importing or calling ollama.
  • Connection refused. Start the daemon with ollama serve and confirm it responds at http://localhost:11434.
  • Model not found. Pull it with ollama pull llama3.2:1b.
  • No span for generate or embeddings. This instrumentor traces chat only; generate, embed, and embeddings calls are not supported.

Resources

OpenInference Ollama Instrumentor

Ollama Python client