From model capability to application service

Imagine someone uploads a document to a web application and asks a question about it. The application needs somewhere to send the document and prompt. A service loads the chosen model, keeps suitable hardware available, accepts the request, runs the model and returns the answer. It also handles busy periods, quiet periods, failed requests and model updates. That service is the model-serving layer.

Choosing an AI model or training an AI model gives you a capability. Model serving turns that capability into a dependable part of an application.

This guide compares four ways to provide the model-serving layer: self-hosted infrastructure, a managed endpoint, serverless GPU inference and a managed model API. By the end, you should understand who operates each part, where costs enter and which route deserves a representative workload test.

Choose the serving approach around the workload

Compare who operates each layer and the main cost question for each model-serving approach.
ApproachYou operateProvider or project operatesMain cost question
Self-hostedRuntime, cluster, scaling, security and observabilityPhysical cloud infrastructure where rentedCan sustained utilisation repay the operating work?
Managed endpointModel configuration and service policyEndpoint infrastructure and much of the scalingWhich platform charge follows the endpoint?
Serverless inferenceModel or container plus request contractWorker lifecycle and demand-led scalingHow do startup, active time and warm capacity affect cost?
Managed model APIApplication integration and usage controlsModel, runtime and infrastructureDoes usage pricing suit the complete workload?

Start by estimating the model's memory requirement in the GPU model explorer, then use the GPU cloud price comparison to understand the infrastructure behind the serving option.

What happens when an application calls a model?

  1. The model weights are stored. They may live in an object store, model registry, persistent volume or local cache.
  2. The serving worker starts. A process prepares the serving engine and reserves CPU, memory and accelerator capacity.
  3. The model loads into memory. Weights occupy GPU or system memory alongside working buffers and request state.
  4. The application sends a request. HTTP/REST is common for public APIs, while gRPC supports typed, high-throughput systems.
  5. The scheduler places the work. A serving engine can queue requests, form batches and choose a model replica.
  6. The model performs inference. The accelerator processes the input and produces the output.
  7. The endpoint returns the result. The application receives a response or stream while the platform records usage.

Serving is how inference becomes an application service

Training creates or adjusts a model. Inference uses that model to produce an answer, prediction, embedding, image, audio clip or another output. Model serving supplies the endpoint, runtime, hardware, scaling and controls that allow an application to request inference repeatedly.

How four inference patterns change the application experience and cost shape.
Inference patternApplication experienceMain cost shape
OnlineA response during an interactive requestReady capacity, request duration and latency target
StreamingOutput arrives incrementallyGeneration duration and concurrent sequences
AsynchronousA larger request enters a queueProcessing, queue, payload storage and result retention
BatchA dataset or job runs as one body of workJob duration, throughput and rented-capacity utilisation

Language-model inference has two useful phases. Prefill processes the input prompt and creates the initial KV cache. Decode uses that state to generate output tokens. Longer prompts increase prefill work and time to first token. Longer answers keep decode active, while higher concurrency increases the number of active sequences sharing memory and scheduling capacity.

What happens inside the GPU?

The running example uses Meta Llama 3.1 8B Instruct in BF16 on one NVIDIA H100 SXM with 80 GB of HBM3. The example chat contains 2,000 input tokens and generates 500 output tokens.

Assumptions used for the Llama 3.1 8B on H100 worked example.
Running-example inputWorking assumption
ModelMeta Llama 3.1 8B Instruct
Weight formatBF16, approximately 2 bytes per parameter
Approximate weight memory16 GB
GPUOne NVIDIA H100 SXM
GPU memory and bandwidth80 GB HBM3 and 3.35 TB/s peak bandwidth
Chat shape2,000 input tokens and 500 output tokens
KV cache per token128 KiB at BF16 for this architecture
KV cache for 2,500 tokens312.5 MiB, approximately 328 MB
Memory after weightsRoughly 64 GB before runtime buffers and KV cache
Theoretical weight-read floorAbout 4.8 ms at published peak bandwidth

The KV-cache estimate is 2 for keys and values multiplied by 32 layers, 8 KV heads, 128 values per head and 2 bytes. That gives 128 KiB per token. A separate 10 GB runtime reserve would leave approximately 54 GB for KV-cache growth, while the hardware-only subtraction leaves roughly 64 GB before those additions.

GPU memory movement can set the decode pace

Model weights usually remain resident in GPU HBM or VRAM. On-chip registers, shared memory and caches hold smaller working tiles. Kernels move those tiles through the memory hierarchy so execution units can perform the calculations.

For the running example, a simplified dense-transformer estimate gives an ideal arithmetic floor of about 0.016 ms. Moving 16 GB of weights at 3.35 TB/s gives an ideal transfer floor of about 4.8 ms. These are teaching bounds. A real benchmark also includes cache traffic, KV-cache operations, kernels, scheduling and achieved utilisation.

A larger batch applies the resident weights to several active sequences, spreading weight movement across more useful token work. Memory capacity, latency targets and the request mix set the practical limit.

What changes when more people use the model?

Active requests reuse the resident model weights and bring their own input, output and KV-cache state. Capacity planning therefore follows concurrent requests, prompt length, output length, latency targets and cache reuse. Registered users provide context, while concurrent active work supplies the stronger capacity signal.

This is the point where the serving engine becomes pivotal. It decides how requests share the resident model, how KV-cache memory is managed and how much paid GPU capacity becomes completed work.

The serving engine is a pivotal cost layer

A team serving its own model needs software between the application and the GPU. The serving engine loads the model, exposes an endpoint, queues requests, forms batches, manages request state and schedules inference. Choosing a GPU without choosing this layer leaves a central part of the serving design unresolved.

