Semantic-Path
About the project
Most production AI applications default to sending 100% of user queries directly to expensive, cloud-hosted frontier models (e.g., GPT-4, Llama 70B). Over 60% of user queries are simple factual lookups, chit-chat, or unit conversions. Routing these trivial requests to heavy cloud models introduces unnecessary network latency and burns operational budgets.
What We Built: Semantic-Path Gateway
Semantic-Path is an intelligent, high-performance reverse proxy and AI traffic gateway built with FastAPI that adheres strictly to the official OpenAI API schema (/v1/chat/completions).
Instead of slow, expensive LLM-as-a-judge prompts or brittle keyword heuristics, Semantic Router performs real-time semantic intent classification in under 25ms using a local, lightweight vector embedding model (all-MiniLM-L6-v2):
- Fast Lane (FAST_LANE): Lightweight queries (basic arithmetic, conversational greetings, unit conversions) are automatically routed to a local Gemma 2 (2B) instance via Ollama running on-device at $0.00 token cost.
- Deep Lane (DEEP_LANE): Complex system architecture, concurrency, and algorithmic reasoning queries are forwarded upstream to cloud-hosted Llama 3.3 (70B) on Groq Cloud.
- Telemetry Engine: Calculates classification latency, tracks routing lane distributions, and tallies cumulative dollar savings against commercial frontier pricing in real time.
- Zero-Refactor Integration: Any existing client (LangChain, LlamaIndex, OpenAI SDK) integrates instantly by switching base_url to http://localhost:8000/v1.
Built with
AI tools
Prize Categories Entered
- Submitted

Best Open-Source AI Project