AI Routing Library
3.5k 2026-05-17
aurelio-labs/semantic-router
A superfast decision-making layer for LLMs and AI agents that routes requests based on semantic meaning, bypassing slow LLM generations.
Core Features
Superfast AI decision making for LLMs.
Semantic routing using vector space for efficient request handling.
Support for various embedding encoders (Cohere, OpenAI, Hugging Face, FastEmbed).
Ability to define custom routes with example utterances.
Option for fully local execution.
Quick Start
pip install -qU semantic-routerDetailed Introduction
Semantic Router is an innovative library designed to accelerate decision-making within Large Language Models (LLMs) and AI agents. Instead of relying on time-consuming LLM generations for routing or tool-use decisions, it leverages the power of semantic vector space. By understanding the semantic meaning of user queries, Semantic Router can quickly and accurately direct requests to the appropriate paths or functions, significantly enhancing the efficiency and responsiveness of AI applications. It offers flexible integration with popular embedding models and supports custom route definitions.