Skip to main content
Valiqor automatically traces Ollama API calls by intercepting HTTP requests to the Ollama server. Both /api/chat and /api/generate endpoints are captured with model name, token usage, and response content.
Ollama tracing works by detecting HTTP requests to the Ollama API server. No additional install extras are needed — Ollama support is built into the core valiqor package.

Install

No extra dependencies are needed. Ollama tracing uses the requests library which is already a core dependency. Make sure you have Ollama installed and running locally with a model pulled:

Add a single import at the top of your app — all Ollama calls are automatically traced:

Selective Instrumentation

If you only want Ollama tracing:

Chat Endpoint

The /api/chat endpoint uses the messages format:

Generate Endpoint

The /api/generate endpoint uses a prompt string:

What Gets Captured

Each traced Ollama call records:

With Workflows

Group multiple Ollama calls into a single trace:

Disabling


Limitations

  • Sync only — only synchronous requests.post calls are traced. Async HTTP clients (e.g. httpx, aiohttp) are not intercepted.
  • Streaming is not instrumented — set "stream": False in your requests for traces to be captured.
  • Ollama Python library — if you use the ollama Python package instead of raw requests, it works as long as it uses requests.post internally.

Next Steps

Tracing Guide

Learn about traces, spans, workflows, and exporters.

Failure Analysis

Run failure analysis on your traced Ollama calls.