DEV Community

Cover image for πŸŽ™οΈWe’ve Built the Fastest Way to Run LLMs in Production (50x faster than LiteLLM)πŸ”₯
Anthony Max
Anthony Max Subscriber

Posted on

πŸŽ™οΈWe’ve Built the Fastest Way to Run LLMs in Production (50x faster than LiteLLM)πŸ”₯

Today, AI applications are rapidly becoming more complex. Modern systems no longer rely on a single LLM provider, but must also switch between providers like OpenAI, Anthropic, and others, ensuring high availability, minimal latency, and cost control in production.

Direct API integrations or simple proxies no longer scale. Failures lead to downtime, persistent limits lead to errors, and ultimately lead to code rewrites. Full-fledged orchestration platforms and microservice solutions address these issues, but often prove too complex and, most importantly, too slow for applications.

That's why speed is so important today, ensuring clients receive responses as quickly as possible. For large websites, their audiences can reach enormous numbers, and every second saved is an extra cost. So, we created Bifrost to solve this and many other problems.

Well, let's get started! 🏎️

🌐 What is this project?

Bifrost is, first and foremost, a high-performance AI gateway with an OpenAI-compatible API that unifies 15+ LLM providers into a single access point and adds automatic failover, load balancing, semantic caching, and other essential enterprise features, all with virtually zero overhead and launches in seconds.

Bifrost

Since the architecture is Go-based, you can use the project on most stacks, without depending only on Node.js.

⏱️ Speed ​​comparisons

Let's get down to business. Since LiteLLM is one of the most popular projects today, we'll compare it to it and see how Bifrost compares.

To give you an idea, we ran some benchmark tests at 500 RPS to compare performance of Bifrost and LiteLLM. Here are the results:

Table

Both Bifrost and LiteLLM were benchmarked on a single instance for this comparison.

πŸ“Š Results on a bar chart

To make the result more visual, let's look at several diagrams in which we have displayed the numbers we obtained.

Bar chart

~9.5x faster, ~54x lower P99 latency, and uses 68% less memory than LiteLLM β€” on t3.medium instance (2 vCPUs) with tier 5 OpenAI Key.

As you can see, our project uses significantly less memory for calculations. Roughly speaking, without any figures, this means that if you use it, you'll need significantly fewer hosting resources to handle requests from 10,000 users, which means extra money for your plan.

πŸ“ˆ Results on a line chart

Now let's look at this wait time between sending a request and receiving a response.

Line chart

And this is one of the most straightforward and revealing points. The shorter the wait for a request, the higher the conversion rate. It's simple. We'll wait about 5 seconds for LiteLLM to complete its work, while Bifrost will complete its work in less than a second.

πŸ‘€ Ready to make your app faster?

If you want to try our LLM Gateway in practice, you can install it via npx

npx -y @maximhq/bifrost
Enter fullscreen mode Exit fullscreen mode

Or, install it as a Go package using the following command:

go get github.com/maximhq/bifrost/core
Enter fullscreen mode Exit fullscreen mode

All of these methods are equally suitable, depending on your application stack.

πŸ’¬ Feedback

We'd love to hear your thoughts on the project in the comments below. We also have a Discord channel where you can ask us any questions you may have.

βœ… Useful information about the project

If you'd like to learn more about our benchmarks, as well as our project in general, you can check out the following:

Blog: https://www.getmaxim.ai/blog
Repo: https://github.com/maximhq/bifrost
Website: https://getmaxim.ai/bifrost

Thank you for reading!

Thanks!

Top comments (3)

Collapse
 
leee_rodgers1 profile image
Lee Rodgers1

Interesting idea. I'd like to see it in practice.

Collapse
 
anthonymax profile image
Anthony Max

How do you like the project? I'd be interested to hear your opinion.

Collapse
 
leee_rodgers1 profile image
Lee Rodgers1

Looks good. I'll have to try it with OpenAI.