Skip to content

Inference 101, lesson 5

An API, a cloud or your own machine

You can pay per token, rent a chip by the hour, or run a model on your own hardware. This lesson weighs the three on privacy, cost at your volume, upkeep and the models each lets you use.

What do you run?

Every example below changes to fit what you pick. The businesses are made up for teaching.

The picture, one step at a time

Each box is one stage. The picture lights up as you scroll.

Step 1 of 6

Three places a model can run

You can pay per token on an API, rent a GPU by the hour, or run a model on hardware you own. Which ones are open to you depends on the model. Some makers let anyone download their model (its weights: the numbers it learned in training). These are open models, and they can run anywhere. A closed model can only be reached through an API.

Step 2 of 6

An API: pay per token, they do the rest

You send your text over the internet and get the answer back. No hardware, no upkeep, and the newest closed models on the day they launch. The bill grows with use. Your text goes to the provider, so read their terms on what they keep and for how long.

Step 3 of 6

A rented cloud GPU: pay by the hour

You rent a chip in someone else's data centre and run an open model on it yourself. You pay for every hour it is on, busy or idle (lesson 2). So it is only cheap per token when you keep it busy. Your data goes to the cloud company's building, but onto a machine you control.

Your rented GPU answers 20 questions a day. Is it cheap per token?

Step 4 of 6

Your own machine: pay once, keep it close

You buy the hardware and run an open model in your own building. Your data need never leave. But you set it up, update it and fix it when it breaks. And the model, plus its notes on each conversation (lesson 3), has to fit in the machine's memory, which limits how big a model you can run.

Step 5 of 6

Volume decides the money

At low or uneven volume, an API usually wins: you pay only for what you use. At high, steady volume, a rented or owned chip can work out cheaper, but only if you keep it busy and have someone to run it. Work out the fare per finished task each way, with lesson 4's worksheet, before you move.

Step 6 of 6

Where answering customers should run

Four questions decide it for answering customers. Where may this data go? Which model do you need, and is it open? How much will you use, and how steady is it? And who will keep it running? Answer them in that order.

Which question do you answer first?

Where should it run?

Here are four jobs in your business. Sort each one into the place it should run.

  1. 1You answer about 30 customer emails a week, at odd hours.

  2. 2You want an open model to translate your whole site and every past review into five languages, working day and night for a fortnight, then stop.

  3. 3Customers' addresses and order notes must never leave your premises.

  4. 4You want a particular closed model for the trickiest complaints.

0 of 4 right so far, 4 to go.

Where to run it: the checklist

This is what you keep: five questions to ask before you choose, and the order to ask them in.

Where to run it: the checklist

  1. Where may this data go? If it may not leave the building, run it on your own machine.
  2. Which model do you need? A closed model means an API. An open model can run anywhere.
  3. How much, and how steady? Light, uneven use suits an API. Heavy, steady use can suit a rented or owned chip.
  4. Who keeps it running? A rented chip or your own machine needs someone to set up, update and fix it.
  5. What is the fare per finished task each way? Work it out with lesson 4's worksheet.

Privacy first, then the model you need, then the money. Start on an API unless one of those says otherwise.

Next: Lesson 6: Batching, serving many people at once. Part 2 opens up the tricks that make each answer cheaper and faster.