adachsoft / ai-model-list-provider-nvidia
ai-model-list-provider-nvidia
Package info
gitlab.com/a.adach/ai-model-list-provider-nvidia
pkg:composer/adachsoft/ai-model-list-provider-nvidia
Requires
- php: ^8.3
- adachsoft/ai-model-list: ^0.4.0
- adachsoft/ai-model-list-plugin: ^0.4
Requires (Dev)
- adachsoft/php-code-style: ^0.5.0
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^13.2
- rector/rector: ^2.5
- vlucas/phpdotenv: ^5.6
This package is not auto-updated.
Last update: 2026-06-29 18:34:55 UTC
README
This package provides an NVIDIA implementation of the ai-model-list SPI. It exposes a simple PHP API for listing available NVIDIA AI models using the unified AiModelProvider interface.
Installation
Install via Composer:
composer require adachsoft/ai-model-list-provider-nvidia
Requirements
- PHP >= 8.3
adachsoft/ai-model-list(installed automatically as a dependency)- An NVIDIA API key
Usage
use AdachSoft\AIModelList\Spi\AiModelProvider\Model\ProviderId;
use AdachSoft\AiModelListProviderNvidia\Factory\NvidiaAiModelProviderFactory;
$apiKey = getenv('NVIDIA_KEY'); // or load from your own configuration/.env
$factory = new NvidiaAiModelProviderFactory();
$provider = $factory->create($apiKey);
$providerId = new ProviderId('nvidia');
$models = $provider->listModels($providerId);
foreach ($models as $model) {
echo $model->getName() . PHP_EOL;
}
Testing
To run the test suite:
composer install
vendor/bin/phpunit
There is also an optional production test that can hit the real NVIDIA API. It is marked with the production PHPUnit group and requires a valid NVIDIA_KEY in your environment or .env file.
vendor/bin/phpunit --group production
Versioning
This library follows Semantic Versioning.
License
MIT License. See the LICENSE file for details.