7 ms·
Show HN: GoModel – an open-source AI gateway in Go
Hi, I’m Jakub, a solo founder based in Warsaw.
I’ve been building GoModel since December with a couple of contributors. It's an open-source AI gateway that sits between your app and model providers like OpenAI, Anthropic or others.
I built it for my startup to solve a few problems:
- track AI usage and cost per client or team
- switch models without changing app code
- debug request flows more easily
- reduce AI spendings with exact and semantic caching
How is it different?
- ~17MB docker image
- LiteLLM's image is more than 44x bigger ("docker.litellm.ai/berriai/litellm:latest" ~ 746 MB on amd64)
- request workflow is visible and easy to inspect
- config is environment-variable-first by default
I'm posting now partly because of the recent LiteLLM supply-chain attack. Their team handled it impressively well, but some people are looking at alternatives anyway, and GoModel is one.
Website: https://gomodel.enterpilot.io https://gomodel.enterpilot.io
Any feedback is appreciated.
- anilgulecha 6mo agohow does this compare to bifrost - another golang router?
- santiago-pl 6mo agoFirst of all, GoModel doesn't have a separate private repository behind a paywall/license. It's more lightweight and simpler. The Bifrost docker image looks 4x larger, at least for now. IMO GoModel is more convenient for debugging and for seeing how your request flows through different layers of AI Gateways in the Audit Logs.
- anilgulecha 6mo agoThat would be valuable if there's a commitment to never have a non-opensource offering under GoModel? If so, you can document it in the repo.
- santiago-pl 6mo agoI would love to keep it open source forever, but I can't promise that for now. I've written a whole doc page about it if you're curious: https://gomodel.enterpilot.io/docs/about/license https://gomodel.enterpilot.io/docs/about/license
- antonvs 6mo agoIf your concern is someone selling GoModel as a service, you could add a license provision for that. Technically it'd no longer be open source, I think, but most people won't care.
- santiago-pl 6mo agoI'll consider it for sure.
- Talderigi 6mo agoCurious how the semantic caching layer works.. are you embedding requests on the gateway side and doing a vector similarity lookup before proxying? And if so, how do you handle cache invalidation when the underlying model changes or gets updated?
- giorgi_pro 6mo agoHey, contributor here. That's right, GoModel embeds requests and does vector similarity lookup before proxying. Regarding the cache invalidation, there is no "purging" involved – the model is part of the namespace (params_hash includes the LLM model, path, guardrails hash, etc). TTL takes care of the cleanup later.
- pjmlp 6mo agoExpectable, given that LiteLLM seems to be implemented in Python. However kudos for the project, we need more alternatives in compiled languages.
- santiago-pl 6mo agoAgree and thank you! Please let us know if you'd like to give it a try and if you miss any feature in GoModel.
- goodkiwi 6mo agoIt’s also badly implemented - everything is a global import. Had to stop using it
- smcleod 6mo agoLiteLLM proxy has to be about the worst codebase and performing Python code I've used in a long time. Incredibly poor performance, riddled with serious bugs and to be honest devs that don't seem to understand them.
- santiago-pl 6mo agoTBH I decided to write GoModel because I needed something like this for my startup, enterpilot, and LiteLLM didn’t meet my needs.
- tahosin 6mo agoThis is really useful. I've been building an AI platform (HOCKS AI) where I route different tasks to different providers — free OpenRouter models for chat/code gen, Gemini for vision tasks. The biggest pain point has been exactly what you describe: switching models without changing app code. One thing I'd love to see is built-in cost tracking per model/route. When you're mixing free and paid models, knowing exactly where your spend goes is critical. Do you have plans for that in the dashboard?
- santiago-pl 6mo agoThis comment looks like AI-generated. However IIUC what you're asking for - it's already in the dashboard! Check the Usage page.
- indigodaddy 6mo agoAny plans for AI provider subscription compatibility? Eg ChatGPT, GH Copilot etc ? (Ala opencode)
- santiago-pl 6mo agoYou are not the first person who has asked about it. It looks like a useful feature to have. Therefore, I'll dig into this topic more broadly over the next few days and let you know here whether, and possibly when, we plan to add it.
- rvz 6mo agoI don't see any significant advantage over mature routers like Bifrost. Are there even any benchmarks?
- lackoftactics 6mo agoIt’s a heavily vibe coded project with only proxy with terrible benchmarks design. Basically vibe coded benchmarks that lie through ignorance of mocked super fast endpoint without using full power of litellm in multiple processes. Other than that almost useless it’s faster when this will be io bound and not cpu bound.
- eikenberry 6mo agoWhich project are you talking about, GoModel or Bifrost?
- lackoftactics 6mo agoGoModel. I see some red flags in the docs/benchmarks, but I could be wrong in my judgement here. What I noticed: the website shows a diagram of the litellm SDK communicating with the gateway proxy of GoModel, poor design of benchmarks, the scope of the project in readme vs. depth. I don't have professional experience in GoLang, so will not comment on quality of code. There are some genuinely good things about this project and the effort here, but with solid position of Bifrost sitting at a version above 1.0.0 and so many other initiatives in this space, it's a tough market.
- santiago-pl 6mo agoThe LiteLLM SDK is intentionally on the website. You can "talk" to GoModel with it because both projects use an OpenAI-compatible API under the hood. You can use it like this: from litellm import completion print(completion( model="openai/gpt-4.1-nano", api_base="http://localhost:8080/v1", api_key="your-gomodel-key", messages=[{"role": "user", "content": "hi"}], ).choices[0].message.content)
- driese 6mo agoNice one! Let's say I'm serving local models via vllm (because ollama comes with huge performance hits), how would I implement that in gomodel?
- devmor 6mo agoThis is way more interesting to me as well. I have projects that use small limited-purpose language models that run on local network servers and something like this project would be a lot simpler than manually configuring API clients for each model in each project.
- santiago-pl 6mo agoThanks for raising it! Since vLLM has an OpenAI-compatible API, this should work for now: docker run --rm -p 8080:8080 \ -e OPENAI_API_KEY="some-vllm-key-if-needed" \ -e OPENAI_BASE_URL="http://host.docker.internal:11434/v1" \ ... enterpilot/gomodel I'll add a more convenient way to configure it in the coming days.
- santiago-pl 6mo agoI've released a new version of GoModel (0.1.20) with explicit support for vllm. You can now use it even with a few vLLM instances. Like this: docker run --rm -p 8080:8080 \ -e VLLM_BASE_URL=http://host.docker.internal:18000/v1 \ -e VLLM_BASEMENT_BASE_URL=http://host.docker.internal:18000/v1 \ enterpilot/gomodel:latest
- mosselman 6mo agoDoes this have a unified API? In playing around with some of these, including unified libraries to work with various providers, I've found you are, at some point, still forced to do provider-specific works for things such as setting temperatures, setting reasoning effort, setting tool choice modes, etc. What I'd like is for a proxy or library to provide a truly unified API where it will really let me integrate once and then never have to bother with provider quirks myself. Also, are you also planning on doing an open-source rug pull like so many projects out there, including litellm?
- santiago-pl 6mo ago1. Yes, we have OpenAI-compatible API and we develop GoModel with Postel’s law in mind: https://gomodel.enterpilot.io/docs/about/technical-philosophy https://gomodel.enterpilot.io/docs/about/technical-philosoph... . 2. Regarding being open-source and the license, I've described our approach here transparently: https://gomodel.enterpilot.io/docs/about/license https://gomodel.enterpilot.io/docs/about/license
- pukaworks 6mo ago[dead]
- sowbug 6mo agoAre these kinds of libraries a temporary phenomenon? It strikes me as weird that providers haven't settled on a single API by now. Of course they aren't interested in making it easier for customers to switch away from them, but if a proprietary API was a critical part of your business plan, you probably weren't going to make it anyway. (I'm asking only about the compatibility layer; the other tracking features would be useful even if there were only one cloud LLM API.)
- harikb 6mo agoThe providers themselves can't keep this straight even within their own ecosystem. Plus everyone is running at a million miles/hour. For example `Claude code` used to set 2 specific beta headers with some version numbers for their Max subscription to be supported. Oauth tokens for Max plan is different from how their API keys looked. They kind of look similar, but has specific prefix that these tool pre-validate. It is barely working at this point even within a single provider
- simonw 6mo agoI've been maintaining an abstraction layer over multiple providers for a couple of years now - https://llm.datasette.io/ https://llm.datasette.io/ The best effort we have to defining a standard is OpenAI harmony/responses - https://developers.openai.com/cookbook/articles/openai-harmony https://developers.openai.com/cookbook/articles/openai-harmo... - but it's not seen much pickup. The older OpenAI Chat Completions thing is much more of an ad-hoc standard - almost every provider ends up serving up a clone of that, albeit with frustrating differences because there's no formal spec to work against. The key problem is that providers are still inventing new stuff, so committing to a standard doesn't work for them because it may not cover the next set of features. 2025 was particularly turbulent because everyone was adding reasoning mechanisms to their APIs in subtly different shapes. Tool calls and response schemas (which are confusingly not always the same thing) have also had a lot of variance - some providers allow for multiple tool calls in the same response, for example. My hunch is we'll need abstraction layers for quite a while longer, because the shape of these APIs is still too frothy to support a standard that everyone can get behind without restricting their options for future products too much.
- crawdog 6mo agoI wrote a similar golang gateway, with the understanding that having solid API gateway features is important. https://sbproxy.dev https://sbproxy.dev - engine is fully open source. Another reason golang is interesting for the gateway is having clear control of the supply chain at compile time. Tools like LiteLLM the supply chain attacks can have more impact at runtime, where the compiled binary helps.
- lackoftactics 6mo agoMaybe worth showing on SHOW HN
- crawdog 6mo agoThanks I am finishing up some performance comparison work looking at rust vs golang and plan a deeper write up for that group. I hope to publish soon.
- pizzafeelsright 6mo agoI have written and maintained AI proxies. They are not terribly complex except the inconsistent structure of input and output that changes on each model and provider release. I figure that if there is a not a < 24 hour turn around for new model integration the project is not properly maintained. Governance is the biggest concern at this point - with proper logging, and integration to 3rd party services that provide inspection and DLP type threat mitigation.
- ijk 6mo agoGiven the LiteLLM Supply Chain Incident, threat mitigation and governance are definitely major concerns.
- santiago-pl 6mo ago[dead]
- nzoschke 6mo agoLooks nice, thanks for open sourcing and sharing. I'm all in on Go and integrating AI up and down our systems for https://housecat.com/ https://housecat.com/ and am currently familiar and happy with: https://github.com/boldsoftware/shelley https://github.com/boldsoftware/shelley -- full Go-based coding agent with LLM gateway. https://github.com/maragudk/gai https://github.com/maragudk/gai -- provides Go interfaces around Anthropic / OpenAI / Google. Adding this to the list as well as bifrost to look into. Any other Go-based AI / LLM tools folks are happy with? I'll second the request to add support for harnesses with subscriptions, specifically Claude Code, into the mix.
- santiago-pl 6mo agoI'll take a closer look at it over the next few days. However, it might be challenging, considering that Claude Code with a subscription no longer officially works with OpenClaw.
- arcanemachiner 6mo agoThat... might have changed? https://news.ycombinator.com/item?id=47844269 https://news.ycombinator.com/item?id=47844269
- nzoschke 6mo agoYeah I share the same uncertainty here. My understanding is personal and interactive use should be fine. I use Conductor all day every day and it wraps a subscription. Perhaps fully automated use is where the line is drawn. But I also suspect individuals using it for light automated dispatching would be ok too.
- lackoftactics 6mo agoIt suppose to work again based on todays news
- santiago-pl 6mo agoThat's great news! The AI model ecosystem is changing so fast.
- glerk 6mo agoThis is awesome work, thanks for sharing! How do you plan on keeping up with upstream changes from the API providers? I have implemented something similar, and the biggest issue I have faced with go is that providers don’t usually have sdk’s (compared to javascript and python), and there is work involved in staying up to date at each release.
- lackoftactics 6mo agoAlmost impossible without backing from some VC like litellm
- swyx 6mo agoridiculous statement. most people dont need long tail.
- lackoftactics 6mo agoI might be wrong, but if you go after 200 integrations keeping them on is substantial work for solo founder
- swyx 6mo agoreal people just need like 20 at most.
- lackoftactics 6mo agoif that's the case and doesn't need crazy number of integrations, I agree with you 100%
- santiago-pl 6mo agoYes, the number of meaningful providers might be around 20-30.
- 6mo ago
- rpdaiml 6mo ago[dead]
- immanuwell 6mo agoit's nice that it supports different providers
- phoenixranger 6mo agolooks interesting, will defo give it a try. thanks for open-sourcing it!
- hgo 6mo agoHey, this looks super nice. I do like the 'compact' feel of this. Reminds me of Traefik. It seems very promising indeed! One problem I have is that yes, LiteLLM key creation is easier than creating it directly at the providers and managing it there for team members and test environments, but if I had a way of generating keys via vault, it would be perfect and such a relief in many ways. I see what I need on your roadmap, but miss integration with service where I can inspect and debug completion traffic, and I don't see if I would be able to track usage from individual end-users through a header. Thank you and godspeed!
- santiago-pl 6mo ago"... and I don't see if I would be able to track usage from individual end-users through a header". Currently we have a unified concept of User-Paths. Once you add a specific header OR assign User-Path to an API key, you can track the usage based on this. The User-Path might be youe end-user, internal user or some service. Examples: /client1/app1 /agents/agent1 /team2/john /team2/adam Would this work for you? https://gomodel.enterpilot.io/docs/features/user-path https://gomodel.enterpilot.io/docs/features/user-path PS Thanks for the feedback on the Vault integration. Noted.
- hgo 6mo agoAh, seems like the right thing. To be more clear on what I'm looking for is this: the system using the LLM gateway would present an arbitrary user id. Let's say the system has thousands of end-users (completely managed by that system and not configured in the LLM proxy). The admin is interested in blocking end-users from using more than a certain allowed quota.
- neilly 6mo agoGiven this app seems to expose itself via REST calls, why would anyone care that it’s written in Go? I guess it matters to potential contributors but the majority of interest would be from users.
- santiago-pl 6mo agoIt's like fuel costs in a supply chain. When you buy apples at the store, you don't think about oil prices. But if trucks ran on something cheaper, more efficient, or less taxed, the apples on the shelf would be cheaper too.
- StingSS 6mo agoReally slick and lightweight! My biggest question is about the upstream API evolution. Keeping up with every provider's updates feels like a full-time job—how do you automate or manage the tracking of these constant protocol shifts?
- santiago-pl 6mo agoI'm wroking on it full-time right now. It might be challenging, especially when it comes to interactions with video, audio, and image models. I'm just trying to stay on top of what's happening and add new things day by day. An even bigger challenge might be integrating it tighter with the cloud platforms, Prometheus, OAuth, Datadog, vaults, and DLP software.
- Trenchcole 6mo agoLove the progress!! keey going
- nopointttt 6mo agoNice work. How are you doing the cache key when the prompt has a timestamp or session id in it? Regex pass to strip volatile fields before hashing, or do you make the user declare what's stable upfront? I've tried both in my own stuff and neither ends up clean.
- giorgi_pro 6mo agoThank you. No config atm to declare which fields are "stable" for caching. I assume you mean cases where the user would provide a different session ID but still would prefer the key to match. Am I right?
- softcane 6mo ago[dead]
- ivanterechin 6mo ago[flagged]
- santiago-pl 6mo agoGiorgi is the semantic caching master at GoModel right now. Let me ping him, and he'll get back to you here.
- giorgi_pro 6mo ago[dead]
- ivanterechin 6mo ago[dead]
- deleted 6mo ago[deleted]
- deleted 6mo ago[deleted]
- richardbertok 6mo ago[dead]