Why Cerebrium “doesn’t even think about billing anymore”

How Cerebrium replaced DynamoDB with Lago
AI
Stories
Cerebrium

"I don't even think about billing anymore. If we want to change prices or try a new pricing model, it's not a massive engineering project. We just tweak a few things in the API, and it's done."

Michael Louis
Founder & CEO, Cerebrium

Introduction

Cerebrium helps AI and ML teams ship more, faster with their serverless infrastructure platform. Infrastructure is one of the core use cases of complex billing: It’s rarely charged as a subscription and requires many complexities.

Before using Lago, Cerebrium was managing billing in-house with a system built on DynamoDB. But as an infrastructure platform handling high-volume compute workloads, they ran into issues. Their customers needed billing transparency and their engineering team didn’t want to waste time manually customizing invoices for customers.

I sat down with Cerebrium’s founder Michael Louis to talk about their journey with Lago. Here’s what I found out:

Challenges

Cerebrium’s customers run extremely varying AI workloads. Some companies run batch workloads using model APIs (like GPT-4 o mini) on CPUs. Others train and operate image and video generation models at scale and create massive bills. This variance in usage made it necessary for Cerebrium to charge based on usage.

Their homegrown internal billing system stored metering data in. This worked for a while. But as the company scaled, they hit roadblocks:

  • Querying cost data became painful. DynamoDB wasn’t suited for SQL-like queries, making it difficult to break down customer costs over specific time periods and wasn’t performant.
  • Billing complexity increased. Customers had different pricing for various GPU types, CPU/memory usage, storage, and egress fees, all of which needed to be reflected in invoices. With an automated system like Lago, this is relatively easy. But for a homegrown system, each of these mean engineering work and an ever-more complex billing system.
  • Manual processes slowed them down. Handling failed payments, sending invoice breakdowns, and managing environment-based pricing (e.g., separate dev vs. production usage) became annoying and turned billing into a headache.

As Michael Louis told me: “We were building out all these things internally and we were like, this is not going to help us get more customers, but every customer expects it.” 

This is a typical problem with billing use cases: Your users/customers want something on their invoice, which means you either have to do it manually or put engineers on the task of automating it.

Why Cerebrium chose Lago

When the team decided to replace their in-house billing system, they evaluated several vendors. Lago stood out for a few reasons.

First, the fact that we’re open-source and ship quickly means Cerebrium can anticipate new features and track improvements. As Michael Louis put it: “We saw what was on the roadmap, how quickly things were being added, and we knew that you would have all the functionality we needed pretty quickly.”

Second, flexibility was important. Their billing logic required granular control over metering. Lago’s API-first approach allowed the team to customize billing to their liking. “We weren’t 100% set on our pricing model yet, so knowing we could implement it one way and then change it easily later was huge for us.”

Lago also provided support for high-complexity billing structures. Other billing systems lacked flexibility for multiple pricing variables, but Lago allowed them to charge for compute usage, GPU types, storage, and other factors while giving customers full transparency. 

The third point was that Lago was built for engineers. “I implemented our billing system myself, and I’m the CEO. The fact that I could do that in a week and test it out was a huge win.”

How Cerebrium uses Lago

Cerebrium uses many features to bill exactly as it wants to bill—without diverting engineers to billing projects. They also use extremely granular metering to track each bit of usage down to the millisecond to accurately bill for the compute time they use.

Another important feature was multi-factor pricing was another must-have. Every GPU type, vCPU, memory configuration, and storage usage has a different price. In a homegrown billing system, this would be incredibly complex to build. With Lago, they simply set up billable metrics and monitored usage. That way, they could create multiple pricing dimensions and reflect them in invoices without manual work.

Cerebrium also uses webhook automations to simplify customer engagement. If an invoice fails, Lago triggers automatic workflows to notify customers, prompt them to update payment methods, and, if needed, deactivate accounts. This way, billing runs smoothly without constant engineering intervention.

Another thing especially important to Cerebrium was billing differently based on environment. Since their customers operate in both development and production environments, Lago allows them to generate separate invoices for each, which keeps costs transparent and easy to track.

“Our users have separate dev and production environments, so we need to show separate invoices for each. Lago lets us assign different plans to each environment seamlessly.”

Lago also made it easy to cut enterprise deals. When Cerebrium started landing larger customers, they needed to offer custom pricing for bigger customers. With Lago, they can do that without any engineering effort straight from the interface. As Michael Louis told me: “We didn’t have to change anything—offering custom enterprise pricing was seamless.”

Finally, Lago also gives Cerebrium the opportunity to be lenient, but firm: “If a payment fails, we don’t immediately cut access. Lago handles retries and notifications, giving users a chance to fix it before we take action.”

Focus on building, not billing

Whether you choose premium or host the open-source version, you'll never worry about billing again.

Lago Premium

The optimal solution for teams with control and flexibility.

lago-cloud-version

Lago Open Source

The optimal solution for small projects.

lago-open-source-version