Search by

adachsoft / model-pricing-ai-model-list

Arkadiusz Adach

Enriches AI model list metadata with prices from a model pricing catalog

Package info

gitlab.com/a.adach/model-pricing-ai-model-list

Issues

pkg:composer/adachsoft/model-pricing-ai-model-list

Statistics

Installs: 10

Dependents: 1

Suggesters: 0

Stars: 0

v0.1.0 2026-11-18 06:21 UTC

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_gemini to gemini mapping.
  • 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-list and adachsoft/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.