Search by

adachsoft / ai-model-list-tool

Arkadiusz Adach

An ai-tool-call tool for listing AI providers, models, and optional pricing metadata.

Package info

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

Issues

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

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-11-18 09:47 UTC

This package is auto-updated.

Last update: 2026-11-18 10:14:37 UTC


README

adachsoft/ai-model-list-tool provides the ai_model_list tool for the adachsoft/ai-tool-call SPI. It exposes registered AI providers and their models, with optional pricing metadata from a model-pricing API.

Features

  • List registered providers.
  • List models for a provider and optionally filter by model ID.
  • Include model capabilities, token limits, and available pricing details.
  • Discover provider integrations through adachsoft/ai-model-list-plugin.

Requirements and installation

Requires PHP 8.3 or later. Install the library and its dependencies with Composer:

composer require adachsoft/ai-model-list-tool

Usage

Register the factory with the ai-tool-call facade builder and call the tool using the ai_model_list name:

use AdachSoft\AiModelListTool\Factory\AiModelListToolFactory;
use AdachSoft\AiToolCall\PublicApi\Builder\AiToolCallFacadeBuilder;
use AdachSoft\AiToolCall\PublicApi\Dto\ToolCallRequestDto;
use AdachSoft\AiToolCall\SPI\Collection\ConfigMap;

$facade = AiToolCallFacadeBuilder::new()
    ->withSpiFactories([new AiModelListToolFactory()])
    ->withToolConfigs([
        'ai_model_list' => new ConfigMap([]),
    ])
    ->build();

$result = $facade->callTool(new ToolCallRequestDto(
    toolName: 'ai_model_list',
    parameters: ['operation' => 'list_providers'],
));

Use list_models with a provider_id parameter to retrieve models. The optional model_id_contains parameter filters model IDs case-insensitively. Configure model_pricing_api_url in the tool's ConfigMap to enable pricing data; provider credentials and configuration are documented by their respective provider packages.

See the usage example for a model-listing request and pricing configuration.