PHPackages                             cortexphp/model-info - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cortexphp/model-info

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cortexphp/model-info
====================

A unified way to get AI model info from various providers

0.3.0(1y ago)11.0k[1 PRs](https://github.com/cortexphp/model-info/pulls)MITPHPPHP ^8.3CI passing

Since May 14Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/cortexphp/model-info)[ Packagist](https://packagist.org/packages/cortexphp/model-info)[ Docs](https://github.com/cortexphp/model-info)[ RSS](/packages/cortexphp-model-info/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (12)Versions (6)Used By (0)

A unified way to get AI model info from various providers
=========================================================

[](#a-unified-way-to-get-ai-model-info-from-various-providers)

[![Latest Version](https://camo.githubusercontent.com/cabe2e8187974f8beb9c7f1af547ec54412c8c8036fae8808844e46107ee8464/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f727465787068702f6d6f64656c2d696e666f2e7376673f7374796c653d666c61742d737175617265266c6f676f3d636f6d706f736572)](https://packagist.org/packages/cortexphp/model-info)[![GitHub Actions Test Workflow Status](https://camo.githubusercontent.com/b54feefab689eada08cc15821ba409decf2f94c7ce18b6c366861e632bff6d03/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f727465787068702f6d6f64656c2d696e666f2f72756e2d74657374732e796d6c3f7374796c653d666c61742d737175617265266c6f676f3d676974687562)](https://camo.githubusercontent.com/b54feefab689eada08cc15821ba409decf2f94c7ce18b6c366861e632bff6d03/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f727465787068702f6d6f64656c2d696e666f2f72756e2d74657374732e796d6c3f7374796c653d666c61742d737175617265266c6f676f3d676974687562)[![GitHub License](https://camo.githubusercontent.com/a90e3ef53e1896bb4f237ee5acf2d3214abe54e2ccf7d97b27b690b2490d8f1f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636f727465787068702f6d6f64656c2d696e666f3f7374796c653d666c61742d737175617265266c6f676f3d676974687562)](https://camo.githubusercontent.com/a90e3ef53e1896bb4f237ee5acf2d3214abe54e2ccf7d97b27b690b2490d8f1f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636f727465787068702f6d6f64656c2d696e666f3f7374796c653d666c61742d737175617265266c6f676f3d676974687562)

Features
--------

[](#features)

- 🤖 **Model Providers** - Get detailed model information with type-safe responses from various model providers (OpenAI, Ollama, etc.)
- 💾 **Caching** - PSR-16 Simple Cache support for caching model information
- 🔌 **Extensibility** - Easily add support for additional model providers

Requirements
------------

[](#requirements)

- PHP 8.3+

Installation
------------

[](#installation)

```
composer require cortexphp/model-info
```

Usage
-----

[](#usage)

```
use Cortex\ModelInfo\ModelInfoFactory;
use Cortex\ModelInfo\Enums\ModelProvider;

// Create a new factory instance
$factory = new ModelInfoFactory();

// Get all available models for a provider
$models = $factory->getModels(ModelProvider::Ollama);
// ['llama3.1', 'llama3.1:8b', 'llama3.1:70b']

// Get information about a specific model
$modelInfo = $factory->getModelInfo(ModelProvider::Ollama, 'llama3.1');

// Accessing model information properties
echo $modelInfo->name;            // 'llama3.1'
echo $modelInfo->provider;        // ModelProvider::Ollama
echo $modelInfo->type;            // ModelType::Chat
echo $modelInfo->maxInputTokens;  // 8000
echo $modelInfo->maxOutputTokens; // null
echo $modelInfo->inputCostPerToken;  // 0.0
echo $modelInfo->outputCostPerToken; // 0.0
echo $modelInfo->isDeprecated;    // false
echo $modelInfo->features;        // [ModelFeature::ToolCalling, ModelFeature::JsonOutput, etc]

// Check if model supports specific features
if ($modelInfo->supportsFeature(ModelFeature::ToolCalling)) {
    // Use tool calling feature
}
```

```
// Using with custom PSR-16 cache implementation
$factory = new ModelInfoFactory(
    cache: $yourPsr16CacheImplementation // `Psr\SimpleCache\CacheInterface`
);

// With exception handling
try {
    $modelInfo = $factory->getModelInfoOrFail(ModelProvider::OpenAI, 'gpt-4o');
} catch (ModelInfoException $e) {
    // Handle exception
}

// Clear the cache
$factory->flushCache();
```

Credits
-------

[](#credits)

- [Sean Tymon](https://github.com/tymondesigns)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance59

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Total

3

Last Release

385d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2730d341811c79252a25178ab52ee3a83a857cf66b409e9691ecd3e89b6307e0?d=identicon)[tymondesigns](/maintainers/tymondesigns)

---

Top Contributors

[![tymondesigns](https://avatars.githubusercontent.com/u/1801923?v=4)](https://github.com/tymondesigns "tymondesigns (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

aillmphpaillmcortexmodel-info

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cortexphp-model-info/health.svg)

```
[![Health](https://phpackages.com/badges/cortexphp-model-info/health.svg)](https://phpackages.com/packages/cortexphp-model-info)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

318117.1k1](/packages/cognesy-instructor-php)[ardagnsrn/ollama-php

This is a PHP library for Ollama. Ollama is an open-source project that serves as a powerful and user-friendly platform for running LLMs on your local machine. It acts as a bridge between the complexities of LLM technology and the desire for an accessible and customizable AI experience.

20874.5k](/packages/ardagnsrn-ollama-php)[symfony/ai-agent

PHP library for building agentic applications.

31746.8k82](/packages/symfony-ai-agent)[soukicz/llm

LLM client with support for cache, tools and async requests

4411.4k](/packages/soukicz-llm)[anilcancakir/laravel-ai-sdk-skills

A skill system for Laravel AI SDK agents. Define reusable AI capabilities with SKILL.md files.

215.2k](/packages/anilcancakir-laravel-ai-sdk-skills)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