An effective engine can keep resident weights productive, reduce wasted KV-cache capacity and complete more useful work during each paid GPU-hour. The result depends on the model, traffic and latency target, so the relevant measure is cost per completed request or token that meets the service target.

How vLLM, SGLang and NVIDIA Triton influence serving cost.
Serving componentWhat it contributesWhy it matters to cost
vLLMLanguage-model serving with PagedAttention, continuous batching and an OpenAI-compatible serverBlock-based KV-cache management and batching can support more useful concurrent work on the available memory
SGLangLanguage and multimodal serving with prefix-aware cache reuse, scheduling and OpenAI-compatible APIsReusing eligible prompt prefixes can reduce repeated work for agents, shared documents and structured prompts
NVIDIA TritonA general inference server with several backends, schedulers, HTTP/REST, gRPC, metrics and model operationsDynamic batching, concurrent execution and one operational layer can improve utilisation across supported model workloads

vLLM and SGLang specialise in language and multimodal model serving. Triton provides a broader inference-server layer across supported model backends. They overlap in parts of the request path while solving different operating problems. Compare them with the same model, traffic shape, hardware and latency target before choosing a serving stack.

Self-hosted serving gives the team the control plane

Self-hosting means running a serving engine on infrastructure your team manages. That can be one dedicated GPU, a virtual machine, or a Kubernetes platform using a serving layer such as KServe.

The complete operating bill includes:

  • GPU or CPU nodes, system memory and accelerator memory;
  • model storage, image storage and network transfer;
  • load balancing, logs, metrics, traces and security;
  • capacity kept ready for latency targets;
  • engineering time for deployment, incidents and upgrades.

Managed serving packages endpoint operations

Managed serving keeps your model deployment visible while a platform operates more of the endpoint infrastructure. Common examples include:

The managed premium can buy time, platform consistency and operating controls. Compare the platform charge, provisioned capacity, transfer and engineering effort as one bill.

Managed model access

Amazon Bedrock is an example of managed model access. It gives applications API access to supported foundation models while AWS operates the model-serving infrastructure. The customer chooses a model and commercial mode rather than deploying its weights and serving runtime.

Other examples include:

Bedrock provides access to model families from several providers through an AWS service. Direct model APIs centre one provider's model family. Both routes package the runtime and infrastructure into usage-based commercial terms. Deploying your own model through SageMaker, Kubernetes or a custom GPU container gives the team deeper control over weights, serving software and hardware.

Runpod shows dedicated and serverless GPUs together

Runpod Pods provide dedicated GPU environments where the team chooses the GPU, image, storage and lifecycle. Runpod Serverless places containerised inference workers behind an API. Startup, execution and warm capacity therefore belong in the comparison alongside the GPU rate.

The GPU billing guide explains how lifecycle states, minimums and supporting resources turn a displayed rate into a working budget.

The neocloud company guide maps ten AI-focused infrastructure providers to the service and cost questions that shape a shortlist.

Compare the complete serving cost

Each serving route can produce the same application result while exposing a different part of the bill. Start with one representative workload, then translate every option into the same cost categories.

  • Managed model APIs can bundle compute, the runtime and model operations into token or request prices.
  • Managed endpoints can bundle orchestration and infrastructure into endpoint or provisioned-throughput charges.
  • Serverless GPU services can expose active-worker time, warm capacity, storage and transfer.
  • Self-hosted platforms expose the infrastructure while the team supplies the runtime, scaling, security and operations.
Use one complete-cost modelcomplete serving cost = compute + memory + storage + transfer + platform fees + idle capacity + operations

Measure each option over the same period and against the same latency and reliability target. Include failed requests, retries, deployment time and capacity kept ready for demand. The measured cloud GPU rendering case study shows how setup time and failed capacity can change the complete job cost. The vLLM A40 benchmark shows how concurrency changed throughput, latency and attributed output-token cost on one rented GPU. Use the vLLM, SGLang and TensorRT-LLM comparison to compare engines, and the RTX 6000 Ada vs A40 benchmark comparison to weigh faster responses against GPU cost per token.

Five questions before choosing

  1. How steady is demand across the day and week?
  2. How quickly must the first response arrive?
  3. How much model and runtime control does the workload need?
  4. Which infrastructure can the team operate reliably?
  5. Which complete cost will the benchmark measure?

Download the comparison data

Frequently asked questions

What is model serving?

Model serving makes a trained or pre-trained model available to an application through an endpoint. The serving layer loads the model, runs inference, returns results and manages the operational capacity around those requests.

Is serverless model serving cheaper?

Serverless serving can suit intermittent or unpredictable traffic because active workers follow demand. The complete comparison also includes cold starts, minimum worker settings, active time, queueing behaviour and any warm capacity kept ready.

What is the difference between SageMaker and Bedrock?

SageMaker provides several deployment routes for models that you configure and operate through managed infrastructure. Bedrock provides managed access to supported foundation models through usage-priced APIs and selected provisioned options.

What is the difference between Runpod Pods and Serverless?

A Runpod Pod gives you a rented machine whose lifecycle and attached storage you manage. Runpod Serverless runs endpoint workers around incoming requests, with worker settings and active processing shaping the bill.

Do I need Kubernetes to serve an AI model?

Kubernetes can suit teams that need control, portability and sustained multi-service operations. A managed endpoint, serverless GPU service or managed model API can provide a shorter route when the team values packaged operations and faster delivery.

Sources and checking date

Sources were checked on . Provider capabilities and commercial terms can change, so recheck the linked pages before a current purchasing decision.

Get the next cost check

Practical AI and GPU cost guides, built from dated sources and real workloads. Sent when there is something useful to share.

Kit stores your address and sends a confirmation email. Unsubscribe at any time. Read the privacy details.