# ![Nvidia logo](https://models.dev/logos/nvidia.svg)Nvidia

Access 92 Nvidia models through Mastra's model router. Authentication is handled automatically using the `NVIDIA_API_KEY` environment variable.

Learn more in the [Nvidia documentation](https://docs.api.nvidia.com/nim/).

```bash
NVIDIA_API_KEY=your-api-key
```

```typescript
import { Agent } from "@mastra/core/agent";

const agent = new Agent({
  id: "my-agent",
  name: "My Agent",
  instructions: "You are a helpful assistant",
  model: "nvidia/abacusai/dracarys-llama-3_1-70b-instruct"
});

// Generate a response
const response = await agent.generate("Hello!");

// Stream a response
const stream = await agent.stream("Tell me a story");
for await (const chunk of stream) {
  console.log(chunk);
}
```

> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Nvidia documentation](https://docs.api.nvidia.com/nim/) for details.

## Models

| Model                                                  | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
| ------------------------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
| `nvidia/abacusai/dracarys-llama-3_1-70b-instruct`      | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/baai/bge-m3`                                   | 8K      |       |           |       |       |       | —          | —           |
| `nvidia/black-forest-labs/flux_1-kontext-dev`          | 41K     |       |           |       |       |       | —          | —           |
| `nvidia/black-forest-labs/flux_1-schnell`              | 77      |       |           |       |       |       | —          | —           |
| `nvidia/black-forest-labs/flux_2-klein-4b`             | 41K     |       |           |       |       |       | —          | —           |
| `nvidia/black-forest-labs/flux.1-dev`                  | 4K      |       |           |       |       |       | —          | —           |
| `nvidia/bytedance/seed-oss-36b-instruct`               | 262K    |       |           |       |       |       | —          | —           |
| `nvidia/deepseek-ai/deepseek-v3.1-terminus`            | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/deepseek-ai/deepseek-v3.2`                     | 164K    |       |           |       |       |       | —          | —           |
| `nvidia/deepseek-ai/deepseek-v4-flash`                 | 1.0M    |       |           |       |       |       | $0.14      | $0.28       |
| `nvidia/deepseek-ai/deepseek-v4-pro`                   | 1.0M    |       |           |       |       |       | $2         | $3          |
| `nvidia/google/gemma-2-2b-it`                          | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/google/gemma-3-27b-it`                         | 131K    |       |           |       |       |       | —          | —           |
| `nvidia/google/gemma-3n-e2b-it`                        | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/google/gemma-3n-e4b-it`                        | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/google/gemma-4-31b-it`                         | 256K    |       |           |       |       |       | —          | —           |
| `nvidia/google/google-paligemma`                       | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/meta/esm2-650m`                                | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/meta/esmfold`                                  | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/meta/llama-3.1-70b-instruct`                   | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/meta/llama-3.1-8b-instruct`                    | 16K     |       |           |       |       |       | —          | —           |
| `nvidia/meta/llama-3.2-11b-vision-instruct`            | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/meta/llama-3.2-1b-instruct`                    | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/meta/llama-3.2-3b-instruct`                    | 33K     |       |           |       |       |       | —          | —           |
| `nvidia/meta/llama-3.2-90b-vision-instruct`            | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/meta/llama-3.3-70b-instruct`                   | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/meta/llama-4-maverick-17b-128e-instruct`       | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/meta/llama-guard-4-12b`                        | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/microsoft/phi-4-mini-instruct`                 | 131K    |       |           |       |       |       | —          | —           |
| `nvidia/microsoft/phi-4-multimodal-instruct`           | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/minimaxai/minimax-m2.5`                        | 205K    |       |           |       |       |       | —          | —           |
| `nvidia/minimaxai/minimax-m2.7`                        | 205K    |       |           |       |       |       | —          | —           |
| `nvidia/mistralai/devstral-2-123b-instruct-2512`       | 262K    |       |           |       |       |       | —          | —           |
| `nvidia/mistralai/magistral-small-2506`                | 33K     |       |           |       |       |       | —          | —           |
| `nvidia/mistralai/mistral-7b-instruct-v03`             | 66K     |       |           |       |       |       | —          | —           |
| `nvidia/mistralai/mistral-large-3-675b-instruct-2512`  | 262K    |       |           |       |       |       | —          | —           |
| `nvidia/mistralai/mistral-medium-3-instruct`           | 131K    |       |           |       |       |       | —          | —           |
| `nvidia/mistralai/mistral-nemotron`                    | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/mistralai/mistral-small-4-119b-2603`           | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/mistralai/mixtral-8x22b-instruct`              | 66K     |       |           |       |       |       | —          | —           |
| `nvidia/mistralai/mixtral-8x7b-instruct`               | 33K     |       |           |       |       |       | —          | —           |
| `nvidia/moonshotai/kimi-k2-instruct`                   | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/moonshotai/kimi-k2-instruct-0905`              | 262K    |       |           |       |       |       | —          | —           |
| `nvidia/moonshotai/kimi-k2-thinking`                   | 262K    |       |           |       |       |       | —          | —           |
| `nvidia/moonshotai/kimi-k2.6`                          | 262K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/active-speaker-detection`               | —       |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/bevformer`                              | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/cosmos-predict1-5b`                     | —       |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/cosmos-transfer1-7b`                    | —       |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/cosmos-transfer2_5-2b`                  | —       |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/gliner-pii`                             | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/llama-3_1-nemotron-safety-guard-8b-v3`  | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/llama-3_2-nemoretriever-300m-embed-v1`  | 33K     |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/llama-3_3-nemotron-super-49b-v1`        | 131K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/llama-3_3-nemotron-super-49b-v1_5`      | 131K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/llama-nemotron-embed-vl-1b-v2`          | 33K     |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/llama-nemotron-rerank-vl-1b-v2`         | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/magpie-tts-zeroshot`                    | —       |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/nemotron-3-content-safety`              | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/nemotron-3-nano-30b-a3b`                | 131K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/nemotron-3-nano-omni-30b-a3b-reasoning` | 256K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/nemotron-3-super-120b-a12b`             | 262K    |       |           |       |       |       | $0.20      | $0.80       |
| `nvidia/nvidia/nemotron-content-safety-reasoning-4b`   | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/nemotron-mini-4b-instruct`              | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/nemotron-voicechat`                     | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/nv-embed-v1`                            | 33K     |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/nv-embedcode-7b-v1`                     | 33K     |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/nvidia-nemotron-nano-9b-v2`             | 131K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/rerank-qa-mistral-4b`                   | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/riva-translate-4b-instruct-v1_1`        | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/sparsedrive`                            | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/streampetr`                             | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/studiovoice`                            | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/synthetic-video-detector`               | —       |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/usdcode`                                | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/nvidia/usdvalidate`                            | —       |       |           |       |       |       | —          | —           |
| `nvidia/openai/gpt-oss-120b`                           | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/openai/gpt-oss-20b`                            | 131K    |       |           |       |       |       | —          | —           |
| `nvidia/openai/whisper-large-v3`                       | —       |       |           |       |       |       | —          | —           |
| `nvidia/qwen/qwen-image`                               | —       |       |           |       |       |       | —          | —           |
| `nvidia/qwen/qwen-image-edit`                          | —       |       |           |       |       |       | —          | —           |
| `nvidia/qwen/qwen2.5-coder-32b-instruct`               | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/qwen/qwen3-coder-480b-a35b-instruct`           | 262K    |       |           |       |       |       | —          | —           |
| `nvidia/qwen/qwen3-next-80b-a3b-instruct`              | 262K    |       |           |       |       |       | —          | —           |
| `nvidia/qwen/qwen3-next-80b-a3b-thinking`              | 262K    |       |           |       |       |       | —          | —           |
| `nvidia/qwen/qwen3.5-122b-a10b`                        | 262K    |       |           |       |       |       | —          | —           |
| `nvidia/qwen/qwen3.5-397b-a17b`                        | 262K    |       |           |       |       |       | —          | —           |
| `nvidia/sarvamai/sarvam-m`                             | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/stepfun-ai/step-3.5-flash`                     | 256K    |       |           |       |       |       | —          | —           |
| `nvidia/upstage/solar-10_7b-instruct`                  | 128K    |       |           |       |       |       | —          | —           |
| `nvidia/z-ai/glm-5.1`                                  | 131K    |       |           |       |       |       | —          | —           |
| `nvidia/z-ai/glm4.7`                                   | 205K    |       |           |       |       |       | —          | —           |

## Advanced configuration

### Custom headers

```typescript
const agent = new Agent({
  id: "custom-agent",
  name: "custom-agent",
  model: {
    url: "https://integrate.api.nvidia.com/v1",
    id: "nvidia/abacusai/dracarys-llama-3_1-70b-instruct",
    apiKey: process.env.NVIDIA_API_KEY,
    headers: {
      "X-Custom-Header": "value"
    }
  }
});
```

### Dynamic model selection

```typescript
const agent = new Agent({
  id: "dynamic-agent",
  name: "Dynamic Agent",
  model: ({ requestContext }) => {
    const useAdvanced = requestContext.task === "complex";
    return useAdvanced
      ? "nvidia/z-ai/glm4.7"
      : "nvidia/abacusai/dracarys-llama-3_1-70b-instruct";
  }
});
```