Semantic Router

Semantic Router

โ˜… 3.8 ๐Ÿ”– 1200 saves ๐Ÿ’ฐ Free GitHub

Semantic Router is an open-source library from Aurelio Labs for making superfast, meaning-based routing decisions in LLM applications. Hosted on GitHub with about 4,000 stars, it replaces slow LLM calls for routing with vector-space comparisons that answer in milliseconds.

Overview

Many AI applications need to decide what to do with a user input: answer directly, call a tool, refuse, switch models or escalate. Doing that with an LLM call is slow and expensive. Semantic Router instead embeds example utterances for each route and sends incoming text to the route whose examples it is semantically closest to. The library supports dynamic routes that generate responses, static routes that trigger actions, guardrails for jailbreak and PII detection, and a growing set of encoders from providers like OpenAI, Cohere and Hugging Face, plus local models. It also handles multimodal inputs such as images. The project is actively maintained with frequent releases through 2026.

Key Features

  • Millisecond route decisions based on semantic similarity
  • Dynamic and static routes for generation and tool triggering
  • Built-in guard layers for jailbreaks, PII and unsafe content
  • Pluggable encoders from major providers or local models
  • Multimodal routing for text and image inputs
  • Route testing and threshold tuning utilities

๐Ÿ’ณ Pricing

Semantic Router is free and open source under the MIT license. There is no paid tier of the library itself; costs are limited to any third-party embedding APIs you choose to use, and local encoders avoid even those.

Who Is It For

Semantic Router is for developers building chatbots, agents and RAG systems who need fast, cheap and controllable routing, guardrails and intent handling without spending an LLM call on every decision.

๐Ÿš€ Visit Semantic Router Official Site

๐Ÿšฉ Report an issue