Your Customer Pays by the Minute

More and more products run on the customer's infrastructure: they connect to the customer's cloud account, run work on it, and use servers the customer pays for. In that setup, every minute your product uses shows up on someone else's bill. If you don't understand how your customer is billed, you can build a product that works great and costs them far more than it should.

We built a platform that runs competitions between AI models. Each participant deploys their model on their own GPU server, and our system sends it test requests and gives it a score. The participant pays for that server by the minute.

When your customer pays by the minute, the time your system takes is their bill. That changes a lot of decisions.

Not how many requests, but how many minutes

Early in the project, one of the engineers asked whether every test request we send makes the participant's bill higher. It's a reasonable question, and it came from experience: every language model service she had worked with charged per request.

I answered that as far as I knew, here they pay by time and not per request, but that questions like this should go to the client. She checked with them, and the answer was clear: the participant pays per GPU hour, for every minute their server is running. I explained what that means: "It doesn't matter whether the endpoint received 100 requests or 1,000 requests. The only thing that matters is how long it took the evaluator to finish the evaluation".

She immediately asked how to send all the requests as fast as possible. I answered that at this stage I wouldn't touch it: "It is optimization. Open a GitHub issue and move on". First you need a system that works. The billing model needs to be understood from the start. Optimizations around it can be built once there is a product that works.

A 42-minute score

Almost a month later we came back to solve it, this time with real numbers. Another engineer measured how long the check takes, and found that with a slow model, one that answers in close to a second per request, checking 2,500 requests takes up to about 42 minutes. 42 minutes the participant pays for, just to get a score.

The reason was that the check sent the requests one after another. That way you can measure the model's response time precisely, and that is one of the things the competition measures. She found a fix herself and separated the two things being checked:

  • Correctness of the answers is checked on all requests in parallel, because there, time doesn't matter.
  • Response time is measured on a fixed sample of 250 requests, one after another, so the measurement stays clean.

On a typical model, the whole check now takes about half a minute. In the worst case, a model that answers in close to a second per request, it takes about 9.5 minutes, and about 15 minutes if the number of requests grows to 5,000. In other words, in the worst case the participant now pays for less than a quarter of the time they paid for before, and gets exactly the same score.

Decisions that change the competition belong to the client

Even 9.5 minutes is a lot, and the engineer laid out the remaining options: lower the maximum response time allowed for a model, reduce the number of requests in the check, or send more requests in parallel, which changes what the competition's throughput measure means.

Each of these options changes the competition itself: what is measured, and who passes. You don't make decisions like that alone, so I said this is exactly a question to take to the client.

I suggested one rule that doesn't change the competition, only protects the participant: a single request that takes more than a second is a failure, as before. But a check that has already run for more than 10 minutes is a failure too. A slow model that barely passes every request can't keep growing the bill without limit.

Protecting the customer's money should be the default

Later, the team built infrastructure for automatically creating checks for new competitions. One of its parts stops immediately when the participant's server doesn't respond, instead of waiting for every request to fail on its own. I asked whether this part would be optional or part of every check, and said I thought it should not be optional. At least for automatically created checks, it should be there by default, and a developer building a specific check can decide it doesn't need it. The engineer confirmed it already works that way.

A protection someone has to turn on by hand, in most cases nobody turns on. If it guards the customer's money, it needs to work even when nobody thought about it.

Tell the customer when to stop paying

Before the first demo, one of the things I marked as missing was a live update to the participant: the check on your server is done, and you can turn it off. Without that update, the participant doesn't know when it's safe to turn the server off. So they leave it running, just in case, and pay for minutes nobody uses.

We left the decision on whether to build it to the client, and they really wanted it. By the next meeting with them, that same week, the update already worked, and it was the main progress we showed.

Takeaways

  1. Understand how the customer is billed before you design. Billing per request and billing by time lead to completely different solutions.
  2. Put a ceiling on total time, not just on each request. Without a ceiling, one slow model can keep running and billing without limit.
  3. Protections for the customer's money are the default, not an option someone has to remember to turn on.
  4. Decisions that change what the customer gets go to the customer. What only protects them, you can decide yourself.

Whenever your product runs on someone else's infrastructure, ask who pays for that time, and design accordingly.