Fast, offline-first LLM pricing lookup with auto-sync from LiteLLM data. Get token costs, context windows, and capabilities for 2500+ models.
Project description
LLMPrice
A Python Library for LLM Pricing Lookup
Fast, offline-first LLM pricing lookup for 2500+ models across all major providers. Returns both Python objects and JSON.
Data synced daily from LiteLLM via GitHub Actions. Published weekly to PyPI with date-based versioning.
Also available as a TypeScript/npm package.
Install
pip install llmprice-kit
Quick Start
from llmprice import LLMPrice
lp = LLMPrice()
# Get pricing as Python object
model = lp.get("gpt-4o")
print(model.input_cost_per_1m) # 2.5
print(model.output_cost_per_1m) # 10.0
print(model.max_input_tokens) # 128000
print(model.supports_vision) # True
# Get as JSON dict
data = lp.get_json("gpt-4o")
# {"name": "gpt-4o", "provider": "openai", "input_cost_per_1m": 2.5, ...}
# Compare models
models = lp.compare(["gpt-4o", "claude-opus-4-20250514", "gemini/gemini-2.0-flash"])
for m in models:
print(f"{m.name}: ${m.input_cost_per_1m}/1M in, ${m.output_cost_per_1m}/1M out")
# Search by capabilities
cheap_vision = lp.search(supports_vision=True, max_input_price=1.0)
reasoning = lp.search(supports_reasoning=True, provider="anthropic")
# List providers
lp.providers() # ['anthropic', 'openai', 'gemini', ...]
# Auto-update mode (fetches fresh data if >1 day old)
lp = LLMPrice(auto_update=True)
CLI
llmprice get gpt-4o
llmprice compare gpt-4o claude-opus-4-20250514
llmprice search --provider openai --vision
llmprice search --reasoning --max-input-price 5.0
llmprice providers
llmprice update
llmprice info
How It Works
- Bundled data — Ships with a pricing snapshot, works offline with zero latency
- Auto-sync — GitHub repo updated daily from LiteLLM upstream
- Weekly PyPI releases — Published every Monday with date-based version
- Auto-update mode —
LLMPrice(auto_update=True)fetches fresh data when local copy is >1 day old - Dual output — Every query returns Python dataclass objects or JSON dicts
Examples
See examples/python/ for the full interactive notebook.
Data Source
Pricing data from LiteLLM — 2500+ models from 100+ providers including OpenAI, Anthropic, Google, AWS Bedrock, Azure, DeepSeek, Mistral, and more.
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
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 llmprice_kit-2026.4.3.tar.gz.
File metadata
- Download URL: llmprice_kit-2026.4.3.tar.gz
- Upload date:
- Size: 74.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ccdfa347de5d0b76ee48fe9901927edb25a4bd5914e8fe94ab7fa8bccad923d
|
|
| MD5 |
93663f42e4da4cd2f82df9f4fe1f84da
|
|
| BLAKE2b-256 |
0e583e08c2db4a1e23e395a7336ff27c264b064615185dbd7dff5c567d2fc95e
|
File details
Details for the file llmprice_kit-2026.4.3-py3-none-any.whl.
File metadata
- Download URL: llmprice_kit-2026.4.3-py3-none-any.whl
- Upload date:
- Size: 76.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2371946d7ee0011c9166f95e2095adafbdcd746d40352dbe5b466aaf2029b8a9
|
|
| MD5 |
ebb7449b7546c010ccb8c8064d4c7989
|
|
| BLAKE2b-256 |
d3a06f5408b3a3195439bf0a453d49cd0170f332619938378cce3cc6de901337
|