Serverless Computing: How It Works, Costs & Cold Starts

Connor Blier
Founding GTM

A head in profile whose brain is drawn as a circuit board with connection nodes

Serverless Computing: How It Works, Costs & Cold Starts

Serverless computing is an application development model where you build and run code on third-party managed server infrastructure. The provider provisions, scales, and maintains the servers on demand and bills you only for what you use, so there are still servers, just none you manage.

Serverless computing is an application development model where you build and deploy applications on infrastructure that a cloud provider provisions, scales, and maintains for you. Despite the name, servers do not disappear. What disappears is the work of running them: you do not see, configure, manage, or scale the underlying machines, and you pay only when your code actually executes.

This page is the canonical overview of serverless computing: what it is, the types, how it works, what it costs, the cold-start problem, the major providers, and why it has become the default way to run AI and GPU inference. Each section gives the complete short answer and links to the deeper write-up where we have one.

What is serverless computing?

Serverless computing is "an application development and execution model that enables developers to build and run application code without provisioning or managing servers or back-end infrastructure." The servers are real; the responsibility for them shifts to the provider.

The key contrast is with always-on infrastructure. In a traditional deployment you keep a dedicated server asset available at all times, paying for it whether or not requests arrive. In the serverless model, a cloud provider provisions, scales, and maintains the underlying components of your server infrastructure based on demand, rather than keeping a dedicated server asset available at all times. When nothing is running, ideally nothing is billed.

Types of serverless computing

Serverless is not a single product. It is a stack of services that respond to events or requests and scale to zero when no longer in use, with provisioning, management, and billing handled by the cloud provider and invisible to developers. The most familiar layer is Functions-as-a-Service (FaaS), where you deploy discrete functions triggered by events. Around it sit serverless databases, serverless storage, serverless queues, and increasingly serverless GPU compute for machine-learning inference. What unites them is the same abstraction: no capacity planning, event-driven execution, and consumption-based billing.

How does serverless computing work?

Serverless platforms are event-driven. A request, a queue message, a file upload, or a scheduled timer triggers an execution environment, your code runs, and the environment can be torn down afterward. Scaling is automatic: unlike autoscaling in other types of cloud computing, which requires fine-tuning rules, serverless autoscaling is instant and can scale down to zero. You do not write scaling policies; the platform spins up as many parallel executions as the incoming load demands and drops back to nothing when traffic stops.

That elasticity is powerful for AI, but it puts pressure on the network path around each invocation. If you are chaining models, retrieval, and post-processing, the round trips add up fast, and we cover how to keep them tight in network latency in an AI inference pipeline.

Benefits of serverless computing

The headline benefits follow directly from the model. You remove infrastructure toil, because provisioning, patching, and scaling are the provider's job. You get instant elasticity from zero to peak and back. And you align cost with actual usage instead of provisioned capacity. For teams shipping unpredictable or spiky workloads, that combination turns a fixed monthly server bill into a variable cost that tracks real demand.

Serverless pricing and the pay-as-you-go cost model

Serverless computing allows developers to purchase backend services on a flexible pay-as-you-go basis, meaning developers only have to pay for the services they use. Modern platforms meter this at fine granularity, often per second of compute. As a concrete reference point, Cerebrium's own published rate is pay-per-use at $0.000026 per second for a basic CPU application, with memory and CPU pricing included, and typical costs range from $20-100 for moderate workloads. There is also $30 in credits to test an application before committing.

Per-second billing changes how you reason about cost, especially for GPU-bound AI where the hardware is expensive and utilization varies. For a deeper breakdown of how these numbers scale with real model traffic, see LLM inference cost at scale and, for token-generating workloads, serving fine-tuned LLMs on serverless GPUs.

What are cold starts in serverless?

Cold starts are the flip side of scale-to-zero. Cold starts occur because serverless platforms are designed for cost-efficiency: you do not pay for compute resources when your code is not running, so when a request arrives with no warm environment available, the platform must create a new one first. For CPU functions this is usually milliseconds to seconds. For GPU workloads it is harder, because the container, the model weights, and the CUDA context all have to load.

This is where serverless AI lives or dies. In our testing, Cerebrium delivers cold start times of 2-4 seconds for serverless CPU/GPU inference. We also reworked node startup and initialization on AWS to reduce machine boot time by 83%, cut the long tail of cold starts, and lower the excess capacity we needed to keep running. The full engineering story, including how it affects real-time applications, is in serverless GPU cold starts for voice AI.

Major serverless providers

The major general-purpose serverless providers are AWS Lambda, Azure Functions, and Google Cloud Functions. AWS Lambda is a serverless compute service that lets developers run code in response to events without provisioning or managing servers, and Azure Functions and Google Cloud Functions offer comparable event-driven compute. These platforms are excellent for CPU-bound event handlers, but they were not built primarily around GPU inference, which is why AI teams often look elsewhere. We compare the trade-offs in AWS alternatives for AI workloads and, for GPU-first platforms specifically, Modal alternatives for serverless GPU inference.

Serverless computing for AI and GPU workloads

