arjvand / ai-provider-for-nvidia
AI Provider for NVIDIA for the PHP AI Client SDK. Works as both a Composer package and a WordPress plugin.
Requires
- php: >=7.4
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- phpcompatibility/phpcompatibility-wp: ^2.1
- phpstan/phpstan: ~2.1
- slevomat/coding-standard: ^8.20
- squizlabs/php_codesniffer: ^3.7
- wordpress/php-ai-client: ^0.4 || dev-trunk
- wp-coding-standards/wpcs: ^3.0
Suggests
- wordpress/php-ai-client: Required. The core PHP AI Client SDK that this provider extends.
This package is auto-updated.
Last update: 2026-06-14 11:56:15 UTC
README
An AI Provider for NVIDIA for the PHP AI Client SDK. Works as both a Composer package and a WordPress plugin.
Requirements
- PHP 7.4 or higher
- When using with WordPress, requires WordPress 7.0 or higher
- If using an older WordPress release, the wordpress/php-ai-client package must be installed
Installation
As a Composer Package
composer require arjvand/ai-provider-for-nvidia
As a WordPress Plugin
- Download the plugin files
- Upload to
/wp-content/plugins/ai-provider-for-nvidia/ - Ensure the PHP AI Client plugin is installed and activated
- Activate the plugin through the WordPress admin
Usage
With WordPress
The provider automatically registers itself with the PHP AI Client on the init hook. Simply ensure both plugins are active and configure your API key:
// Set your NVIDIA API key (or use the NVIDIA_API_KEY environment variable) putenv('NVIDIA_API_KEY=your-api-key'); // Use the provider $result = AiClient::prompt('Hello, world!') ->usingProvider('nvidia') ->generateTextResult();
As a Standalone Package
use WordPress\AiClient\AiClient; use Arjvand\NvidiaAiProvider\Provider\NvidiaProvider; // Register the provider $registry = AiClient::defaultRegistry(); $registry->registerProvider(NvidiaProvider::class); // Set your API key putenv('NVIDIA_API_KEY=your-api-key'); // Generate text $result = AiClient::prompt('Explain quantum computing') ->usingProvider('nvidia') ->generateTextResult(); echo $result->toText();
Supported Models
Available models are dynamically discovered from the NVIDIA NIM API. This includes text generation models (NVIDIA Nemotron, Meta Llama, Google Gemma, Mistral, and others), and image generation models (Stable Diffusion, Flux). See the NVIDIA Build for the full list of available models.
Configuration
The provider uses the NVIDIA_API_KEY environment variable for authentication. You can set this in your environment or via PHP:
putenv('NVIDIA_API_KEY=your-api-key');
License
GPL-2.0-or-later