Guide to Prompt Routing in OpenSmartRoute
Prompt routing is a key feature that directs user requests to the most suitable skills, prompts, or models within the OpenSmartRoute platform. It leverages various strategies, including generative LLMs, to determine the best target for each prompt, enhancing the accuracy and relevance of AI responses.
What is Prompt Routing?
Prompt routing involves selecting the appropriate skill, prompt, or model based on the input query. It ensures that user requests are handled by the most relevant component, whether it is a marketplace prompt, a custom skill, or an LLM-based judge.
How Prompt Routing Works in OpenSmartRoute
OpenSmartRoute supports multiple routing strategies, including generative routing with an LLM acting as a judge. The platform can consult a generative judge only when the ensemble is unsure, based on a confidence score.
Example: Using an LLM as a Judge
from opensmartroute import LLMJudgeStrategy
router = Router(registry, llm_judge=LLMJudgeStrategy(llm=lambda prompt: my_llm(prompt)), escalate_llm_judge_below=0.6)
This configuration allows the router to consult an LLM judge when confidence drops below 0.6.



