In an AI agent, only model inference needs a GPU, and only if you host the model yourself. Orchestration, tool execution, sandboxes, browsers, queues and databases run on CPU. Small embedding models can run on CPU at modest volume; LLMs, speech, vision and image models want a GPU once they serve more than one user.
- Needs a GPU
- Self-hosted LLM, speech, vision and image models
- Runs on CPU
- Agent loop, sandboxes, browsers, queues, databases
- Borderline
- Embeddings and rerankers at low volume
- Decode speed driver
- Memory bandwidth: RTX 4090 1,008 GB/s vs ~50–100 GB/s desktop DDR5
- Smallest useful agent GPU
- RTX 4090 (24 GB), $1.59/hr
- Typical agent workhorse
- L40S (48 GB), $1.89/hr
People planning agent systems often assume the whole thing needs GPUs. It doesn't. An agent is mostly waiting: on the model, on tools, on web pages, on other services. Only one component does heavy parallel maths, and you may not even host that one. This guide goes component by component through an agent stack, says which parts need a GPU and which don't, and shows the sizing maths so you rent no more than you need.
Which parts of an AI agent need a GPU?
The model needs a GPU if you host it. So do speech, vision and image models if the agent uses them locally. Everything else runs on CPU.
| Component | GPU or CPU? | Why | Rough sizing |
|---|---|---|---|
| LLM (self-hosted) | GPU | Billions of multiply-adds per token; bandwidth-bound decode | 24–80 GB VRAM for 8B–70B models |
| LLM (hosted API) | Neither (on your side) | The provider runs it | An HTTPS client |
| Agent loop and orchestration | CPU | Waits on I/O; trivial compute | Tens of loops per vCPU |
| Tool sandboxes | CPU | Runs shell, Python, file work | 0.5–2 vCPU, 1–4 GB RAM each |
| Headless browsers | CPU | Rendering pages; memory-heavy | Several hundred MB to 1 GB+ RAM each |
| Queue, database, vector store | CPU | Indexing and lookups | Standard server sizing |
| Embeddings | Either | Small models; batchable | CPU at low volume, GPU for bulk |
| Reranker | Either | Small cross-encoder | CPU for a few queries a second |
| Speech-to-text (Whisper) | GPU, ideally | Encoder-decoder over audio | Fits easily in 24 GB |
| Vision / screenshots | GPU or hosted API | Vision-language model | As for an LLM of the same size |
| Image generation | GPU | Diffusion models | 24 GB and up |
| Tracing and logs | CPU | Writes and queries | Standard |
This is why the most common production layout is a small number of GPUs running models, surrounded by ordinary CPU servers running everything else. The AI agent infrastructure pillar describes each layer; this page is about hardware.
Why do models need a GPU when the agent loop doesn't?
Generating a token means reading every active weight of the model from memory once. That makes decode speed mostly a matter of memory bandwidth, and GPUs have 10–40 times the bandwidth of a typical server's main memory. Prefill (reading the prompt) is compute-bound, and GPUs have far more compute too.
The agent loop, by contrast, does almost nothing: build a JSON request, wait, parse a JSON response, run a tool, wait again. A single CPU core can drive dozens of loops. The background on why the two processors differ is in GPU vs CPU explained.
Can you run the agent's LLM on a CPU?
You can run a small, quantised model on a CPU for one developer; you cannot serve a team's agents that way. The rule of thumb for single-stream decode speed is tokens/s ≈ 0.6–0.75 × memory bandwidth ÷ bytes read per token.
| Hardware | Bandwidth | Model | Bytes per token | Estimated decode speed |
|---|---|---|---|---|
| Desktop CPU, dual-channel DDR5 | ~80 GB/s | Qwen3 8B, 4-bit (~4.5 GB) | 4.5 GB | 0.6–0.75 × 80 ÷ 4.5 ≈ 11–13 tokens/s |
| Server CPU, 8-channel DDR5 | ~300 GB/s | Qwen3 8B, 4-bit | 4.5 GB | ≈ 40–50 tokens/s |
| RTX 4090 | 1,008 GB/s | Qwen3 8B, BF16 (16 GB) | 16 GB | 0.6–0.75 × 1,008 ÷ 16 ≈ 38–47 tokens/s |
| RTX 4090 | 1,008 GB/s | Qwen3 8B, 4-bit | 4.5 GB | ≈ 130–170 tokens/s |
| H100 PCIe | 2,000 GB/s | Llama 3.3 70B, FP8 (70 GB) | 70 GB | ≈ 17–21 tokens/s |
These are estimates from published bandwidth figures, not measurements. Two things make the CPU rows worse for agents than they look.
Prefill. Agents send long prompts: system prompt, tool schemas, history and tool output, commonly 5,000–30,000 tokens. Prefill is compute-bound, and a CPU's compute is a small fraction of a GPU's, so a CPU can take tens of seconds just to read a long agent prompt before producing the first token. A GPU reads it in a second or two.
Concurrency. A GPU running vLLM batches many sequences, so aggregate throughput rises many times over single-stream as more agents run. CPU inference gets little from batching. Ten agents on a CPU means each one slows to a crawl.
So: CPU inference with llama.cpp is fine for offline experiments and a single developer's agent. Production agents serving a team need a GPU, or a hosted API. The tokens per second guide goes deeper on throughput.
How much GPU memory does an agent model need?
An agent model needs VRAM for its weights plus a KV cache large enough for long contexts across several concurrent agents. The second part is what people underestimate.
KV cache per token = 2 × layers × KV heads × head dim × bytes. For Qwen3 32B (64 layers, 8 KV heads, head dim 128) in FP16 that is 2 × 64 × 8 × 128 × 2 = 262,144 bytes ≈ 0.25 MB per token.
| Setup | Weights | Headroom (15%) | KV budget | Tokens of KV | Concurrent 12k-token agents |
|---|---|---|---|---|---|
| Qwen3 32B AWQ on L40S (48 GB) | ~18 GB | ~7 GB | ~23 GB | ~92,000 | ≈ 7 |
| Same, FP8 KV cache | ~18 GB | ~7 GB | ~23 GB | ~184,000 | ≈ 15 |
| Qwen3 32B AWQ on RTX PRO 6000 (96 GB) | ~18 GB | ~14 GB | ~64 GB | ~256,000 | ≈ 21 |
| Qwen3 32B AWQ on H200 (141 GB) | ~18 GB | ~21 GB | ~102 GB | ~408,000 | ≈ 34 |
Agents don't all hold a live sequence at once (some are waiting on tools), so real concurrency per GPU is higher than the last column, but this is the right order of magnitude for planning. More on the formula in how much GPU memory LLMs need.
Do embeddings and RAG need a GPU?
Usually not at first. Small embedding models (tens to a few hundred million parameters) run on CPU well enough to embed queries as they arrive and to index thousands of documents overnight. A GPU pays off when you re-embed large corpora, when many agents embed at once, or when you use a large embedding model.
A practical pattern: keep query embedding on CPU next to your vector database, and run bulk indexing jobs on a GPU you rent for an hour and stop. If you already run a GPU for the LLM, an embedding model of a few hundred MB fits alongside it and costs nothing extra.
Do browser and computer-use agents need a GPU?
The browser doesn't. Headless Chromium renders on CPU, and its constraint is memory: plan several hundred MB to over 1 GB of RAM per active browser, so a 32 GB server runs tens, not hundreds. The model that interprets screenshots does need a GPU, either a hosted vision API or an open vision-language model on your GPU endpoint.
Keep browsers off the GPU machine at scale. They are cheaper to run on CPU servers, they are where prompt injection comes in, and they shouldn't share a box with your model server.
When does the agent itself need a GPU?
The agent's own environment needs a GPU when its work is GPU work, not when its thinking is. Examples:
- A coding agent writing and running training scripts, CUDA kernels or model evaluations.
- A data agent transcribing hours of audio with Whisper, or captioning thousands of images.
- A creative agent generating images or video with FLUX or a video model.
- A research agent fine-tuning a small model on data it has collected.
That is where a whole GPU machine for the agent makes sense, rather than a CPU sandbox calling a remote model. The guide on why agents need their own computers covers how to set one up safely.
How do you develop on CPU and deploy on GPU?
Develop against the same OpenAI-compatible interface you will use in production, and only the base URL changes between your laptop and the GPU. llama.cpp serves a quantised GGUF model on CPU (or a laptop GPU) with an OpenAI-style API; vLLM serves the full-size model on a rented GPU.
# Laptop or CPU server: a 4-bit GGUF file you have downloaded from Hugging Face
llama-server -m ./qwen3-8b-q4_k_m.gguf --port 8080 --jinja
export LLM_BASE_URL="http://localhost:8080/v1"
# Production GPU: the same agent code, a different endpoint
export LLM_BASE_URL="https://your-gpu-endpoint/v1"--jinja makes llama-server use the model's own chat template, which tool calling relies on. Expect the CPU version to be slow on long agent prompts for the prefill reasons above; it is for checking logic, not latency. One caution: a small 4-bit model calls tools less reliably than the 32B model you will deploy, so judge prompt quality on the GPU model, not the laptop one. The Qwen model cards on Hugging Face list the tool-calling formats each model expects.
What does a cost-sensible agent stack look like?
Rent GPU time only for the components that need it, and keep it busy. A typical small production stack:
| Part | Hardware | Hours | Cost basis |
|---|---|---|---|
| Private agent model (Qwen3 32B AWQ) | 1 × L40S | 10 h on weekdays, stopped overnight | 10 × $1.89/hr ≈ $18.90 a day |
| Orchestrator, queue, Postgres, 20 sandboxes | 8 vCPU, 32 GB CPU server | 24 h | Your CPU provider's monthly rate |
| Browsers (10 concurrent) | Same or a second CPU server | 24 h | As above |
| Bulk embedding job | 1 × RTX 4090 | 1 h a week | 1 × $1.59/hr ≈ $1.59 a week |
| Hard reasoning steps | Frontier hosted API | Per call | Per token |
Compare the first row against a hosted API with the break-even sum from the run agents in the cloud tutorial: GPU-hours per day × hourly price versus tasks per day × hosted cost per task. If your GPU would be idle most of the day, the hosted API is likely cheaper; if it is busy, the GPU is.
When does renting a GPU from Wandering Giants fit?
It fits the one part of your agent stack that needs a GPU. An API GPU on Wandering Giants Compute gives your agents a private OpenAI-compatible endpoint for a one-click model such as Qwen3 32B AWQ on an L40S or gpt-oss 120B on an H100, so the CPU side of your stack can live wherever it already does. A Root machine fits when an agent's own work needs a GPU. Billing is by the minute, so a model you run only in working hours costs only working hours. We don't rent CPU-only servers; keep those with your usual provider. See GPUs and prices.
Frequently asked questions
Can I run an AI agent without a GPU?
Yes. If your agent calls a hosted model API, nothing in your own stack needs a GPU: the loop, tools, sandboxes and browser all run on CPU servers. You need a GPU only when you host the model yourself or the agent's work involves GPU tasks such as training or image generation.
Can I run the LLM for my agent on a CPU?
Small quantised models (around 8B parameters at 4-bit) run on a CPU with llama.cpp at single-digit to low tens of tokens per second, which is usable for one developer. It does not scale: agents resend long contexts every step, and CPU prefill on 10,000-token prompts is slow. For more than one user, use a GPU.
Do embeddings need a GPU?
Not at low volume. Small embedding models run acceptably on CPU for indexing a few thousand documents or embedding queries one at a time. Re-indexing millions of chunks, or serving embeddings to many agents at once, is far faster on a GPU.
Do browser agents need a GPU?
Headless browsers run on CPU and are memory-hungry rather than GPU-hungry. Only the model that reads screenshots needs a GPU, and that can be a hosted API or a vision model on a separate GPU endpoint.
Should the agent's tools run on the GPU machine?
Light tools can, for a small single-team setup. At scale keep them apart: GPU hours are the expensive resource, and sandboxes and browsers are cheaper on CPU servers that you can scale and replace independently.
Rent the GPU for this, by the minute.
Rent the one part of your agent stack that needs a GPU: a private model endpoint from 24 GB, billed by the minute.
Prepaid credit, billed by the minute, stops itself when credit runs out. Prices in £, $, €, ¥, CA$, A$, CHF and S$; UK prices include VAT.
Keep reading
- Complete guideWhat Is AI Agent Infrastructure? A Complete Guide
- GuideGPU vs CPU: What's the Difference and When Do You Need Each?
- GuideHow Much GPU Memory Do You Need to Run LLMs?
- GuideWhat Is Tokens Per Second? Understanding LLM Inference Performance
- TutorialHow to Run Autonomous AI Agents on Cloud Infrastructure
- GuideWhy AI Agents Need Their Own Computers and Execution Environments
About this article. Written by the Wandering Giants Compute team, the people who run Wandering Giants Compute. Hardware figures are the manufacturers’ published specifications. Speeds and costs marked as estimates are worked out from those specifications and our current prices, with the method shown; they are not measured benchmarks. Wandering Giants prices are taken live from our price list each time this page is built.
Last reviewed 25 November 2026.