Skip to content

Commit 0e4ebff

Browse files
authored
docs: add OpenAI-compatible gateway example with DaoXE (#6298)
# What does this PR do? Adds a short docs page showing how to use the existing **`remote::openai`** inference provider against a third-party **OpenAI-compatible multi-model gateway**, with [DaoXE](https://daoxe.com) as a concrete example. DaoXE base URL for OpenAI clients / OGX: ```text https://daoxe.com/v1 ``` The page covers: - Starter distribution via `OPENAI_API_KEY` + `OPENAI_BASE_URL=https://daoxe.com/v1` - Explicit `config.yaml` with `provider_type: remote::openai` and `provider_id: daoxe` - OpenAI SDK calls against a local OGX server and against DaoXE directly - Account-scoped model IDs (discover via authenticated `GET /v1/models`; no hardcoded catalog) - Note that DaoXE is multi-protocol (OpenAI + Anthropic Messages, etc.) but OGX uses the OpenAI-compatible path - Availability note: **not available in mainland China** - Maintainer disclosure Also links the page from the Distributions sidebar and from the OpenAI Implementation Guide resources. Related existing docs: - [Open Responses / OpenAI compatibility blog](https://github.com/ogx-ai/ogx/blob/main/docs/blog/2026-03-20-open-responses-openai-compatibility.md) - [`remote::openai` provider](https://github.com/ogx-ai/ogx/blob/main/docs/docs/providers/inference/remote_openai.mdx) - [OpenAI API compatibility](https://github.com/ogx-ai/ogx/blob/main/docs/docs/api-openai/index.mdx) Examples: https://github.com/seven7763/DaoXE-AI Note: `meta-llama/llama-stack` redirects to `ogx-ai/ogx` (project rename). This PR targets the current canonical repo. ## Test Plan - [ ] Docs page renders at `/docs/distributions/openai_compatible_gateways` - [ ] Sidebar **Distributions** lists **OpenAI-compatible gateways** after Customizing config.yaml - [ ] Link from `/docs/providers/openai` Additional Resources resolves - [ ] Internal links resolve (`remote_openai`, starter, customizing_run_yaml, api-openai, blog slug) - Docs-only change; no runtime code Signed-off-by: seven7763 <246023385+seven7763@users.noreply.github.com> Co-authored-by: seven7763 <246023385+seven7763@users.noreply.github.com>
1 parent 441e765 commit 0e4ebff

3 files changed

Lines changed: 116 additions & 0 deletions

File tree

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
title: OpenAI-compatible remote gateways
3+
description: Point the remote::openai inference provider at any OpenAI-compatible API, including multi-model gateways such as DaoXE.
4+
sidebar_label: OpenAI-compatible gateways
5+
sidebar_position: 5
6+
---
7+
8+
# OpenAI-compatible remote gateways
9+
10+
OGX's [`remote::openai`](/docs/providers/inference/remote_openai) inference provider talks to any endpoint that implements the OpenAI Chat Completions (and related) HTTP surface. You do not need a custom provider package for third-party multi-model gateways: set `base_url` (and an API key) on `remote::openai`.
11+
12+
This is the same mechanism the [starter distribution](/docs/distributions/self_hosted_distro/starter) uses when you export `OPENAI_API_KEY` and optionally `OPENAI_BASE_URL`. See also the [OpenAI API compatibility](/docs/api-openai/) overview and the [Open Responses / OpenAI compatibility blog post](/blog/open-responses-openai-compatibility).
13+
14+
## Example: DaoXE
15+
16+
[DaoXE](https://daoxe.com) is a multi-model, multi-protocol API gateway. For OGX, use its **OpenAI-compatible** base URL:
17+
18+
```text
19+
https://daoxe.com/v1
20+
```
21+
22+
DaoXE also exposes other client protocols (for example Anthropic Messages) for non-OGX clients. Inside OGX you configure only the OpenAI-compatible path above.
23+
24+
:::note Availability
25+
DaoXE is **not available in mainland China**. Create an account and API key at [daoxe.com](https://daoxe.com). Model IDs are **account-scoped** (availability can differ by plan or group). Always discover exact IDs with authenticated `GET /v1/models` rather than hard-coding a public catalog.
26+
:::
27+
28+
### Option A — starter distribution + environment variables
29+
30+
```bash
31+
export OPENAI_API_KEY="your_daoxe_api_key"
32+
export OPENAI_BASE_URL="https://daoxe.com/v1"
33+
uvx --from 'ogx[starter]' ogx run starter
34+
```
35+
36+
With the starter's default `provider_id: openai`, registered model IDs look like `openai/<upstream_model_id>`. List them after the server is up:
37+
38+
```bash
39+
curl -s http://localhost:8321/v1/models | python -m json.tool
40+
```
41+
42+
### Option B — explicit `config.yaml` entry
43+
44+
Prefer a dedicated provider ID when you also keep a direct OpenAI key, or when you want clearer model prefixes:
45+
46+
```yaml
47+
version: 2
48+
apis:
49+
- inference
50+
- responses
51+
providers:
52+
inference:
53+
- provider_id: daoxe
54+
provider_type: remote::openai
55+
config:
56+
api_key: ${env.DAOXE_API_KEY}
57+
base_url: https://daoxe.com/v1
58+
# Optional: pin models after discovery
59+
# allowed_models:
60+
# - your_exact_model_id
61+
refresh_models: true
62+
```
63+
64+
Start the server with that config (see [Customizing config.yaml](/docs/distributions/customizing_run_yaml) and [Starting the OGX server](/docs/distributions/starting_ogx_server)). Model IDs will be prefixed with the provider ID, for example `daoxe/<your_exact_model_id>`.
65+
66+
### Call OGX with the OpenAI SDK
67+
68+
```python
69+
from openai import OpenAI
70+
71+
client = OpenAI(base_url="http://localhost:8321/v1", api_key="fake")
72+
73+
# Replace with an ID from GET /v1/models for your server
74+
response = client.chat.completions.create(
75+
model="daoxe/your_exact_model_id",
76+
messages=[{"role": "user", "content": "Hello from OGX + DaoXE"}],
77+
max_tokens=64,
78+
)
79+
print(response.choices[0].message.content)
80+
```
81+
82+
### Call DaoXE directly (without OGX)
83+
84+
If you only need the gateway (no vector stores, Responses orchestration, etc.), point the OpenAI client at DaoXE:
85+
86+
```python
87+
from openai import OpenAI
88+
89+
client = OpenAI(
90+
base_url="https://daoxe.com/v1",
91+
api_key="your_daoxe_api_key",
92+
)
93+
94+
response = client.chat.completions.create(
95+
model="your_exact_model_id", # from DaoXE GET /v1/models
96+
messages=[{"role": "user", "content": "Hello"}],
97+
max_tokens=64,
98+
)
99+
print(response.choices[0].message.content)
100+
```
101+
102+
Auditable examples and a low-cost smoke benchmark live at [seven7763/DaoXE-AI](https://github.com/seven7763/DaoXE-AI).
103+
104+
## Related providers
105+
106+
| Goal | Provider |
107+
|------|----------|
108+
| OpenAI API or any OpenAI-compatible gateway (`base_url` override) | [`remote::openai`](/docs/providers/inference/remote_openai) |
109+
| Arbitrary OpenAI-compatible endpoint without a fixed default URL | [`remote::passthrough`](/docs/providers/inference/remote_passthrough) |
110+
| Llama API OpenAI-compat surface | [`remote::llama-openai-compat`](/docs/providers/inference/remote_llama-openai-compat) |
111+
112+
## Disclosure
113+
114+
This page was contributed by a DaoXE maintainer. Configuration uses only stock OGX providers; no DaoXE-specific adapter is required.

docs/docs/providers/openai.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,4 @@ Art in hidden form
206206
- **[OpenAI API Compatibility Guide](/docs/api-openai/)** - Comprehensive overview of OpenAI compatibility features
207207
- **[OpenAI Responses API Limitations](/docs/providers/openai_responses_limitations)** - Detailed limitations and known issues
208208
- **[Provider Documentation](/docs/providers/)** - Complete provider ecosystem overview
209+
- **[OpenAI-compatible remote gateways](/docs/distributions/openai_compatible_gateways)** - Point `remote::openai` at multi-model gateways (for example DaoXE) via `base_url`

docs/sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ const sidebars: SidebarsConfig = {
9797
'distributions/list_of_distributions',
9898
'distributions/building_distro',
9999
'distributions/customizing_run_yaml',
100+
'distributions/openai_compatible_gateways',
100101
'distributions/importing_as_library',
101102
'distributions/configuration',
102103
'distributions/starting_ogx_server',

0 commit comments

Comments
 (0)