model-router

Community

Route queries to the right model and save costs.

Authorsamelhousseini
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Building cost-efficient chat applications requires routing user queries to the most suitable underlying Azure OpenAI model, reducing spend while maintaining answer quality.

Core Features & Use Cases

  • Auto-routing: Directs prompts to the optimal model tier based on complexity.
  • Cost tracking: Logs token usage and per-request costs for transparency.
  • Model visibility: Returns the underlying model used for each request and supports multiple routing modes (balanced, cost, quality).
  • Use Case: Integrate with a customer support chatbot to route simple FAQs to nano/mini models and complex queries to higher-tier deployments, achieving significant savings.

Quick Start

Install dependencies from requirements.txt, configure Azure credentials, and instantiate the Model Router client. Then call simple_query with example prompts to observe routing decisions and cost reporting.

Dependency Matrix

Required Modules

openai

Components

scripts

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: model-router
Download link: https://github.com/samelhousseini/microhacks/archive/main.zip#model-router

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.