adachsoft / model-pricing-ai-model-list
Enriches AI model list metadata with prices from a model pricing catalog
Package info
gitlab.com/a.adach/model-pricing-ai-model-list
pkg:composer/adachsoft/model-pricing-ai-model-list
v0.1.0
2026-11-18 06:21 UTC
Requires
- php: ^8.3
- adachsoft/ai-model-list: ^0.6
- adachsoft/model-pricing-contracts: ^0.4
Requires (Dev)
- adachsoft/php-code-style: ^0.7.3
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.3
- phpunit/phpunit: ^12.5
- rector/rector: ^2.8
- symplify/phpstan-rules: ^14.19
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-18 05:22:14 UTC
README
This library connects adachsoft/ai-model-list with adachsoft/model-pricing-contracts by enriching model metadata with prices from a configured price catalog.
Features
- Maps price-sheet components and conditions to AI model metadata.
- Supports provider ID aliases, including the default
google_geminitogeminimapping. - Leaves models without a matching price sheet unenriched and treats an unavailable catalog as having no pricing metadata.
Requirements
- PHP 8.3 or later.
adachsoft/ai-model-listandadachsoft/model-pricing-contracts(installed automatically by Composer).
Installation
composer require adachsoft/model-pricing-ai-model-list
Usage
Provide a configured implementation of PriceCatalogInterface and register the enricher with the AI model catalog builder:
use AdachSoft\AIModelList\PublicApi\Builder\AiModelCatalogFacadeBuilder;
use AdachSoft\ModelPricingAiModelList\PriceCatalogModelMetadataEnricher;
use AdachSoft\ModelPricingAiModelList\ProviderIdMap;
use AdachSoft\ModelPricingContracts\Catalog\PriceCatalogInterface;
/** @var PriceCatalogInterface $priceCatalog */
$priceCatalog = /* obtain the configured catalog */;
$facade = (new AiModelCatalogFacadeBuilder(null, null, null))
->withEnricher(new PriceCatalogModelMetadataEnricher($priceCatalog, ProviderIdMap::withDefaults()))
->build();
See the examples for provider aliases and direct enrichment.