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: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 aChatCompletion LLM span with the prompt, response, model name, token usage, and latency.
Common Issues
- No traces in Phoenix: Confirm
PHOENIX_COLLECTOR_ENDPOINT(andPHOENIX_API_KEYif 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 sureopeninference-instrumentation-openaiis installed soauto_instrument=Truepicks it up 401from Cerebras: Use your Cerebras API key, not your OpenAI key- Model not found: Confirm
CEREBRAS_MODELmatches a model available in your Cerebras account - Base URL: Ensure you’re using
https://api.cerebras.ai/v1as the base URL

