adachsoft / ai-model-list-provider-minimax
MiniMax SPI provider for AdachSoft AI Model List.
Package info
gitlab.com/a.adach/ai-model-list-provider-minimax
pkg:composer/adachsoft/ai-model-list-provider-minimax
Requires
- php: ^8.3
- adachsoft/ai-model-list: ^0.4
- adachsoft/collection: ^3.0
- guzzlehttp/guzzle: ^7.10
Requires (Dev)
- adachsoft/console-io: ^0.2
- adachsoft/php-code-style: ^0.4
- friendsofphp/php-cs-fixer: ^3.94
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^13.0
- rector/rector: ^2.3
- vlucas/phpdotenv: ^5.6
This package is not auto-updated.
Last update: 2026-07-26 02:00:11 UTC
README
This library provides a MiniMax SPI provider implementation for the adachsoft/ai-model-list ecosystem. It allows you to expose MiniMax models through the common SPI interface used by other AI providers in AdachSoft tools.
Installation
Install via Composer:
composer require adachsoft/ai-model-list-provider-minimax
The package will automatically register itself in the adachsoft/ai-model-list ecosystem using the SPI entry file defined in composer.json.
Configuration
The provider requires a MiniMax API key and supports multiple regions.
Environment variables
Set your API key in the environment (for example via a .env file loaded by vlucas/phpdotenv):
MINMAX_API_KEY- or, for backward compatibility,
MINIMAX_API_KEY
If both are set, MINMAX_API_KEY takes precedence.
Region
The provider supports at least the following regions (exact values depend on the MiniMax HTTP client implementation):
globalchina
If no region is configured explicitly, the default region is used (typically global).
Timeout
You can configure a request timeout (in seconds). If omitted, a sensible default is applied.
Usage
The provider is exposed through the SPI factory and can be used wherever the AiModelProviderInterface from adachsoft/ai-model-list is expected.
Basic example (pseudo-code):
use AdachSoft\AIModelList\Spi\AiModelProvider\Model\ProviderId;
use AdachSoft\AIModelListProviderMinimax\Factory\MinimaxSpiProviderFactory;
$apiKey = getenv('MINMAX_API_KEY') ?: getenv('MINIMAX_API_KEY');
$region = null; // or e.g. 'global', 'china'
$timeout = null; // or integer number of seconds
$provider = MinimaxSpiProviderFactory::create($apiKey, $region, $timeout);
$models = $provider->listModels(new ProviderId('minimax'));
foreach ($models as $model) {
// work with $model->modelId, $model->displayName, $model->capabilities, ...
}
For more advanced scenarios you can integrate the provider through your configuration system and dependency injection container by using MinimaxSpiProviderFactory::make().
Development
Useful Composer scripts provided by this package:
composer test\ Run the PHPUnit test suite.composer stan\ Run PHPStan static analysis.composer cs:check/composer cs:fix\ Run PHP CS Fixer in check or fix mode.
There is also a development CLI script for listing models directly from MiniMax:
php bin_dev/minimax-list-models
This command expects a valid API key in MINMAX_API_KEY (or MINIMAX_API_KEY) and prints all available model identifiers.