Skip to main content

Professional, unified, and enhanced index for LLM models based on OpenRouter with ArtificialAnalysis intelligence.

Project description

🚀 OpenRouter Insights

PyPI version Python versions License: MIT Tests

OpenRouter Insights is a professional, unified LLM registry that supercharges the official OpenRouter catalog with high-fidelity intelligence from ArtificialAnalysis.

It provides a "Single Source of Truth" for model capabilities, pricing, and performance, designed for production-grade AI agents and high-performance applications.


🔥 OpenRouter with "Superpowers"

Why use this instead of the raw OpenRouter API?

Feature Raw OpenRouter API OpenRouter Insights
Model Catalog ✅ Yes ✅ Yes (Auto-synced)
Pricing ✅ Yes ✅ Yes (Normalized)
Intelligence Scores ❌ No ✅ Yes (ArtificialAnalysis)
Performance Tiers ❌ No ✅ Yes (Frontier/Pro/Lite)
Smart Discovery ❌ No ✅ Yes (get_smartest, get_cheapest)
Fuzzy Search ❌ Limited ✅ Yes (RapidFuzz integrated)
Sync/Async Facades ❌ No ✅ Yes (Plug & Play)

🛠️ Installation

# Basic installation (Library only)
pip install openrouter-insights

# With API support (FastAPI + Uvicorn)
pip install "openrouter-insights[api]"

💡 Quick Start

⚡ Async Facade (For FastAPI / High Performance)

Ideal for modern asynchronous applications.

import asyncio
from openrouter_insights import LLMIndex

async def main():
    # Uses local JSON registry (no DB setup required)
    client = LLMIndex(mode="json")
    
    # Smart Discovery: Get the smartest model for coding
    models = await client.get_best_for_coding(limit=1)
    if models:
        print(f"Best model: {models[0].name} (Tier: {models[0].performance_tier})")
        
    # Full Fuzzy Search
    results = await client.search("gpt4-o reasoning")
    for r in results:
        print(f"Matched: {r.id}")

asyncio.run(main())

🕒 Sync Facade (For Scripts / Notebooks)

No async/await boilerplate. Pure simplicity.

from openrouter_insights import LLMIndexSync

client = LLMIndexSync(mode="json")

# Get the absolute cheapest frontier model
cheap_pro = client.get_cheapest(tier="frontier", limit=3)
for m in cheap_pro:
    print(f"{m.name}: ${m.pricing.input}/1M tokens")

🕒 Data Freshness & Automation (Git-Ops)

OpenRouter Insights is not a static file. We run an automated 24-hour synchronization job via GitHub Actions (CRON) that:

  1. Fetches the latest models and pricing from OpenRouter.
  2. Unifies benchmark data from ArtificialAnalysis.
  3. Processes the results via our Matching Engine.
  4. Commits the fresh openrouter_insights.sqlite and .json back to the repository.

This ensures you always have access to the latest frontier models as they are released.


🧠 Smart Query Methods

OpenRouter Insights comes with pre-built logic to discover models based on real-world capabilities:

  • .get_smartest(): Highest intelligence scores first.
  • .get_cheapest(): Lowest cost-to-output first.
  • .get_best_for_coding(): Top-tier coding performers.
  • .get_top_frontier(): Only the best models in the world.
  • .get_fastest(): Highest Tokens Per Second (TPS).

✅ Verified Reliability

We take production stability seriously. Every release is validated against a comprehensive test suite:

  • Unit Tests: Logic for classification, tiers, and matching engine.
  • Integration Tests: Mocked gateway verification for OpenRouter and ArtificialAnalysis.
  • Persistence Tests: Integrity checks for both SQLite and JSON engines.
  • Facade Tests: Sync/Async interface consistency.

Current Status: 19 tests passed (100% success rate).


📖 Documentation

Detailed architectural and domain documentation can be found in the docs/ folder:


Developed with ❤️ for the AI Engineering community.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openrouter_insights-0.4.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openrouter_insights-0.4.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file openrouter_insights-0.4.0.tar.gz.

File metadata

  • Download URL: openrouter_insights-0.4.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.12.3 Linux/6.17.0-1008-azure

File hashes

Hashes for openrouter_insights-0.4.0.tar.gz
Algorithm Hash digest
SHA256 9e904acf22c9e010213468899254c205a7dda6b61ee093b4a9951edc8c949aec
MD5 836635f2150327cab12946b63aa79393
BLAKE2b-256 152471f71715e5d37a5b254b59cd2a7a867255c1fd358654d3ea682bb5907311

See more details on using hashes here.

File details

Details for the file openrouter_insights-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: openrouter_insights-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.12.3 Linux/6.17.0-1008-azure

File hashes

Hashes for openrouter_insights-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb742aa4439b71f45db696f7017c7da3b85d271850f09dd42f0b6a07456ec1c8
MD5 7912deffed98f05eed73075a05efe4f1
BLAKE2b-256 cbfe84d67898a8b2e39506750c91219f81d7d0487b561539bfe19125304c4049

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page