adachsoft / ai-model-list-provider-zai
z.ai (GLM) SPI provider for AdachSoft AI Model List.
Package info
gitlab.com/a.adach/ai-model-list-provider-zai
pkg:composer/adachsoft/ai-model-list-provider-zai
v0.1.0
2026-07-24 12:37 UTC
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.5
- friendsofphp/php-cs-fixer: ^3.94
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^13.0
- rector/rector: ^2.3
- symplify/phpstan-rules: ^14.12
- vlucas/phpdotenv: ^5.6
This package is not auto-updated.
Last update: 2026-07-25 08:52:10 UTC
README
z.ai (GLM) SPI provider for AdachSoft AI Model List.
Installation
composer require adachsoft/ai-model-list-provider-zai
Configuration
The provider requires the following configuration keys:
api_key(required): Your z.ai API key.region(optional):globalorchina, defaultglobal.global:https://api.z.ai/api/paas/v4/china:https://open.bigmodel.cn/api/paas/v4/
timeout(optional): Request timeout in seconds, default10.0, must be > 0 and <= 120.
Usage
Direct Usage
use AdachSoft\AIModelListProviderZai\Factory\ZaiSpiProviderFactory;
use AdachSoft\AIModelList\Spi\AiModelProvider\Model\ProviderId;
$provider = ZaiSpiProviderFactory::create('your-api-key', \AdachSoft\AIModelListProviderZai\Config\RegionEnum::GLOBAL, 10.0);
$models = $provider->listModels(new ProviderId('zai'));
foreach ($models as $model) {
echo $model->modelId->value . ' (' . $model->displayName . ')' . PHP_EOL;
foreach ($model->capabilities as $capability) {
echo ' - ' . $capability->value . PHP_EOL;
}
}
Usage via adachsoft/ai-model-list
This package supports autodiscovery. Ensure adachsoft/ai-model-list is installed and configured to load providers from resources/ai-model-list.php. The provider will be registered automatically with the zai provider ID.
Notes
- The endpoint base URL depends on the selected region (
globalvschina). IMAGEcapability is inferred heuristically forglm-*.v*and models containingvisionin their ID. All models always supportCHATcapability.
License
This package is licensed under the MIT License.