Lookup capabilities (context window, modalities, supported features) of various LLM models — offline; GitHub catalogs are only fetched when explicitly requested.
- Comprehensive Bundled Data: Offline capability data for OpenAI, Anthropic, Google (Gemini), Microsoft (Phi), Amazon (Nova/Titan), Meta (Llama), Mistral, Cohere (Command), Qwen, DeepSeek, xAI (Grok), NVIDIA, MoonshotAI (Kimi), zhipu-ai (GLM), Sakana AI (Fugu), Azure AI Foundry, Baseten, DeepInfra, Nebius Token Factory, Novita AI, Together AI (98 models), OpenRouter, HuggingFace (2,904 popular models), Modellix LLM and Media models (29 LLM and 178 media records), mdx.MaaS (6 models), Cloudflare Workers AI (69 models), Particle AI Inference (3 models), TypeSafe (Jev / System One decision-output models), and Japanese domestic models (NTT tsuzumi, PFN PLaMo, ELYZA, SoftBank, NEC, Fujitsu, etc. adopted by the Digital Agency's "GENNAI" platform).
- Zero Runtime Dependencies: Built entirely on the Python standard library.
- Alias Resolution: Automatically resolves model aliases and provider-specific names (e.g.,
gpt-4o-2024-08-06->gpt-4o,gemini-1.5-pro-preview-0409->gemini-1.5-pro). - Provider Aliases: Provider arguments accept common aliases and normalized forms (e.g.,
grok/x-ai→xai,bedrock/aws-bedrock/aws→amazon,vertexai→vertex-ai,open-ai→openai,google-ai→google,azure→azure-openai,hf→huggingface,alibaba/dashscope→qwen,lm-studio→lmstudio,modellix-ai→modellix,mdx/mdxmaas→mdx-maas,cloudflare/workers-ai→cloudflare-workers-ai,particle→particle-ai). Separators_.are treated as-. - Advanced Feature Queries: Check support for
vision,multimodal,chat_completion,responses_api,realtime,tool_search,reasoning_effort,reasoning_mode,thinking_budget, and specific input/output modalities (e.g.,image_input,audio_input,file_input,speech_input,embedding_output). PDF is treated as a subtype offile_input. - High Performance: Evaluated feature checks are cached internally using memoization to avoid redundant calculations.
- Cost Estimation: Estimate API costs based on input and output token counts.
- Drop-in Replacement Checker: Check if a model can be safely replaced by another model based on context window and required features.
- Tokenizer Mapping: Access tokenizer names (e.g.,
o200k_base) directly from model capabilities. - Extendable: Load your own local JSON model definitions.
- Ollama & HuggingFace Support: Full capability data for 1,656 Ollama models and 2,904 popular HuggingFace models across 236 base models with all size variants (codegemma, llama, qwen, mistral, deepseek, gemma, phi, etc.). Zero-cost local inference models included.
- FIM (Fill-in-the-Middle) Support: Check if a model supports code infilling via
cap.supports('fim'). Supported for codegemma, codellama, starcoder2, deepseek-coder, qwen2.5-coder, and more. - CLI Included: Query and list model capabilities directly from your terminal.
The canonical provider is azure-foundry. Both azure-openai and azure are exact aliases of azure-foundry, with identical get, search, and list_models results.
llmcapa.get("gpt-5.4", provider="azure-foundry")
llmcapa.get("gpt-5.4", provider="azure-openai") # Same result
llmcapa.get("gpt-5.4", provider="azure") # Same resultThe returned Capability.provider is normalized to azure-foundry, and providers() lists it once. Existing official JSON rows are left unchanged and are normalized on registration.
Behavior change: The azure-openai alias now also resolves Foundry-hosted non-OpenAI models. The direct openai provider is still independent. Original source and service-specific metadata are preserved.
Run the Refresh all model catalogs GitHub Actions workflow manually to update each supported provider from its official sources, generate a full model diff, and open a reviewable PR. See the catalog refresh guide (Japanese).
pip install llmcapaOr from source:
pip install .import llmcapa
# Get model capabilities (case-insensitive, alias-resolved)
cap = llmcapa.get("gpt-4o")
# Provider aliases: grok→xai, bedrock→amazon, alibaba→qwen, lm-studio→lmstudio, ...
# cap = llmcapa.get("grok-4", provider="grok")
print(cap.context_window) # 128000
print(cap.max_output_tokens) # 16384
print(cap.tokenizer_name) # "o200k_base"
# Check feature support (using strings or Feature enum)
from llmcapa import Feature, ReasoningEffort
print(cap.supports(Feature.LLMC_FEAT_VISION)) # True
print(cap.supports(Feature.LLMC_FEAT_RESPONSES_API)) # True
print(cap.supports(Feature.LLMC_FEAT_REASONING_EFFORT)) # False
# Use ReasoningEffort enum for models supporting reasoning_effort
print(ReasoningEffort.LLMC_EFFORT_HIGH) # "high"
# List all supported features
print(cap.features())
# ['chat_completion', 'file', 'file_input', 'function_calling', 'image', 'image_input', 'json_mode', 'multimodal', 'responses_api', 'streaming', 'text', 'text_input', 'text_output', 'vision']The published mdx.MaaS models can be queried by provider. mdx.MaaS normalizes to mdx-maas.
import llmcapa
models = llmcapa.list_models(provider="mdx.MaaS")
gemma = llmcapa.get(
"google/gemma-4-31B-it-qat-w4a16-ct", provider="mdx-maas"
)
print(len(models)) # 6 published models
print(gemma.supports("image_input")) # True
print(gemma.supports_function_calling) # True (documented by mdx.MaaS)
print(gemma.supports_responses_api) # False
print(gemma.extra["api_availability"]) # Immediate and Batch API availabilityDeployment-specific context/output limits remain 0 when mdx.MaaS does not publish them. Its model list states a maximum 128k context for openai/gpt-oss-20b.
The catalog records the OpenAI-compatible Chat Completions API and does not claim Responses API support.
Workers AI models are discovered from Cloudflare's official documentation index. The cloudflare and workers-ai provider aliases resolve to cloudflare-workers-ai.
import llmcapa
models = llmcapa.list_models(provider="cloudflare")
embedding = llmcapa.get("@cf/baai/bge-m3", provider="workers-ai")
gpt_oss = llmcapa.get("@cf/openai/gpt-oss-20b", provider="cloudflare-workers-ai")
print(len(models)) # current bundled model count
print(gpt_oss.context_window) # 128000 (official model page)
print(gpt_oss.supports_responses_api) # True (documented GPT-OSS support)
print(embedding.supports("embedding_output")) # TrueThe catalog updater reads model IDs, task types, feature badges, context windows, and pricing from the official index/model pages. Unpublished values remain unknown; the Responses API flag is derived from Cloudflare's compatibility documentation.
Roughly estimate the number of tokens for a given text (supporting 30+ major languages) and calculate API costs:
Note
Token estimation is a lightweight, offline approximation. For exact token counts, please use the official APIs or dedicated tokenizers from each provider.
gpt = llmcapa.get("gpt-4o")
# Estimate tokens for multilingual text
# If `tiktoken` is installed, it dynamically uses it for exact OpenAI token counts.
# Otherwise, it falls back to a highly-optimized, standard-library-only estimation.
text = "Hello world! こんにちは世界。"
tokens = gpt.estimate_tokens(text)
print(tokens) # 10 (estimated tokens)
# Estimate API costs based on token counts (returns cost and currency)
res = gpt.estimate_cost(input_tokens=1500, output_tokens=500)
print(res) # {'cost': 0.00875, 'currency': 'USD'}Check if a model can be safely replaced by another model. The replacement model must have a context window at least as large as the target model and support all required features.
gpt4o = llmcapa.get("gpt-4o")
gpt4o_mini = llmcapa.get("gpt-4o-mini")
gemini = llmcapa.get("gemini-3.5-flash")
# gpt-4o-mini has the same context window and supports all the same features
print(gpt4o.can_be_replaced_by(gpt4o_mini)) # True
# gemini-3.5-flash has a larger context window but lacks responses_api (which gpt-4o supports)
print(gpt4o.can_be_replaced_by(gemini)) # False
# If we only require vision and function_calling, gemini-3.5-flash can replace gpt-4o
print(gpt4o.can_be_replaced_by(gemini, required_features=["vision", "function_calling"])) # TrueYou can check specific input/output modalities or general multimodal support using Feature enum:
from llmcapa import Feature
gemini = llmcapa.get("gemini-3.5-flash")
print(gemini.supports(Feature.LLMC_FEAT_MULTIMODAL)) # True (supports multiple modalities)
print(gemini.supports(Feature.LLMC_FEAT_AUDIO_INPUT)) # True
print(gemini.supports(Feature.LLMC_FEAT_IMAGE_OUTPUT)) # FalseUse the Feature enum to query Realtime APIs, file inputs, speech input/output, and embedding outputs. PDF is treated as a subtype of file_input.
from llmcapa import Feature
realtime = llmcapa.get("gpt-realtime-2")
print(realtime.supports(Feature.LLMC_FEAT_REALTIME)) # True
speech = llmcapa.get("nova-2-sonic-v1", provider="amazon")
print(speech.supports(Feature.LLMC_FEAT_SPEECH_INPUT)) # True
print(speech.supports(Feature.LLMC_FEAT_SPEECH_OUTPUT)) # True
pdf_model = llmcapa.get("muse-spark-1.1", provider="meta")
print(pdf_model.supports(Feature.LLMC_FEAT_FILE_INPUT)) # True
embedding = llmcapa.get("gemini-embedding-001", provider="google")
print(embedding.supports(Feature.LLMC_FEAT_EMBEDDING_OUTPUT)) # Truebedrock resolves to Amazon. google and vertex-ai are separate providers.
nova = llmcapa.get("nova-sonic-v1", provider="bedrock")
gemini_live = llmcapa.get("gemini-3.1-flash-live-preview", provider="google")Models with audio modalities expose detailed speech metadata through cap.audio. Values not documented by the provider are not guessed; only conservative modality-derived fields are marked as status="inferred".
cap = llmcapa.get("gpt-4o-transcribe", provider="openai")
print(cap.audio.transcription) # True
print(cap.audio.input_formats) # ('flac', 'mp3', ...)
print(cap.audio.max_input_bytes) # 25000000
voice = llmcapa.get("gpt-4o-mini-tts", provider="openai")
print(voice.audio.speech_generation) # True
print(voice.audio.output_formats) # ('mp3', 'opus', ...)
print(voice.audio.voice_values) # voice IDs
print(voice.audio.speed_min) # 0.25
print(voice.audio.speed_max) # 4.0AudioCapability includes transcription, translation, diarization, timestamps, supported formats and MIME types, sample rates, voices, speed and output controls, streaming/Realtime support, and source URLs.
Models with video modalities expose generation, understanding, and editing metadata through cap.video.
video = llmcapa.get("sora-2", provider="openai")
print(video.video.generation) # True
print(video.video.text_to_video) # True
print(video.video.output_formats) # ('mp4',)
reel = llmcapa.get("nova-reel-v1", provider="amazon")
print(reel.video.image_to_video) # True
print(reel.video.duration_values_seconds) # (6.0,)
print(reel.video.output_mime_types) # ('video/mp4',)VideoCapability includes text-to-video, image-to-video, video-to-video, video understanding, editing, interpolation, extension, upscaling, lip-sync, input formats, resolutions, FPS, frame counts, duration, audio tracks, output codecs, streaming/Realtime support, and source URLs.
The following specialized input/output types are also normalized into dedicated metadata records.
doc = llmcapa.get("gemini-embedding-001", provider="google")
print(doc.embedding.dimensions) # Provider metadata, when available
print(doc.embedding.max_input_tokens) # Provider metadata, when available
rerank = llmcapa.get("rerank-v3.5", provider="cohere")
print(rerank.rerank.rerank) # True
# Models with file/pdf/json/csv/code input
print(cap.document.input_formats)
# Geospatial / 3D-image models
print(cap.spatial.kind_values)The bundled Sarashina API catalog covers chat (including Sarashina3.2 mini thinking), embeddings, reranking, translation, and official API endpoints. It records the thinking model's reasoning_effort support and model-specific RPM based on the official documentation (official docs). Pricing is recorded as JPY 0 based on user confirmation; the official documentation does not publish a numeric price table.
sarashina = llmcapa.get("sarashina3-mini", provider="sarashina")
print(sarashina.context_window) # 128000
embedding = llmcapa.get("sarashina3-embedding", provider="sarashina")
reranker = llmcapa.get("sarashina3-rerank", provider="sarashina")
print(embedding.embedding.dimensions) # 1536
print(reranker.rerank.max_documents) # 20document, embedding, rerank, spatial, and decision are appended to the end of Capability to preserve positional-constructor compatibility.
Models that do not generate text and instead return typed decisions with calibrated probabilities (System One style, such as TypeSafe's Jev) are represented with the decision output modality. text_output is false, chat_completion is false, and multimodal does not apply because the input is text only.
import llmcapa
jev = llmcapa.get("jev-1.13.0", provider="typesafe")
print(jev.input_modalities) # ['text']
print(jev.output_modalities) # ['decision']
print(jev.supports("decision_output")) # True
print(jev.supports("text_output")) # False
print(jev.supports("chat_completion")) # False
print(jev.decision.question_kinds) # ('choice', 'score', 'noul')
print(jev.decision.answer_fields) # ('choice', 'score', 'noul', 'probabilities', 'confidence')
print(jev.decision.returns_confidence) # True
print(jev.decision.calibrated_confidence) # True
print(jev.decision.free_form_text) # False
print(jev.decision.type_errors_possible) # False
print(jev.decision.max_total_tokens) # 64000
print(jev.decision.endpoints) # ('https://api.typesafe.ai/v1/systemone',)The OpenRouter route uses the alpha Decisions endpoint rather than /api/v1, and it is not the OpenAI-compatible Responses API.
route = llmcapa.get("typesafe/jev-1.13", provider="openrouter")
print(route.supports("decision_output")) # True
print(route.supports("responses_api")) # False
print(route.decision.endpoints) # ('https://openrouter.ai/api/alpha/decisions',)Because decision output is a distinct output modality, can_be_replaced_by() will not treat a text-generation model as a valid replacement for a decision model.
Laya is also bundled as a local decision provider with its three official checkpoints:
english = llmcapa.get("laya", provider="laya")
multi = llmcapa.get("laya-multilingual", provider="laya")
typed = llmcapa.get("laya-typed-decisions", provider="laya")
print(multi.supports("decision_output")) # True
print(multi.decision.question_kinds) # ('choice', 'score', 'noul')
print(multi.extra["default_context_window"]) # 1024
print(multi.extra["max_context_window"]) # 8192Laya returns probabilities and confidence, but the bundled records deliberately report calibrated_confidence == False: upstream documents that the shipped checkpoints are over-confident and recommends fitting and validating temperatures on held-out data before using confidence thresholds. Laya can run locally in Python or expose the Jev-compatible /v1/systemone HTTP protocol.
See the full provider-neutral API specification in docs/API_SPECIFICATION.md.
Differentiate between OpenAI-style reasoning_effort and Anthropic-style thinking_budget using Feature enum:
from llmcapa import Feature
o1 = llmcapa.get("o1")
print(o1.supports(Feature.LLMC_FEAT_REASONING_EFFORT)) # True
print(o1.supports(Feature.LLMC_FEAT_THINKING_BUDGET)) # False
claude = llmcapa.get("claude-sonnet-4-5", provider="anthropic")
print(claude.supports(Feature.LLMC_FEAT_REASONING_EFFORT)) # False
print(claude.supports(Feature.LLMC_FEAT_THINKING_BUDGET)) # TrueGoogle Gemini's native API uses provider-specific thinking controls rather than
OpenAI's reasoning_effort. Use provider="google" for the Google Generative
Language API and query thinking_budget (Gemini 2.5) or thinking_level
(Gemini 3+):
gemini25 = llmcapa.get("gemini-2.5-flash", provider="google")
print(gemini25.supports(Feature.LLMC_FEAT_REASONING_EFFORT)) # False
print(gemini25.supports(Feature.LLMC_FEAT_THINKING_BUDGET)) # True
gemini3 = llmcapa.get("gemini-3-flash-preview", provider="google")
print(gemini3.supports(Feature.LLMC_FEAT_REASONING_EFFORT)) # False
print(gemini3.supports(Feature.LLMC_FEAT_THINKING_LEVEL)) # Truegoogle and vertex-ai are separate provider routes. The native Google
catalog is not treated as an OpenAI-compatible API.
Retrieve the list of valid reasoning_effort values supported by a specific model:
cap = llmcapa.get("gpt-5.5")
print(cap.get_reasoning_effort_values())
# ['none', 'minimal', 'low', 'medium', 'high', 'xhigh']
cap2 = llmcapa.get("o1")
print(cap2.get_reasoning_effort_values())
# ['none', 'low', 'medium', 'high']
# Models without reasoning_effort support return an empty list
cap3 = llmcapa.get("gpt-4o")
print(cap3.get_reasoning_effort_values())
# []tool_search is recorded per model from its documented Responses API tools. None means the catalog has no verified answer. Reasoning mode is separate from reasoning effort:
cap.responses_api records individual endpoint features such as previous_response_id, conversation state, Responses API streaming, function calling, structured outputs, and built-in tools. Each Boolean is tri-state; None means unknown. The legacy cap.supports_responses_api continues to report endpoint availability.
cap = llmcapa.get("some-model", provider="some-provider")
if cap.responses_api is not None:
print(cap.responses_api.previous_response_id) # True / False / None
print(cap.responses_api.built_in_tools) # tuple or None (unknown)nano = llmcapa.get("gpt-5.4-nano", provider="openai")
print(nano.supports("tool_search")) # False
luna = llmcapa.get("gpt-6-luna", provider="openai")
print(luna.supports("tool_search")) # True
cap = llmcapa.get("gpt-5.6")
print(cap.get_reasoning_mode_values()) # ['standard', 'pro']For gpt-5.6 and gpt-6 Responses API models, reasoning.mode values are standard and pro; reasoning.effort remains an independent setting.
Retrieve information about valid thinking_budget values for models that support it:
cap = llmcapa.get("claude-sonnet-4-20250501")
print(cap.get_thinking_budget_values())
# {'type': 'token_range', 'min': 1024, 'max': 128000}
cap2 = llmcapa.get("deepseek-r1")
print(cap2.get_thinking_budget_values())
# {'type': 'token_range', 'min': 1024, 'max': 8192}
# Models without thinking_budget support return an empty dict
cap3 = llmcapa.get("gpt-4o")
print(cap3.get_thinking_budget_values())
# {}Gemini 3 and other APIs with discrete thinking controls use thinking_level, which is distinct from both reasoning_effort and numeric thinking_budget:
cap = llmcapa.get("gemini-3-flash-preview", provider="vertex-ai")
print(cap.supports(Feature.LLMC_FEAT_THINKING_LEVEL)) # True
print(cap.get_thinking_level_values())
# ['minimal', 'low', 'medium', 'high']
# For Gemini 2.5 / Vertex AI numeric budgets:
budget = llmcapa.get("gemini-2.5-flash", provider="vertex-ai")
print(budget.get_thinking_budget_values())
# {'type': 'token_range', 'min': 0, 'max': 24576}llmcapa reports the provider-specific capability metadata; the application passes the selected thinking_level or thinking_budget to the provider API.
For provider-neutral request construction, use thinking_control:
control = cap.get_thinking_control()
# {'kind': 'level', 'parameter': 'thinking_level',
# 'values': ['minimal', 'low', 'medium', 'high']}
minimax = llmcapa.get("MiniMax-M3", provider="minimax")
print(minimax.get_thinking_control())
# {'kind': 'toggle', 'parameter': 'thinking',
# 'values': ['enabled', 'disabled'], ...}This is additive and does not change the existing reasoning_effort or thinking_budget APIs.
Sakana AI's Fugu is a multi-agent orchestration system presented as a single model. It dynamically coordinates frontier models to tackle complex tasks. llmcapa bundles capability data for both Fugu and Fugu Ultra.
import llmcapa
# Look up Fugu models (case-insensitive, alias-resolved)
fugu = llmcapa.get("fugu")
print(fugu.context_window) # 272000
print(fugu.max_output_tokens) # 128000
print(fugu.supports("vision")) # True (text+image input)
print(fugu.pricing) # {'input_per_1m': 5.0, 'output_per_1m': 30.0, ...}
fugu_ultra = llmcapa.get("fugu-ultra")
print(fugu_ultra.context_window) # 1000000 (1M tokens)
print(fugu_ultra.pricing) # {'input_per_1m': 5.0, 'output_per_1m': 30.0, ...}
# List all Sakana models
for cap in llmcapa.list_models(provider="sakana"):
print(cap.model_id, cap.context_window)Check if a model supports code infilling / Fill-in-the-Middle completion:
import llmcapa
cap = llmcapa.get("codegemma:2b", provider="ollama")
print(cap.supports("fim")) # True
print(cap.supports("vision")) # False
print("fim" in cap.features()) # True
cap2 = llmcapa.get("llama3.1", provider="ollama")
print(cap2.supports("fim")) # FalseThe fim feature is available as a Feature enum member:
from llmcapa import Feature
cap = llmcapa.get("starcoder2", provider="ollama")
print(cap.supports(Feature.LLMC_FEAT_FIM)) # True# List all models for a specific provider
for c in llmcapa.list_models(provider="anthropic"):
print(c.model_id, c.context_window)
# Search models by prefix (provider optional; aliases accepted)
search_results = llmcapa.search("codegemma", provider="ollama")
search_results = llmcapa.search("gpt-4o") # all providers
# OpenRouter route IDs are searched only in the OpenRouter catalog.
# Native catalogs retain a provider's own namespace (which may contain `/`).
openrouter_results = llmcapa.search("meta/muse-spark-1.3", provider="openrouter")
# This is not a generic alias for the Meta catalog:
# llmcapa.get("meta/muse-spark-1.3", provider="meta") # not found
# A slash is valid when it is part of the native ID itself, for example:
native_model = llmcapa.get("baichuan/baichuan-m2-32b", provider="novita")
big_reasoning_models = llmcapa.find(
supports_reasoning=True,
min_context_window=200000
)Novita AI is a cloud platform offering 200+ open-source and proprietary models via a single API. llmcapa bundles capability data for 157 Novita AI models, including DeepSeek, Qwen, Meta Llama, GLM, Gemini, and many more, with Novita-specific pricing.
Use the provider="novita" parameter to scope lookups to Novita AI models:
import llmcapa
# Look up Novita AI models using provider scope
cap = llmcapa.get("deepseek/deepseek-v3.2", provider="novita")
print(cap.context_window) # 163840
print(cap.pricing) # {'input_per_1m': 0.0269, 'output_per_1m': 0.04, 'currency': 'USD'}
cap = llmcapa.get("qwen/qwen3.7-max", provider="novita")
print(cap.context_window) # 1000000
# List all Novita AI models
for c in llmcapa.list_models(provider="novita"):
print(c.model_id, c.context_window, c.pricing)
# List all providers including Novita
print(llmcapa.providers())
# ['...', 'novita', '...']Regional location metadata can be listed and searched locally:
# Model-specific Vertex AI endpoint locations and global endpoint support
vertex = llmcapa.get("gemini-2.5-flash", provider="vertex-ai")
print(vertex.regions.locations)
print(vertex.regions.global_endpoint)
# Bedrock direct in-Region availability
models = llmcapa.find_by_region("us-east-1", provider="bedrock")
# Include source Regions from Bedrock geographic/global cross-Region profiles
regions = llmcapa.list_regions(
provider="bedrock",
model_id="nova-2-lite-v1",
include_inference_regions=True,
)Capability.regions is a RegionCapability. It distinguishes direct locations,
Google-style multi_regions, a global_endpoint, and Bedrock geographic/global
inference-profile source Regions. For example, find_by_region() excludes
cross-Region profile source Regions unless include_inference_regions=True;
profile destinations are never reported as direct availability. The metadata
includes source_url and checked_at for verification.
The bundled snapshot includes model-level Vertex AI location data for selected Gemini models and AWS Bedrock availability for selected models. Region entries use cloud region/location names only; service availability by country is not recorded. Coverage is intentionally explicit and not complete for every catalog record. All queries use local data and make no network requests. Availability changes over time; verify the linked official documentation before deployment or making data-residency decisions.
Official sources:
To update model data or fetch the latest pricing, you can optionally fetch and register models from the OpenRouter API on-demand using fetch_openrouter(). The response is cached locally in ~/.llmcapa/openrouter_cache.json and automatically loaded on subsequent imports (if the cache is less than 24 hours old), keeping the library fully offline during regular usage.
# Fetch and register OpenRouter models dynamically
count = llmcapa.fetch_openrouter()
print(f"Registered {count} models from OpenRouter!")
# Lookup using OpenRouter model ID
cap = llmcapa.get("meta-llama/llama-3.3-70b-instruct")
print(cap.context_window) # 131072
print(cap.pricing) # {'input_per_1m': 0.1, 'output_per_1m': 0.32, 'currency': 'USD'}Note: OpenRouter's Responses API (
POST /api/v1/responses) is an OpenAI-compatible gateway feature available for every OpenRouter route, so every model withprovider="openrouter"supportsresponses_api. It is stateless only:store: trueandprevious_response_idare rejected with a 400 error, and the full conversation history must be sent in each request. Theresponses_apiflag on native provider routes (for exampleprovider="openai") reflects that provider's own implementation and is tracked separately from the OpenRouter gateway capability.
You can fetch and register the full ranked model list across Hugging Face pipeline tasks with fetch_huggingface(). By default, it follows the API's pagination links until all pages are fetched, records known modalities, and stores a cache in ~/.llmcapa/huggingface_all_tasks_cache_all.json when cache_ttl is supplied. This may take time and is subject to Hugging Face API rate limits. Pass limit=N in Python to cap the total number of models.
# Fetch and register all ranked HuggingFace models dynamically
count = llmcapa.fetch_huggingface()
print(f"Registered {count} models from HuggingFace!")
# Lookup using HuggingFace model ID
cap = llmcapa.get("deepseek-ai/DeepSeek-V4-Flash")
print(cap.context_window) # 4096 (estimated; exact value not available via HF API)
print(cap.supports_vision) # False (text-generation pipeline)
# Optionally cap the number fetched
count = llmcapa.fetch_huggingface(limit=200)Note: The HuggingFace listing API does not provide context window, pricing, or detailed capability data. Context windows may come from model cards or configs; if unavailable, estimates/defaults can be used, so verify exact limits in official model cards. The bundled
huggingface.jsonis a static snapshot and may not yet include every model/task. The refresh script collects Hugging Face models across pipeline tasks, not only text generation; fields the API does not provide remain unknown unless curated from an official source. For exact specifications, consult official model cards.
Fetch the published, normalized catalog for one provider from the public awaku7/llmcapa repository. Provider aliases are accepted, and catalogs backed by multiple data files are fetched together. Downloads are cached under ~/.llmcapa/github_catalog_cache for explicit fetch calls, but cached GitHub snapshots and durable user catalogs are never loaded over the bundled catalogs at startup. Fetching is explicit only: get() and search() never access the network, so a model that is not in the bundled catalog is reported as not found until its provider catalog is fetched.
# Fetch the latest published OpenAI catalog and register its records
count = llmcapa.fetch_github_catalog("openai")
print(f"Registered {count} OpenAI models")
# Force a refresh, or select a branch/tag/commit
count = llmcapa.fetch_github_catalog("openai", cache_ttl=0, ref="main")CLI equivalent:
llmcapa update gh --provider openai
llmcapa update gh --provider modellix --refreshAn explicit fetch_github_catalog() call or CLI update replaces the corresponding bundled JSON files by default when the package directory is writable. Previous files are backed up under ~/.llmcapa/github_catalog_backups. With write_bundled=False, a read-only package, or an unsupported partial overlay, fetched records are registered only in the current process. llmcapa does not persist or load user catalog overrides. The response cache is used only by an explicit fetch and never overlays bundled data at startup. Verify catalog provenance and specifications before relying on them in production.
Count tokens for a single text or a list of chat messages using the best available tokenizer for a given model.
# Count tokens for a text string
import llmcapa
tokens = llmcapa.count_tokens("Hello, world!", "gpt-4o")
print(tokens) # exact count if tiktoken is installed, else estimation
# Count tokens for chat messages (includes overhead)
messages = [
{"role": "user", "content": "Hello"},
{"role": "assistant", "content": "Hi there!"},
]
total = llmcapa.count_messages_tokens(messages, "gpt-4o")
print(total)Register a Capability directly without a JSON file:
from llmcapa import Capability
cap = Capability(
provider="local",
model_id="my-model",
context_window=4096,
max_output_tokens=1024,
supports_function_calling=True,
aliases=["mm"],
)
llmcapa.register(cap)
print(llmcapa.get("my-model").context_window) # 4096Note:
llmcapa.get()raisesModelNotFoundErrorif the model is not found.
Load your own model definitions from a local JSON file:
llmcapa.load_extra("my_models.json")my_models.json format:
{
"models": [
{
"provider": "local",
"model_id": "my-custom-model",
"context_window": 32768,
"max_output_tokens": 4096,
"supports_function_calling": true,
"aliases": ["my-model-latest"]
}
]
}Image-generation and image-editing models expose optional provider-specific metadata through cap.image. The metadata is descriptive only; llmcapa does not call image APIs or generate images.
import llmcapa
meta = llmcapa.get("muse-image-1.0", provider="meta")
print(meta.image.output_formats) # ('webp', 'png', 'jpeg')
print(meta.image.response_formats) # ('b64_json', 'url')
print(meta.image.max_outputs) # 10
print(meta.image.reasoning_strength_values) # ('high', 'low')
xai = llmcapa.get("grok-imagine-image-2.0", provider="xai")
print(xai.image.quality_values) # ('low', 'medium', 'auto')
print(xai.image.supported_sizes) # ('1k', '2k')
gemini = llmcapa.get("gemini-3.1-flash-image", provider="google")
print(gemini.image.supported_sizes) # ('512', '1K', '2K', '4K')
print(gemini.image.supported_aspect_ratios) # documented aspect ratiosCommon image capability fields include:
generation,editing, andaccepts_image_inputoutput_formats,response_formats, andmax_outputsquality_valuesfor APIs with a genericqualityparameterreasoning_strength_valuesfor provider-specific controls such as Meta Muse Image'sreasoning_strengthsupported_sizesandsupported_aspect_ratiossupports_transparent_backgroundandbackground_valuessupports_streamingand endpoint metadata
These controls are intentionally kept separate. For example, Meta Muse Image documents reasoning_strength rather than quality, so its values are not placed in quality_values. Fields remain empty or unset when the provider documentation does not define the corresponding parameter.
llmcapa can describe whether a model supports Computer Use (CUA) without executing computer actions itself. The capability is optional, so existing model records and callers remain compatible.
import llmcapa
cap = llmcapa.get("gemini-3-flash-preview", provider="google")
computer = cap.computer_use
if computer and computer.supported:
print(computer.native)
print(computer.tool_type)
print(computer.tool_version)
print(computer.beta_header)
print(sorted(computer.actions))Convenience checks are also available:
llmcapa.supports_computer_use("gemini-3-flash-preview", provider="google")
llmcapa.supports_computer_action("gemini-3-flash-preview", "click", provider="google")
llmcapa.supports_computer_environment("gemini-3-flash-preview", "desktop", provider="google")native=True: the provider exposes a native Computer Tool/API. For example, Anthropic usescomputer_20251124orcomputer_20250124with the corresponding beta header.native=False: the model can be used with an external Computer Runtime or custom tool harness, but the provider does not expose a native Computer Tool through this route. This applies to examples such as Qwen visual agents, local models, and OpenRouter custom tool calling.
tool_version is the normalized Computer Tool version. tool_type is the provider/API value, and beta_header is the optional request header or body field. checked_at records when the support information was verified. Model version and Computer Tool version are tracked separately.
llmcapa only reports capability metadata. The application remains responsible for screenshots, mouse/keyboard execution, the agent loop, isolation, and human confirmation for high-impact actions.
# Direct Google Gemini API
google = llmcapa.get("gemini-3-flash-preview", provider="google")
assert google.computer_use.tool_type == "computer_use"
# Qwen visual agent with a custom harness
qwen = llmcapa.get("qwen3-vl-235b-a22b-instruct", provider="qwen")
assert qwen.computer_use.native is False
# OpenAI Responses API
openai = llmcapa.get("computer-use-preview", provider="openai")
assert openai.computer_use.tool_type == "computer_use_preview"OpenRouter and similar gateways are represented separately from direct provider routes. Generic tool calling can be combined with a custom harness, but it should not automatically be treated as the provider's native Computer Tool.
When checking model replacement, request Computer Use explicitly. The replacement check requires matching provider and API, tool/schema type, and—when either side is beta—the same beta header. It also checks that the replacement supports the requested environments and actions. Tool versions are descriptive metadata, not a compatibility gate. required_actions is currently applicable to Computer Use only. supports("computer_use") alone is not treated as cross-provider compatibility; two providers may use the same generic tool label with different request protocols.
source.can_be_replaced_by(
target,
required_features=["vision"],
required_actions=["screenshot", "left_click", "type"],
required_environment="desktop",
)For details on how to extend the library, add new providers, or implement new feature flags, please refer to the DEVELOP.md guide.
# Show capabilities of a specific model
llmcapa show gpt-4o
llmcapa show gpt-4o --json
# List all known models
llmcapa list
llmcapa list --provider google
llmcapa list --json --no-deprecated
llmcapa list --provider anthropic --wide
# Search models by prefix
llmcapa search claude --limit 10
llmcapa search gpt --provider azure --format json
# Choose columns, sort order, and output format
llmcapa search claude --columns provider,model_id,ctx,out,flags,price
llmcapa search claude --sort=-ctx --limit 5
llmcapa search claude --format csv # or md / json
# Find models by feature flags and size limits (decision models, embeddings, ...)
llmcapa find decision=true
llmcapa find embedding=true --provider amazon
llmcapa find vision=false --min-context 64000
# Filter by region availability (list / search / find)
llmcapa regions
llmcapa regions --provider azure-foundry
llmcapa list --provider azure-foundry --region japaneast
llmcapa find vision --region ap-northeast-1 --columns provider,model_id,regions
# Search by substring instead of prefix
llmcapa search sonnet --contains
# List all known providers
llmcapa providers
llmcapa providers --counts
# Count tokens for text or messages
llmcapa tokens gpt-4o "Hello, world!"
llmcapa tokens gpt-4o --messages '[{"role":"user","content":"Hi"}]'
# Load extra model data from a local JSON file on startup
llmcapa --extra my_models.json show gpt-4o
# Explicitly fetch and update the OpenRouter cache only
llmcapa update openrouter
# Development: refresh the OpenAI catalog from official documentation
python scripts/_update_all_providers.py --provider openai
# Refresh additional official provider catalogs
python scripts/_update_all_providers.py --provider deepinfra
python scripts/_update_all_providers.py --provider nebius
# Baseten refresh requires BASETEN_API_KEY; otherwise the bundled snapshot is retained.
python scripts/_update_all_providers.py --provider baseten
# Fetch and register popular models from HuggingFace
llmcapa update hf
# Fetch a published provider catalog from the llmcapa GitHub repository
llmcapa update gh --provider openai
llmcapa update gh --provider modellix --refresh- Static Snapshot: Bundled capability data is a static snapshot. See docs/catalog_data_sources.md for details on each provider's data source and known SSR limitations (Azure AI Catalog). While we strive to keep it updated with the latest models (including GPT-5.5, Claude Fable, Gemini 3.5, DeepSeek V4, Sakana Fugu, etc.), providers change limits and pricing frequently. Use
fetch_openrouter()or verify with official documentation when absolute accuracy is critical. - HuggingFace Data Accuracy:
huggingface.jsonis a static snapshot. The catalog refresh script collects models across Hugging Face pipeline tasks; task-derived modalities are recorded where known, while missing model-specific capabilities remain unknown. Check official model cards for exact specifications.
Apache License 2.0