aisdk / nvidia
Official Nvidia provider for the PHP AI SDK.
Fund package maintenance!
v0.8.1
2026-07-22 06:29 UTC
Requires
- php: ^8.3
- aisdk/core: ^0.8.0
- aisdk/openai-compatible: ^0.8.0
Requires (Dev)
- laravel/pint: ^1.18
- nyholm/psr7: ^1.8
- pestphp/pest: ^3.0 || ^4.0
- phpstan/phpstan: ^2.0
- rector/rector: ^2.0
README
Official NVIDIA provider for the PHP AI SDK. Uses NVIDIA NIM's OpenAI-compatible API.
Installation
composer require aisdk/nvidia
Basic Usage
use 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();
Configuration
Environment Variables
| 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 |
Programmatic Configuration
Nvidia::create([ 'apiKey' => $_ENV['NVIDIA_API_KEY'], 'baseUrl' => 'https://integrate.api.nvidia.com/v1', ]);
Supported Capabilities
| 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 |
Provider Options
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.