Skip to main content
Llama Stack was renamed to OGX in 2026. OGX is an open-source, OpenAI-compatible API server with pluggable providers, including a built-in Cerebras provider. This guide uses the current OGX packages and commands.

Prerequisites

Before you begin, ensure you have:
  • Cerebras API Key - Get a free API key here
  • Python 3.12 or higher - Required by current OGX releases
  • uv package manager - Used to install and run the OGX starter distribution

Configure OGX with Cerebras

1

Install OGX

Install the OGX starter distribution and the OpenAI SDK in a persistent project environment:
For a quick evaluation without creating a project, uvx can install and run the server in one command:
2

Configure environment variables

Export your Cerebras API key as an environment variable:
You can also add this to your shell profile (e.g., ~/.bashrc or ~/.zshrc) for persistence.
3

Start the OGX server

Launch the starter distribution. It enables the Cerebras provider automatically when CEREBRAS_API_KEY is set:
The server starts on http://localhost:8321 by default. Confirm that Cerebras models were discovered before sending requests:
4

Make your first inference request

Use any OpenAI-compatible client to make inference requests through OGX.
5

Try streaming responses

OGX supports streaming responses for real-time output. Streaming is particularly useful for interactive applications where you want to display responses as they’re generated.

Using Cerebras Directly with OpenAI SDK

If you prefer to use Cerebras directly without the OGX server, you can use the OpenAI SDK with Cerebras endpoints. This approach gives you direct access to Cerebras while still tracking usage through the integration header.

Advanced Features

Using Multiple Models

OGX discovers the models available to your Cerebras account at startup. Use the provider-prefixed IDs returned by GET /v1/models, for example: Then switch between models in your code:

System Prompts and Temperature Control

Customize model behavior with system prompts and sampling parameters to fine-tune responses:

Multi-Turn Conversations

The OpenAI-compatible chat endpoint supports multi-turn conversations:

FAQ

OGX provides a provider-agnostic, OpenAI-compatible server plus APIs for responses, files, vector stores, batches, and skills. If you only need basic inference, calling Cerebras directly with the OpenAI SDK is simpler.
Yes. Point any OpenAI-compatible client at a remote OGX server that has the Cerebras provider enabled. Alternatively, use the OpenAI SDK directly as shown in the “Using Cerebras Directly” section.
Use gpt-oss-120b for production text, coding, and tool-use workloads. Use the preview gemma-4-31b model when you need image input. Check the model catalog for current availability before configuring additional preview models.
Current OGX packages require Python 3.12 or higher.
Handle 429 and transient 5xx responses with bounded retries and exponential backoff in your application. Monitor account usage through the Cerebras Cloud dashboard.

Troubleshooting

Server won’t start

If the OGX server fails to start:
  1. Verify your Python version is 3.12 or higher: python --version
  2. Check that your CEREBRAS_API_KEY environment variable is set: echo $CEREBRAS_API_KEY
  3. Confirm the package can start: uvx --from "ogx[starter]" ogx stack run starter
  4. Check the OGX releases page for breaking changes

Connection errors

If you see connection errors when making requests:
  1. Verify the OGX server is running on the expected port (default: 8321)
  2. Check that your Cerebras API key is valid by testing it directly with the OpenAI SDK
  3. Ensure there are no firewall rules blocking localhost connections
  4. Try restarting the OGX server
  5. Verify your network connectivity to api.cerebras.ai

Model not found errors

If you get “model not found” errors:
  1. Use the cerebras/ prefix for model names (e.g., cerebras/gpt-oss-120b)
  2. List available models: curl http://localhost:8321/v1/models
  3. Restart the OGX server after changing provider environment variables
  4. Consult the Cerebras models page for the current list of available models

Slow response times

If responses are slower than expected:
  1. Verify you’re using Cerebras models (not accidentally routing through another provider)
  2. Check your network connection and latency to Cerebras endpoints
  3. Reduce unnecessary prompt and output tokens
  4. Enable streaming to get partial responses faster
  5. Check your Cerebras account for any rate limiting or usage quotas

Import errors with the OpenAI SDK

If you get import errors:
  1. Ensure the OpenAI SDK is installed: uv add openai
  2. Check that you’re using the correct import: from openai import OpenAI
  3. Verify that your base URL includes /v1
  4. Create a fresh virtual environment if issues persist

Next Steps

OGX was formerly named Llama Stack. The current package is ogx, the current command is ogx, and the server runs on port 8321 by default.