Skip to content

Commit 0c42a50

Browse files
miyoungclinuxdevel
authored andcommitted
docs: add guidance for OpenAI-compatible cloud providers (NVIDIA#458)
* add guidance for OpenAI-compatible cloud providers * add provider list and xref link * add xref * add provider name value column
1 parent cb2ed22 commit 0c42a50

File tree

3 files changed

+44
-9
lines changed

3 files changed

+44
-9
lines changed

docs/inference/configure.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ The configuration consists of two values:
3535
| Provider record | The credential backend OpenShell uses to authenticate with the upstream model host. |
3636
| Model ID | The model to use for generation requests. |
3737

38-
## Step 1: Create a Provider
38+
For a list of tested providers and their base URLs, refer to [Supported Inference Providers](../sandboxes/manage-providers.md#supported-inference-providers).
39+
40+
## Create a Provider
3941

4042
Create a provider that holds the backend credentials you want OpenShell to use.
4143

@@ -51,7 +53,23 @@ This reads `NVIDIA_API_KEY` from your environment.
5153

5254
::::
5355

54-
::::{tab-item} Local / self-hosted endpoint
56+
::::{tab-item} OpenAI-compatible Provider
57+
58+
Any cloud provider that exposes an OpenAI-compatible API works with the `openai` provider type. You need three values from the provider: the base URL, an API key, and a model name.
59+
60+
```console
61+
$ openshell provider create \
62+
--name my-cloud-provider \
63+
--type openai \
64+
--credential OPENAI_API_KEY=<your_api_key> \
65+
--config OPENAI_BASE_URL=https://api.example.com/v1
66+
```
67+
68+
Replace the base URL and API key with the values from your provider. For supported providers out of the box, refer to [Supported Inference Providers](../sandboxes/manage-providers.md#supported-inference-providers). For other providers, refer to your provider's documentation for the correct base URL, available models, and API key setup.
69+
70+
::::
71+
72+
::::{tab-item} Local Endpoint
5573

5674
```console
5775
$ openshell provider create \
@@ -77,7 +95,7 @@ This reads `ANTHROPIC_API_KEY` from your environment.
7795

7896
:::::
7997

80-
## Step 2: Set Inference Routing
98+
## Set Inference Routing
8199

82100
Point `inference.local` at that provider and choose the model to use:
83101

@@ -87,7 +105,7 @@ $ openshell inference set \
87105
--model nvidia/nemotron-3-nano-30b-a3b
88106
```
89107

90-
## Step 3: Verify the Active Config
108+
## Verify the Active Config
91109

92110
Confirm that the provider and model are set correctly:
93111

@@ -100,7 +118,7 @@ Gateway inference:
100118
Version: 1
101119
```
102120

103-
## Step 4: Update Part of the Config
121+
## Update Part of the Config
104122

105123
Use `update` when you want to change only one field:
106124

@@ -114,7 +132,7 @@ Or switch providers without repeating the current model:
114132
$ openshell inference update --provider openai-prod
115133
```
116134

117-
## Use It from a Sandbox
135+
## Use the Local Endpoint from a Sandbox
118136

119137
After inference is configured, code inside any sandbox can call `https://inference.local` directly:
120138

docs/inference/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ If code calls an external inference host directly, that traffic is evaluated onl
4444
|---|---|
4545
| Credentials | No sandbox API keys needed. Credentials come from the configured provider record. |
4646
| Configuration | One provider and one model define sandbox inference for the active gateway. Every sandbox on that gateway sees the same `inference.local` backend. |
47-
| Provider support | OpenAI, Anthropic, and NVIDIA providers all work through the same endpoint. |
47+
| Provider support | NVIDIA, any OpenAI-compatible provider, and Anthropic all work through the same endpoint. |
4848
| Hot-refresh | OpenShell picks up provider credential changes and inference updates without recreating sandboxes. Changes propagate within about 5 seconds by default. |
4949

5050
## Supported API Patterns

docs/sandboxes/manage-providers.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,34 @@ The following provider types are supported.
132132
|---|---|---|
133133
| `claude` | `ANTHROPIC_API_KEY`, `CLAUDE_API_KEY` | Claude Code, Anthropic API |
134134
| `codex` | `OPENAI_API_KEY` | OpenAI Codex |
135-
| `opencode` | `OPENCODE_API_KEY`, `OPENROUTER_API_KEY`, `OPENAI_API_KEY` | opencode tool |
135+
| `generic` | User-defined | Any service with custom credentials |
136136
| `github` | `GITHUB_TOKEN`, `GH_TOKEN` | GitHub API, `gh` CLI — refer to {doc}`/tutorials/github-sandbox` |
137137
| `gitlab` | `GITLAB_TOKEN`, `GLAB_TOKEN`, `CI_JOB_TOKEN` | GitLab API, `glab` CLI |
138138
| `nvidia` | `NVIDIA_API_KEY` | NVIDIA API Catalog |
139-
| `generic` | User-defined | Any service with custom credentials |
139+
| `openai` | `OPENAI_API_KEY` | Any OpenAI-compatible endpoint. Set `--config OPENAI_BASE_URL` to point to the provider. Refer to {doc}`/inference/configure`. |
140+
| `opencode` | `OPENCODE_API_KEY`, `OPENROUTER_API_KEY`, `OPENAI_API_KEY` | opencode tool |
140141

141142
:::{tip}
142143
Use the `generic` type for any service not listed above. You define the
143144
environment variable names and values yourself with `--credential`.
144145
:::
145146

147+
## Supported Inference Providers
148+
149+
The following providers have been tested with `inference.local`. Any provider that exposes an OpenAI-compatible API works with the `openai` type. Set `--config OPENAI_BASE_URL` to the provider's base URL and `--credential OPENAI_API_KEY` to your API key.
150+
151+
| Provider | Name | Type | Base URL | API Key Variable |
152+
|---|---|---|---|---|
153+
| NVIDIA API Catalog | `nvidia-prod` | `nvidia` | `https://integrate.api.nvidia.com/v1` | `NVIDIA_API_KEY` |
154+
| Anthropic | `anthropic-prod` | `anthropic` | `https://api.anthropic.com` | `ANTHROPIC_API_KEY` |
155+
| Baseten | `baseten` | `openai` | `https://inference.baseten.co/v1` | `OPENAI_API_KEY` |
156+
| Bitdeer AI | `bitdeer` | `openai` | `https://api-inference.bitdeer.ai/v1` | `OPENAI_API_KEY` |
157+
| Deepinfra | `deepinfra` | `openai` | `https://api.deepinfra.com/v1/openai` | `OPENAI_API_KEY` |
158+
| Ollama (local) | `ollama` | `openai` | `http://host.openshell.internal:11434/v1` | `OPENAI_API_KEY` |
159+
| LM Studio (local) | `lmstudio` | `openai` | `http://host.openshell.internal:1234/v1` | `OPENAI_API_KEY` |
160+
161+
Refer to your provider's documentation for the correct base URL, available models, and API key setup. To configure inference routing, refer to {doc}`/inference/configure`.
162+
146163
## Next Steps
147164

148165
Explore related topics:

0 commit comments

Comments
 (0)