Skip to content

Commit 6e01786

Browse files
anniesurlakitlangtonrekram1-node
authored
feat(provider): add NVIDIA to popular providers, docs, and attribution headers (#22927)
Co-authored-by: Kit Langton <kit.langton@gmail.com> Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
1 parent e4be557 commit 6e01786

2 files changed

Lines changed: 54 additions & 17 deletions

File tree

packages/opencode/src/provider/provider.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,16 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
410410
},
411411
},
412412
}),
413+
nvidia: () =>
414+
Effect.succeed({
415+
autoload: false,
416+
options: {
417+
headers: {
418+
"HTTP-Referer": "https://opencode.ai/",
419+
"X-Title": "opencode",
420+
},
421+
},
422+
}),
413423
vercel: () =>
414424
Effect.succeed({
415425
autoload: false,

packages/web/src/content/docs/providers.mdx

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,30 +1316,57 @@ To use Kimi K2 from Moonshot AI:
13161316

13171317
---
13181318

1319-
### Mistral AI
1319+
### NVIDIA
13201320

1321-
1. Head over to the [Mistral AI console](https://console.mistral.ai/), create an account, and generate an API key.
1321+
NVIDIA provides access to Nemotron models and many other open models through [build.nvidia.com](https://build.nvidia.com) for free.
13221322

1323-
2. Run the `/connect` command and search for **Mistral AI**.
1323+
1. Head over to [build.nvidia.com](https://build.nvidia.com), create an account, and generate an API key.
13241324

1325-
```txt
1326-
/connect
1327-
```
1325+
2. Run the `/connect` command and search for **NVIDIA**.
13281326

1329-
3. Enter your Mistral API key.
1327+
```txt
1328+
/connect
1329+
```
1330+
1331+
3. Enter your NVIDIA API key.
1332+
1333+
```txt
1334+
┌ API key
1335+
1336+
1337+
└ enter
1338+
```
1339+
1340+
4. Run the `/models` command to select a model like nemotron-3-super-120b-a12b.
1341+
1342+
```txt
1343+
/models
1344+
```
13301345

1331-
```txt
1332-
┌ API key
1333-
1334-
1335-
└ enter
1336-
```
1346+
#### On-Prem / NIM
13371347

1338-
4. Run the `/models` command to select a model like _Mistral Medium_.
1348+
You can also use NVIDIA models locally via [NVIDIA NIM](https://docs.nvidia.com/nim/) by setting a custom base URL.
13391349

1340-
```txt
1341-
/models
1342-
```
1350+
```json title="opencode.json" {6}
1351+
{
1352+
"$schema": "https://opencode.ai/config.json",
1353+
"provider": {
1354+
"nvidia": {
1355+
"options": {
1356+
"baseURL": "http://localhost:8000/v1"
1357+
}
1358+
}
1359+
}
1360+
}
1361+
```
1362+
1363+
#### Environment Variable
1364+
1365+
Alternatively, set your API key as an environment variable.
1366+
1367+
```bash frame="none"
1368+
export NVIDIA_API_KEY=nvapi-your-key-here
1369+
```
13431370

13441371
---
13451372

0 commit comments

Comments
 (0)