Skip to main content
In this guide, you’ll learn how to set up and use OGX, an open-source, OpenAI-compatible API server for building AI applications. OGX (formerly Llama Stack) provides a standardized interface that works with any model and any infrastructure. This guide walks you through running the SambaNova distribution server, installing the client, and running your first model inference. OGX includes two main components:
  • Server – A running distribution that hosts inference providers and API adapters.
  • Client – A consumer of the server’s API, interacting with the hosted adapters.

Prerequisites

Before you begin, ensure you have:

Setup

1

Set up a Python virtual environment

2

Install required dependencies

3

Export required environment variables and start the server

The --insecure flag disables TLS for local development. Without it, the server exits with TLS required: set tls_certfile/tls_keyfile in server config or pass '--insecure' to disable.

Option 2: Run with Docker

Install the OGX client

Both options need the client to run the example below. In the same or another environment, run:

Example code

The following Python code demonstrates basic usage:
This demonstrates the full client-server loop: connecting, listing models, and running inference. Explore the SambaNova OGX integration repo to find several use cases using SambaNova distribution LLMs, embeddings, tools, and agent adapters.

Troubleshooting

The server refuses to start without TLS configured:
Add the --insecure flag to the server run command, as shown in the setup steps above. Use TLS certificates instead if you are running in a shared or production environment.
The key reached SambaCloud but was rejected:
Verify SAMBANOVA_API_KEY is exported in the environment where the server is running, not just the one running the client, and that it matches a valid key from the SambaCloud console.
pip refuses the install outright:
ogx requires Python 3.12 or later. Create the virtual environment with an explicit interpreter, for example python3.12 -m venv .venv. A system python3 older than 3.12 is the usual cause.
Another process is holding $OGX_PORT. Identify it, then either stop it or choose a free port:
Both the uv run and docker run commands read $OGX_PORT, so nothing else needs to change.

Additional resources

Refer to the OGX documentation to:
  • Understand core concepts
  • Explore sample applications
  • Learn how to extend and customize the framework