Philosophy
Managing LLM provider configurations across multiple projects and languages is a pain. LLM Providers solves this by maintaining a single, curated JSON source of truth for:
- Model IDs & Names
- Context Windows & Max Output Tokens
- Pricing (Input/Output)
- Capabilities (Tool Support, Vision, etc.)
This data is embedded at compile-time into a Rust crate for zero-latency access and exposed to Python via high-performance bindings.
Features
- 🚀 Zero-Latency: Data is compiled into the binary; no runtime I/O or API calls.
- 🦀 Rust Native: Type-safe structs (
Provider,Model) for robust development. - 🐍 Python Ready: Seamless integration via
pip install llm-providers-list. - 🔄 Unified Schema: Consistent data structure across all providers (OpenAI, Anthropic, DeepSeek, etc.).
- 📦 Rich Metadata: Includes pricing, context length, and tool support flags.
Installation
Rust
Add this to your Cargo.toml:
[]
= "0.6"
Python
Install via pip (once published) or build from source:
# From PyPI (Coming Soon)
# Build from source (requires maturin)
Usage
Rust
use ;
Python
# 1. List all provider families
# Output: ['aliyun', 'anthropic', 'deepseek', 'openai', ...]
# 2. List all endpoint IDs (for direct configuration)
# Output: ['aliyun:cn', 'anthropic:global', 'moonshot:cn', 'moonshot:global', ...]
# 3. Get endpoint details by ID
, =
# 4. Get specific model details
=
Advanced Usage
Filtering Models
You can filter models by region, capabilities (tools), or context length.
Rust
use ;
let cn_models = filter_models;
for in cn_models
Python
# Find all models in CN region that support tools
=
Data Structure
The registry is embedded in the crate as Rust static data (PHF maps, no runtime JSON parsing).
- Provider Family: Top-level grouping (e.g.,
openai,moonshot). Models are defined once per family. - Endpoint: Regional API entry point under a family. Each endpoint has its own
base_url,region, andprice_currency. - Region:
cn(China),global(International),us,eu, etc. - Price Currency:
USDorCNY, defined at the endpoint level.
Endpoint ID Format (v0.6+)
Endpoint IDs are now composite to avoid ambiguity across providers:
"{provider_id}:{endpoint_key}"(recommended)- Example:
moonshot:global,zhipu:cn
See docs/providers.md for a full list of endpoint IDs.
Supported Providers
- OpenAI (GPT-4o, GPT-3.5, o1)
- Anthropic (Claude 3.5 Sonnet, Haiku, Opus)
- DeepSeek (Chat, Reasoner)
- Aliyun (Qwen Max, Plus, Turbo)
- Tencent (Hunyuan)
- Moonshot (Kimi)
- Moonshot AI (CN)
- Moonshot AI (Global)
- MiniMax
- MiniMax (CN)
- MiniMax (Global)
- Zhipu (GLM-4)
- Zhipu AI (CN)
- Zhipu AI (Global)
- Volcengine (Doubao)
- LongCat
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for detailed guidelines on:
- Commit message standards (English required)
- Provider update procedures
- Testing and code style requirements
- Pull request process
Quick start:
- Edit
data/providers.json - Run
cargo testto validate - Submit a Pull Request
License
MIT