Metadata-Version: 2.4
Name: aimodels.dev
Version: 0.3.13
Summary: A collection of AI model specifications across different providers
Project-URL: Homepage, https://github.com/mitkury/aimodels#readme
Project-URL: Repository, https://github.com/mitkury/aimodels.git
Project-URL: Issues, https://github.com/mitkury/aimodels/issues
Author-email: Dmitry Kury <d@dkury.com>
License-Expression: MIT
Keywords: ai,ai models,anthropic,llm,machine-learning,mistral,models,open-source,openai,specifications
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Provides-Extra: dev
Requires-Dist: build>=1.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: twine>=4.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# AIModels

A collection of AI model specifications across different providers. This package provides normalized data about AI models, including their capabilities, context windows, and pricing information.

## Installation

```bash
pip install aimodels.dev
```

## Usage

```python
from aimodels import models

# Find models by capability
chat_models = models.can("chat")
vision_models = models.can("img-in")
reasoning_models = models.can("reason")

# Fluent API (equivalent to the capability filters above)
fluent_chat = models.canChat()
fluent_multimodal = models.canChat().canSee()

# Find models with multiple capabilities
multimodal_models = models.can("chat", "img-in")
audio_models = models.can("audio-in", "audio-out")
full_stack_models = models.can("chat", "fn-out", "json-out")

# Find models by provider
openai_models = models.from_provider("openai")

# Find models by creator
meta_models = models.from_creator("meta")

# Find models by context window
large_context_models = models.with_min_context(32768)

# Find specific model
model = models.id("gpt-4")
print(model.context.total)  # Context window size
print(model.providers)  # ['openai']

# Get pricing information (via provider pricing table)
provider = models.get_provider("openai")
if provider and provider.pricing:
    pricing = provider.pricing.get("gpt-4")
    if isinstance(pricing, dict) and pricing.get("type") == "token":
        print(f"Input: ${pricing['input']}/1M tokens")
        print(f"Output: ${pricing['output']}/1M tokens")

# Get provider information
if provider:
    print(f"Name: {provider.name}")
    print(f"Website: {provider.websiteUrl}")
    print(f"API: {provider.apiUrl}")
```

## Features

- Comprehensive database of AI models from major providers (OpenAI, Anthropic, Mistral, etc.)
- Normalized data structure for easy comparison
- Model capabilities (chat, img-in, img-out, function-out, etc.)
- Context window information
- Creator and provider associations
- Type hints with full type safety
- Zero dependencies
- Regular updates with new models

## Types

### Model
```python
class Model:
    """Represents an AI model with its capabilities and specifications."""
    id: str
    name: str
    capabilities: List[str]
    providerIds: List[str]
    creatorId: Optional[str]
    context: ModelContext

    def can(self, *caps: str) -> bool: ...
    def canChat(self) -> bool: ...
    def canReason(self) -> bool: ...
    def canRead(self) -> bool: ...
    def canWrite(self) -> bool: ...
    def canSee(self) -> bool: ...
    def canGenerateImages(self) -> bool: ...
    def canHear(self) -> bool: ...
    def canSpeak(self) -> bool: ...
    def canOutputJSON(self) -> bool: ...
    def canCallFunctions(self) -> bool: ...
    def canGenerateEmbeddings(self) -> bool: ...

    # Convenience aliases
    @property
    def providers(self) -> List[str]: ...
    @property
    def creator(self) -> Optional[str]: ...
```

### ModelContext
```python
@dataclass
class ModelContext:
    """Context window information for a model."""
    total: Optional[int] = None
    max_output: Optional[int] = None
    sizes: Optional[List[str]] = None
    qualities: Optional[List[str]] = None
    type: Optional[str] = None
    unit: Optional[str] = None
    dimensions: Optional[int] = None
    output_is_fixed: Optional[Union[int, bool]] = None
    extended: Optional[Dict[str, Any]] = None
    embedding_type: Optional[str] = None
    normalized: Optional[bool] = None
```

### Provider
```python
@dataclass
class Provider:
    """Provider information (merged with organization fields to match JS Provider)."""
    id: str
    name: str
    websiteUrl: Optional[str] = None
    country: Optional[str] = None
    founded: Optional[int] = None
    apiUrl: Optional[str] = None
    apiDocsUrl: Optional[str] = None
    isLocal: Optional[int] = None
    pricing: Dict[str, Dict[str, Any]] | None = None
```

## License

MIT
