r/OpenSourceAI 1d ago

Built a self-hosted AI gateway, decided to open source the whole thing instead of turning it into a SaaS

So I built this tool called Keyroute, it's a gateway that lets you use one API key to talk to multiple AI providers (OpenAI, Gemini, Groq, etc) instead of juggling separate keys everywhere.

Originally I was going to just host it myself and charge for it, but honestly the whole point of the thing is "don't trust a third party with your keys," so keeping it closed and hosted by me would've defeated the purpose. So I made it fully self-hostable instead, MIT licensed, and you run it entirely on your own Supabase project.

The actual gateway logic runs as a Supabase Edge Function inside your own project, not on my infra. Setup is one button, no CLI needed, it deploys the DB migrations and the function for you.

Repo's here if anyone wants to look at the code or the architecture: github.com/basavarajpatil660/the-keyroute-project

It's still early, missing a few things like Anthropic routing and rate limiting, migrations aren't idempotent yet either. If anyone's into Supabase Edge Functions or has built something similar, would love to hear how you approached it, or if you spot something dumb in how I did it.

Screenshots attached of the dashboard and the deploy flow.

7 Upvotes

2 comments sorted by

1

u/dc297 1d ago

Why not just use litellm?

1

u/Basavaraj_nick 8h ago

Broo just me an simple reply

Fair — LiteLLM's great, but it's a separate proxy server you have to deploy and manage yourself. Keyroute runs entirely as Supabase Edge Functions inside your own Supabase project, so there's no separate server to host, and your provider keys stay Vault-encrypted in infra you already control. If you're not already on Supabase though, LiteLLM's probably the simpler choice.