frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Styx, Open-source AI gateway with intelligent auto-routing (MCP-native)

https://github.com/timmx7/styx
1•timmx7•2h ago
Hey HN, We just open-sourced Styx — an AI gateway that sits between your app and AI providers (OpenAI, Anthropic, Google, Mistral). One endpoint, any model, self-hosted. What makes it different from LiteLLM or OpenRouter:

styx:auto — send "model": "styx:auto" and the gateway picks the right model based on prompt complexity. Simple questions go to cheap models ($0.15/1M tokens), complex code goes to frontier models. 9-signal classifier, zero config. MCP-native — first gateway with a built-in MCP server. Connect Claude Code or Cursor in one command: claude mcp add styx -- npx styx-mcp 65+ models with live pricing — prices auto-refresh every 24h from OpenRouter's public API. Self-hosted in 5 min — git clone, run setup.sh (interactive wizard), docker compose up.

Tech stack: Go (router/proxy, <10ms overhead), Python FastAPI (auth, billing), Next.js (dashboard). Apache 2.0. The auto-routing is the killer feature. Instead of hardcoding gpt-4o everywhere, your app sends styx:auto and the gateway classifies each request on 9 signals (prompt length, code presence, reasoning patterns, math, conversation depth, etc.) then routes to the optimal model. You also get styx:fast (always cheapest), styx:balanced, and styx:frontier (always best). Try it: https://github.com/timmx7/styx Would love feedback on the architecture and the auto-routing approach. Happy to answer questions.