Skip to main content
vLLM is an inference and serving engine for large language models. You can observe vLLM with Phoenix in two complementary ways:
Use both paths when possible. vLLM’s server-side OTLP spans show inference-server timing and request metadata. OpenInference OpenAI instrumentation captures the client-side prompt, response, token, model, and latency metadata for calls made through the OpenAI-compatible API.

Option 1: Export vLLM server spans over OTLP

vLLM defaults to OTLP/gRPC. Phoenix accepts OTLP/HTTP at <PHOENIX_COLLECTOR_ENDPOINT>/v1/traces, so set the exporter protocol before starting vLLM. This example sends spans to a local Phoenix at http://localhost:6006:
If your Phoenix instance has authentication enabled (for example, Phoenix Cloud), point --otlp-traces-endpoint at your instance’s /v1/traces URL and pass your API key as a header:
Current vLLM releases bundle the core OpenTelemetry packages needed for server-side tracing. If you use an older or custom vLLM image and it errors on startup after you add --otlp-traces-endpoint, install matching OpenTelemetry exporter dependencies in the same environment or container image.

Option 2: Trace OpenAI-compatible client calls

Install

Setup

Connect your application to Phoenix with the register function:

Run vLLM

vLLM’s OpenAI-compatible server does not require an API key unless you start it with --api-key. The OpenAI client still requires a non-empty value, so the example uses EMPTY.

Observe

Open Phoenix and select the my-llm-app project for client-side spans. Each call appears as a ChatCompletion LLM span with the prompt, response, model, token usage, and latency. If you also enabled vLLM server OTLP export, select the vllm-server project to see server-side inference and request-processing spans.

Common Issues

  • No client-side LLM spans: Make sure register(..., auto_instrument=True) runs before your OpenAI client sends requests
  • No vLLM server spans: Confirm OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf is set and --otlp-traces-endpoint points to your Phoenix collector’s /v1/traces path
  • Server spans appear in the default project: Confirm OTEL_RESOURCE_ATTRIBUTES includes openinference.project.name=vllm-server
  • Server spans lack prompt or response text: Use the OpenInference OpenAI client path as well. vLLM’s server export does not include the same application-level input and output detail

Resources

vLLM OpenTelemetry Example

vLLM OpenAI-Compatible Server

OpenInference OpenAI Instrumentation