Skip to main content
Cerebras Inference exposes an OpenAI-compatible API for high-speed LLM inference. Set the OpenAI client’s base_url to Cerebras and use openinference-instrumentation-openai to send request, response, token, latency, and error spans to Phoenix.
This is OpenAI SDK instrumentation pointed at Cerebras’ OpenAI-compatible endpoint. It is not a separate Cerebras-specific instrumentor.

Install

Setup

Add your Cerebras API key and the model you want to call, along with your Phoenix connection details, as environment variables:
Connect your application to Phoenix with the register function:

Run Cerebras

Observe

Now that you have tracing set up, all invocations of the OpenAI client pointed at Cerebras will be streamed to your running Phoenix for observability and evaluation. Each request appears as a ChatCompletion LLM span with the prompt, response, model name, token usage, and latency.

Common Issues

  • No traces in Phoenix: Confirm PHOENIX_COLLECTOR_ENDPOINT (and PHOENIX_API_KEY if your Phoenix requires one) is set in the same shell that runs your app
  • Cerebras spans missing: Call register() before you create the OpenAI client, and make sure openinference-instrumentation-openai is installed so auto_instrument=True picks it up
  • 401 from Cerebras: Use your Cerebras API key, not your OpenAI key
  • Model not found: Confirm CEREBRAS_MODEL matches a model available in your Cerebras account
  • Base URL: Ensure you’re using https://api.cerebras.ai/v1 as the base URL

Resources

Cerebras Inference Documentation

OpenInference OpenAI Instrumentation