Official NVIDIA provider for the PHP AI SDK. Uses NVIDIA NIM's OpenAI-compatible API.
composer require aisdk/nvidiause AiSdk\Generate;
use AiSdk\Nvidia;
Nvidia::create(['apiKey' => $_ENV['NVIDIA_API_KEY']]);
$result = Generate::text('Explain this code briefly.')
->model(Nvidia::model('nvidia/llama-3.3-nemotron-super-49b-v1.5'))
->run();| Variable | Description | Default |
|---|---|---|
NVIDIA_API_KEY |
API key for authentication | Required |
NVIDIA_BASE_URL |
Base URL for API requests | https://integrate.api.nvidia.com/v1 |
Nvidia::create([
'apiKey' => $_ENV['NVIDIA_API_KEY'],
'baseUrl' => 'https://integrate.api.nvidia.com/v1',
]);| Capability | Support |
|---|---|
| Text generation and streaming | Native OpenAI-compatible chat |
| Tool calling, structured output, reasoning | Passed through for supported NIM models |
| Image input | Passed through for compatible vision models |
Use providerOptions('nvidia', ['raw' => [...]]) for documented NIM chat-completions fields outside the portable SDK surface. Model IDs are opaque strings and are validated by NVIDIA.