A collection of AI model specifications across different providers
Project description
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
pip install aimodels.dev
Usage
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
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
@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
@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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aimodels_dev-0.3.13.tar.gz
(7.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aimodels_dev-0.3.13.tar.gz.
File metadata
- Download URL: aimodels_dev-0.3.13.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ef1c65a238bc061f30ede3aeca488958bf7055df08c6da4dd4d792663bd3be8
|
|
| MD5 |
1007f0a940f6c36428c830f9dcfa2fc9
|
|
| BLAKE2b-256 |
9f6adf8ef4d181323f2c4f114fb18b9a26debdc52eeebc29ba2990f12a7ac552
|
File details
Details for the file aimodels_dev-0.3.13-py3-none-any.whl.
File metadata
- Download URL: aimodels_dev-0.3.13-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a737a3a39c6e0e92e33d89e1ee8774a99046889a61194e683b51cf6499c8a4a
|
|
| MD5 |
d38b441453cb848f7192e8ec739dad6e
|
|
| BLAKE2b-256 |
43445a3f48fab43d63c142528fe0e94d9051f46334151930c0aafafc024b0c42
|