Resources/Model training/Trying and serving a model

Concept

Serverless vs dedicated

Serverless serving bills per token on shared capacity with no idle cost; a dedicated deployment reserves GPUs for your model and bills for every hour it exists. Which is cheaper depends on how much you use it.

Chapter 93 min read3 references

What it is

There are two ways to run a trained model. Serverless (also called per-token or on-demand) runs it on capacity the provider shares between many customers: you send requests and pay for the tokens in and out, and when you send nothing you pay nothing. A dedicated deployment reserves hardware for your model alone: it is always loaded and ready, and you pay for every hour it exists.

ServerlessDedicated
Billed byInput and output tokensHours the deployment exists
Idle costNoneFull hourly price
Start-upUsually immediateA cold start of minutes when created
CapacityShared; subject to rate limitsReserved; predictable throughput
AvailabilityOnly for models the provider supports this wayMost trained models, including open models

How the costs compare

the break-even point
serverless cost per day  = tokens per day × price per token
dedicated cost per day   = 24 × hourly price               (used or not)
break-even tokens/day    = 24 × hourly price ÷ price per token
usage (tokens per day)cost per dayBREAK-EVENSERVERLESS CHEAPERDEDICATED CHEAPERdedicated: hours × hourly priceserverless: tokens × price
Serverless cost grows with every token; a dedicated deployment costs the same per hour whether it answers one question or a million. Below the break-even point serverless is cheaper, above it dedicated is — and an idle dedicated deployment sits at the far left of the chart, paying the full line for nothing.

The intuition: with a dedicated deployment, the cost per token is the hourly price divided by how many tokens you actually push through it in that hour. At full load that can be cheaper than serverless. At low load it is far more expensive, and an idle hour has an infinite cost per token. Serverless has the opposite shape: the price per token is fixed, so cost tracks use exactly.

Why isn't everything serverless? Shared serving works by keeping a base model loaded for many customers. Some providers can attach a small fine-tuned adapter to that shared model per request, which makes per-token serving possible for tuned models. Others need the whole tuned model loaded on its own hardware — common for open models and for full fine-tunes — and then dedicated is the only option. Some providers go further and require reserved capacity for any customised model.

Worked example: illustrative prices, three usage levels
  1. Assume (illustrative, not real quotes) serverless at $0.60 per million tokens and a dedicated deployment at $5 per hour, i.e. $120 per day.
  2. Break-even: $120 ÷ $0.60 per million = 200 million tokens per day.
  3. A day of testing: 300 questions × 1,500 tokens = 450,000 tokens. Serverless: about $0.27. Dedicated: $120 for the day, or $10 if you delete it after two hours.
  4. A busy internal assistant: 50 million tokens a day. Serverless: $30. Dedicated: still $120.
  5. A high-volume product: 500 million tokens a day. Serverless: $300. Dedicated: $120, if one deployment can handle the load.

How to choose

  • Use serverless when it is available and usage is low, uncertain or bursty — testing, evaluation, pilots.
  • Use dedicated when the model can only be served that way, when steady traffic is above break-even, or when you need guaranteed capacity and latency.
  • Always set an end time on a dedicated deployment used for testing, and delete it when done. Commitments of weeks or months may lower the hourly price but remove that option.

Common mistakes

  • Forgetting a dedicated test deployment and paying for days of idle hours.
  • Comparing a dedicated hourly price with a serverless per-token price without converting through expected usage.
  • Assuming a tuned model can be served per token because its base model can.
  • Signing a long capacity commitment for a model that is still being iterated on.

References and further reading

External sources open in a new tab.

  1. 01Increase model invocation capacity with Provisioned Throughput in Amazon BedrockAmazon Bedrock User Guide · docs.aws.amazon.comA real example of reserved capacity: billed hourly until deleted, with optional commitments.
  2. 02Inference EndpointsHugging Face docs · huggingface.coDedicated endpoints for open models, with autoscaling.
  3. 03Serverless computingWikipedia · en.wikipedia.orgThe general model of paying per use, and its trade-offs such as cold starts.

Turn weeks of expert work into minutes

See how Scalata fits your team, your data, and your controls.