AI inference is a near-perfect fit for serverless: traffic is spiky, GPUs are costly, and scale-to-zero means you stop paying for idle accelerators between requests. The catch is that AI serverless has to solve GPU cold starts, large model loading, and low-latency networking that CPU FaaS never faced. When those are handled, you get on-demand GPU capacity billed per second, which is transformative for agents, chat, and real-time media. See how this plays out for demanding cases in GPU inference for AI agent workloads.

Common serverless use cases

Typical uses include API backends, event and stream processing, scheduled jobs, webhooks, and lightweight glue between managed services. On the AI side, the fastest-growing use cases are model inference endpoints, retrieval and embedding pipelines, and real-time voice and video agents, all workloads where bursty demand and per-second billing make the serverless model pay off.

Frequently asked questions

Does serverless computing mean there are no servers?
No. Serverless still runs on servers; the difference is that a cloud provider provisions, scales, and maintains them for you, so you do not see, configure, manage, or scale the underlying machines.
How is serverless billed?
On a pay-as-you-go basis, meaning you only pay for the services you use. Many platforms meter per second of compute rather than charging for provisioned, always-on capacity.
What is a cold start?
A cold start is the delay when a serverless platform has to create a new execution environment because none is warm. It happens precisely because you are not billed for resources while your code is not running.
Can serverless run AI and GPU workloads?
Yes. Serverless GPU platforms bring scale-to-zero and per-second billing to inference. The main engineering challenge is minimizing GPU cold starts; in our testing Cerebrium reaches 2-4 second cold starts for serverless CPU/GPU inference.
Who are the major serverless providers?
The best-known general-purpose providers are AWS Lambda, Azure Functions, and Google Cloud Functions, each offering event-driven compute without server management.

Get started with Cerebrium

Deploy AI models on serverless GPUs in minutes, with no infrastructure to manage. Start for free and pay only for the compute you use.

Sign up free

Sources

  1. aws.amazon.com
    “Serverless computing is an application development model where you build and deploy applications on third-party managed server infrastructure.”

    Canonical definition of serverless computing.

  2. aws.amazon.com
    “in the serverless model, a cloud provider provisions, scales, and maintains the underlying components of your server infrastructure based on demand, rather than keeping a dedicated server asset available at all times.”

    Contrast with always-on infrastructure.

  3. ibm.com
    “Serverless computing is an application development and execution model that enables developers to build and run application code without provisioning or managing servers or back-end infrastructure.”

    Definition used in the What is section.

  4. ibm.com
    “serverless is an entire stack of services that can respond to specific events or requests and scale to zero when no longer in use—and for which provisioning, management and billing are handled by the cloud provider and invisible to developers.”

    Supports the types-of-serverless section.

  5. cloudflare.com
    “Serverless computing allows developers to purchase backend services on a flexible 'pay-as-you-go' basis, meaning that developers only have to pay for the services they use.”

    Pay-as-you-go pricing model.

  6. cloud.google.com
    “Unlike autoscaling in other types of cloud computing, which requires fine-tuning rules, serverless autoscaling is instant and can scale down to zero.”

    How serverless autoscaling works.

  7. cloud.google.com
    “Serverless computing, despite its name, doesn't eliminate servers. Rather, it streamlines application development by abstracting away routine infrastructure tasks. This means you don't see, configure, manage, or scale the underlying machines running your applications.”

    The 'not no servers' point.

  8. aws.amazon.com
    “Cold starts occur because serverless platforms like AWS Lambda are designed for cost-efficiency – you don't pay for compute resources when your code isn't running.”

    Definition of cold starts.

  9. sedai.io
    “AWS Lambda is a serverless compute service that lets developers run code in response to events without provisioning or managing servers.”

    Major providers section.

  10. cerebrium.ai
    “**Serverless CPU/GPU Inference**: With cold start times of 2-4 seconds, its the most performant serverless platform on the market.”

    First-hand Cerebrium cold-start figure.

  11. cerebrium.ai
    “Pay-per-use at $0.000026 per second for a basic CPU application (memory & CPU pricing included)”

    First-hand per-second pricing.

  12. cerebrium.ai
    “$30 in credits that let you properly test your application”

    Free credits reference.

  13. cerebrium.ai
    “Typical costs range from $20-100 for moderate workloads”

    Cost guidance for moderate workloads.

  14. cerebrium.ai
    “In this post, we show how we reworked node startup and initialization on AWS to reduce machine boot time by 83%, cut the long tail of cold starts, and lower the amount of excess capacity we needed to keep running, improving overall utilization.”

    First-hand 83% boot-time reduction.


Related resources

See all
A processor chip with a lightning bolt at its centre, representing gpu inference ai agent workloads
GPU Inference for AI Agent Workloads
A clock face wrapped by a counter-clockwise arrow, representing serving fine tuned llms serverless gpu
Serving Fine-Tuned LLMs on Serverless GPUs
Three bold arrows branching from one junction toward different destinations, representing pipecat voice agent gpu deployment
Pipecat Voice Agents: Which Stage Belongs on a GPU