Skip to main content
Ollama exposes an OpenAI-compatible API, so applications using the OpenAI Node.js SDK can call local Ollama models. Phoenix traces these calls with the OpenAI Node.js instrumentation.

Install

Setup

Register the OpenAI instrumentation and point its OTLP exporter at Phoenix. Create instrumentation.js:

Run Ollama

Start Ollama locally and pull a model, for example ollama pull llama3.2:1b. Then use the OpenAI SDK with Ollama’s local compatible endpoint. The API key value is required by the SDK and ignored by a local Ollama server:

Observe

Phoenix receives an LLM span for the Ollama-backed completion, including the model name and messages.

Resources