Wandering Giants Compute · Learn
Tutorial

How to Run Llama on a Cloud GPU: Step-by-Step Guide

The short answer

To run Llama on a cloud GPU, rent a card with enough VRAM (24 GB for Llama 3.1 8B, 80–96 GB for Llama 3.3 70B in FP8, two or more 80 GB cards for BF16), accept Meta's licence on Hugging Face, then start vLLM or Ollama and call its OpenAI-compatible endpoint.

Llama 3.1 8B weights
About 16 GB in BF16, 8 GB in FP8
Llama 3.3 70B weights
About 140 GB BF16, 70 GB FP8, 40–43 GB at 4-bit
Llama 3.3 70B KV cache
About 0.33 MB per token (FP16); 0.16 MB with FP8 KV
Context window
128k tokens (131,072) for Llama 3.1 and 3.3
One-card 70B options
H100 80 GB (FP8, short context), RTX PRO 6000 96 GB or H200 141 GB
70B FP8 single-stream speed on H100 PCIe
About 17–21 tokens/s (estimate from bandwidth)
Hugging Face access
Gated: accept the Llama licence and use an HF token

Running Llama on a rented GPU comes down to two decisions: which Llama and at what precision, and whether you want the model served for you or want the machine to yourself. This guide gives the VRAM sums for each option and the exact commands for vLLM and Ollama. It also shows how to call the result from curl and Python through an OpenAI-compatible API.

The commands assume an Ubuntu machine with NVIDIA drivers and CUDA, Python 3.10 or newer, and a recent vLLM release (written against the vLLM 0.10/0.11-era command line; run vllm serve --help if a flag has moved). For the theory behind every number, see the complete guide to LLM inference.

Which Llama model should you run?

For most people the choice is Llama 3.1 8B Instruct for cheap, fast, simple tasks, or Llama 3.3 70B Instruct for quality close to frontier hosted models on general chat and coding. Llama 3.1 405B exists but needs a multi-GPU machine with roughly 500 GB or more of VRAM even in FP8.

ModelHugging Face IDParametersContextGood for
Llama 3.1 8B Instructmeta-llama/Llama-3.1-8B-Instruct8B128kClassification, extraction, simple chat, high volume
Llama 3.3 70B Instructmeta-llama/Llama-3.3-70B-Instruct70B128kGeneral assistant, coding help, RAG answers, agents
Llama 3.1 405B Instruct (FP8)meta-llama/Llama-3.1-405B-Instruct-FP8405B128kLargest dense Llama; distillation, evaluation

Meta's models are gated. Before any download, open the Llama 3.3 70B Instruct model card, accept the Llama 3.3 Community License, and create a read token in your Hugging Face settings.

How much VRAM does Llama need?

Weights take parameters × bytes per parameter, the KV cache takes about 0.13 MB per token for 8B and 0.33 MB per token for 70B in FP16, and you leave 10–20% headroom. The KV figure comes from 2 × layers × KV heads × head dimension × bytes: 2 × 32 × 8 × 128 × 2 for 8B, and 2 × 80 × 8 × 128 × 2 for 70B.

SetupWeightsKV for one 16k sequenceTotal with ~15% headroomGPUs that fit
8B BF1616 GB2.1 GB~21 GBRTX 4090 (24 GB), anything larger
8B FP88 GB2.1 GB~12 GBRTX 4090 with lots of KV room
70B 4-bit (Ollama Q4_K_M)~43 GB5.4 GB~56 GBA100 80GB; L40S 48 GB only with a short context
70B FP8, FP8 KV~70 GB2.7 GB~84 GBH100 80 GB (short context), RTX PRO 6000 96 GB, H200
70B BF16~140 GB5.4 GB~167 GB2× H200, or 4× H100/A100 for comfort

Two points the table hides. First, these are per sequence: ten users with 16k contexts on 70B need ten times the KV cache. Second, the 80 GB H100 is the tight one for 70B FP8. It works, and it is one of the models we serve one-click, but the KV pool left over is small, so long contexts and many concurrent users push you to the 96 GB or 141 GB card. The GPU memory guide for LLMs walks through these sums for other models.

Option 1: How do you get Llama running without setting anything up?

On Wandering Giants Compute you can skip the install: pick a GPU, choose Chat or API, pick Llama 3.3 70B FP8 from the one-click models (it needs an 80 GB card), and launch. The model downloads to your GPU and is served by vLLM; Chat gives you a private chat in the dashboard, and API gives you a base URL and your own key.

With API, the endpoint is OpenAI-compatible. Put the base URL and key from your dashboard into environment variables (the values below are placeholders):

bash
export WG_BASE_URL="https://YOUR-ENDPOINT/v1"
export WG_API_KEY="your-key-from-the-dashboard"

# List the model name the server expects
curl -s "$WG_BASE_URL/models" -H "Authorization: Bearer $WG_API_KEY"

Use the id from that response as the model name:

bash
curl -s "$WG_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $WG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL-ID-FROM-/models",
    "messages": [{"role": "user", "content": "Summarise the Llama 3.3 licence in three bullet points."}],
    "max_tokens": 300,
    "temperature": 0.3
  }'

In Python, existing OpenAI code changes only the base URL and key:

python
import os
from openai import OpenAI

client = OpenAI(base_url=os.environ["WG_BASE_URL"], api_key=os.environ["WG_API_KEY"])
model = client.models.list().data[0].id

stream = client.chat.completions.create(
    model=model,
    messages=[{"role": "user", "content": "Write a haiku about memory bandwidth."}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="", flush=True)

That is the whole job. The rest of this guide is the Root way, for when you want a different model, quantisation, context length or engine.

Option 2: How do you run Llama yourself with vLLM?

With root access you SSH in, install vLLM, export your Hugging Face token and start vllm serve with a context length and memory setting that fit your card. vLLM then exposes an OpenAI-compatible API on port 8000.

Step 1: Connect and check the GPU

Forward port 8000 when you connect, so you can call the server from your laptop without opening it to the internet:

bash
ssh -L 8000:localhost:8000 root@<your-gpu-address>
nvidia-smi --query-gpu=name,memory.total --format=csv
df -h /root   # make sure the disk has room: 70B FP8 is ~75 GB, BF16 ~140 GB

Step 2: Install vLLM and log in to Hugging Face

bash
python3 -m venv ~/vllm-env
source ~/vllm-env/bin/activate
pip install -U pip
pip install -U vllm "huggingface_hub[cli]"

export HF_TOKEN="hf_your_read_token"          # from huggingface.co/settings/tokens
export VLLM_API_KEY="$(openssl rand -hex 24)"  # the key clients must send
echo "$VLLM_API_KEY"                            # save this somewhere safe

vLLM installs its own matching PyTorch build into the virtual environment, so it will not disturb the system PyTorch.

Step 3a: Llama 3.1 8B on an RTX 4090

bash
vllm serve meta-llama/Llama-3.1-8B-Instruct \
  --served-model-name llama-3.1-8b \
  --max-model-len 16384 \
  --gpu-memory-utilization 0.90 \
  --host 127.0.0.1 --port 8000 \
  --api-key "$VLLM_API_KEY"

On a 24 GB card, 16 GB of BF16 weights leave about 4 GB for KV cache after headroom, enough for roughly 30k tokens in total. That is why the context is capped at 16k. Add --quantization fp8 to halve the weights to about 8 GB; the 4090's Ada tensor cores run FP8 natively. That frees room for longer contexts or more concurrent users.

Step 3b: Llama 3.3 70B FP8 on one H100 or RTX PRO 6000

Use a checkpoint that is already quantised to FP8 so the download and load stay at about 70 GB:

bash
vllm serve RedHatAI/Llama-3.3-70B-Instruct-FP8-dynamic \
  --served-model-name llama-3.3-70b \
  --max-model-len 16384 \
  --gpu-memory-utilization 0.95 \
  --kv-cache-dtype fp8 \
  --host 127.0.0.1 --port 8000 \
  --api-key "$VLLM_API_KEY"

On an 80 GB H100 this leaves only a few gigabytes for KV cache, so keep --max-model-len at 8k–16k and expect a handful of concurrent long conversations. On a 96 GB RTX PRO 6000 or a 141 GB H200 the same command has far more KV room; raise --max-model-len to 32768 or more. Alternatively, vllm serve meta-llama/Llama-3.3-70B-Instruct --quantization fp8 quantises Meta's BF16 checkpoint at load time, but downloads 140 GB first.

If vLLM fails with an error saying the maximum sequence length is larger than the KV cache can hold, lower --max-model-len or raise --gpu-memory-utilization a little.

Step 3c: Llama 3.3 70B across several GPUs with tensor parallelism

Tensor parallelism splits every layer across the GPUs in one machine. With two H100s in FP8, you get about 76 GB of KV cache to share between users instead of a few:

bash
vllm serve RedHatAI/Llama-3.3-70B-Instruct-FP8-dynamic \
  --served-model-name llama-3.3-70b \
  --tensor-parallel-size 2 \
  --max-model-len 65536 \
  --gpu-memory-utilization 0.92 \
  --host 127.0.0.1 --port 8000 \
  --api-key "$VLLM_API_KEY"

For full BF16 weights, use four 80 GB cards (or two H200s with --tensor-parallel-size 2):

bash
vllm serve meta-llama/Llama-3.3-70B-Instruct \
  --tensor-parallel-size 4 \
  --max-model-len 65536 \
  --gpu-memory-utilization 0.92 \
  --host 127.0.0.1 --port 8000 \
  --api-key "$VLLM_API_KEY"

The tensor-parallel size must divide the model's attention heads, so use 2, 4 or 8. Cards connected over PCIe rather than NVLink exchange activations more slowly at every layer, so expect less than linear speed-up. If the model fits on one card at your chosen precision, two independent copies behind a load balancer usually serve more users than one copy split across two cards.

Step 4: Call the server

From your laptop (through the SSH tunnel) or on the machine itself:

bash
curl -s http://localhost:8000/v1/chat/completions \
  -H "Authorization: Bearer $VLLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "llama-3.3-70b",
       "messages": [{"role": "system", "content": "You are concise."},
                    {"role": "user", "content": "What is tensor parallelism?"}],
       "max_tokens": 200}'
python
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="YOUR_VLLM_API_KEY")
r = client.chat.completions.create(
    model="llama-3.3-70b",
    messages=[{"role": "user", "content": "Give me three test cases for a date parser."}],
    temperature=0.2,
)
print(r.choices[0].message.content)
print(r.usage)  # prompt, completion and total tokens

Step 5: Keep it running after you disconnect

The simplest way is tmux:

bash
tmux new -s llama
# run the vllm serve command, then press Ctrl+b then d to detach
tmux attach -t llama   # to come back

Or run it in the background with a log file:

bash
nohup vllm serve RedHatAI/Llama-3.3-70B-Instruct-FP8-dynamic \
  --max-model-len 16384 --gpu-memory-utilization 0.95 --kv-cache-dtype fp8 \
  --host 127.0.0.1 --port 8000 --api-key "$VLLM_API_KEY" > ~/vllm.log 2>&1 &
tail -f ~/vllm.log   # wait for "Application startup complete"

Weights are cached under ~/.cache/huggingface, so a restart on the same disk does not download them again. To put the server behind TLS with several keys, follow building your own open-source LLM API.

Option 3: How do you run Llama with Ollama?

Ollama is the fastest way for one person to chat with Llama: one install command, one pull, and it serves 4-bit GGUF weights with an OpenAI-compatible endpoint on port 11434. It does not need a Hugging Face token.

bash
curl -fsSL https://ollama.com/install.sh | sh
# If the installer could not start a service (common inside containers):
OLLAMA_CONTEXT_LENGTH=8192 ollama serve > ~/ollama.log 2>&1 &

ollama pull llama3.3:70b    # ~43 GB, 4-bit
ollama pull llama3.1:8b     # ~4.9 GB, 4-bit
ollama run llama3.3:70b "Explain grouped-query attention in one paragraph."

The same OpenAI-style call works against Ollama:

bash
curl -s http://localhost:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model": "llama3.3:70b", "messages": [{"role": "user", "content": "Hello"}]}'

On a 48 GB L40S the 43 GB 70B build fits with a short context; check ollama ps shows 100% GPU. If it shows a CPU/GPU split, the model has spilled into system RAM and will be several times slower. Ollama is built for one user at a time. For a shared endpoint, use vLLM; the vLLM vs Ollama vs TGI comparison explains why. Model tags are listed in the Ollama Llama 3.3 library page.

How fast is Llama on each GPU, and what does it cost?

Single-stream speed follows memory bandwidth; cost per token follows how many users you batch. The table uses the rule of thumb tokens/s ≈ 0.6–0.75 × bandwidth ÷ GB read per token, and our hourly prices.

SetupOur priceSingle-stream tok/s (est.)$ per M tokens, one streamAssumed batched tok/s$ per M tokens, batched
8B FP8 on RTX 4090$1.59/hr76–95$5.171,200$0.37
70B FP8 on H100$4.99/hr17–21$72.95250$5.54
70B FP8 on RTX PRO 6000$4.89/hr15–19$79.90300$4.53
70B FP8 on H200$9.09/hr41–51$54.89900$2.81
70B FP8 on 2× H100 (TP 2)2 × $4.99/hr ≈ $9.9825–35$92.41800$3.47

How to read it: cost per million = hourly price ÷ (tokens/s × 3,600 ÷ 1,000,000), using the midpoint of the speed range. Dollar figures are calculated from the live prices in the price column (two H100s cost twice the H100 price). Batched throughput is an assumption for chat traffic (about 1,000-token prompts, 300-token replies, 16–64 concurrent requests), not a measurement; it can easily be half or double. The two-H100 single-stream figure is discounted from the theoretical 34–43 tokens/s for PCIe tensor-parallel overhead. What Llama 70B costs to run goes deeper into monthly budgets.

What goes wrong, and how do you fix it?

Most failures are memory, access or context-length errors, and each has a one-flag fix.

SymptomLikely causeFix
401 or GatedRepoError on downloadLicence not accepted or no tokenAccept the licence on the model page; export HF_TOKEN=...
CUDA out of memory at loadWeights + reserved memory exceed VRAMUse FP8 or 4-bit, add GPUs with --tensor-parallel-size, or lower --gpu-memory-utilization if another process holds memory
"max seq len ... larger than the maximum number of tokens that can be stored in KV cache"Context too long for leftover VRAMLower --max-model-len, add --kv-cache-dtype fp8, or use a larger GPU
Very slow tokens with OllamaModel partly on CPUollama ps; pick a smaller tag or a bigger card
Tensor-parallel start hangsShared memory or NCCL problemCheck nvidia-smi topo -m; in Docker run with --ipc=host
Replies cut offmax_tokens too lowRaise max_tokens in the request

What comes after serving Llama?

Once it runs, most teams either fine-tune it on their own data or wrap it in a production API. Fine-tuning Llama on a cloud GPU covers LoRA and QLoRA. vLLM can serve LoRA adapters on top of the base model with --enable-lora --lora-modules name=path. For flags and supported models, the vLLM documentation is the reference.

When renting from Wandering Giants Compute fits

Wandering Giants Compute suits Llama if you want 70B running in minutes without touching a serving stack, or if you want the whole machine to run the commands above. Llama 3.3 70B FP8 is a one-click model on any 80 GB card. An H100 is $4.99/hr, the 96 GB RTX PRO 6000 is $4.89/hr and the H200 is $9.09/hr, with machines of 2, 4 or 8 of the same card for tensor parallelism. Billing is by the minute from prepaid credit, and the machine stops itself if credit runs out, so a forgotten test never runs up a bill. Your prompts go to your machine, not to a shared API.

It is not the right fit if you need serverless scale-to-zero, multi-node clusters or an SLA; providers built for those are compared in the best GPU clouds for LLM inference.

Frequently asked questions

What GPU do I need to run Llama 3.3 70B?

In FP8 it needs about 70 GB for weights plus KV cache, so one 80 GB H100 works with short contexts and an FP8 KV cache, while a 96 GB RTX PRO 6000 or 141 GB H200 gives real headroom. In BF16 it needs about 140 GB, so two or more 80 GB cards. At 4-bit it fits a 48 GB L40S for testing.

Can I run Llama 3.3 70B on an RTX 4090?

Not usefully. Even at 4-bit the weights are about 40 GB, well over the 4090's 24 GB, so most of the model would sit in system RAM and generate a token or two per second. Use the 4090 for Llama 3.1 8B and similar models.

Do I need a Hugging Face token to download Llama?

Yes for Meta's official repositories. Accept the licence on the model page, create a read token in your Hugging Face settings and export it as HF_TOKEN before starting vLLM. Ollama's library builds download without a token.

Should I use vLLM or Ollama for Llama?

Use vLLM if more than one person or process will call the model at once, because continuous batching serves many requests efficiently. Use Ollama for a single user who wants the fastest possible setup and is happy with 4-bit GGUF weights.

How fast is Llama 3.3 70B on an H100?

For one stream in FP8 on an H100 PCIe, about 17–21 tokens per second, estimated from 2.0 TB/s of memory bandwidth and 70 GB read per token. With continuous batching the total across many users is several hundred tokens per second, depending on prompt and output lengths.

Is Llama 3.3 70B better than Llama 3.1 70B?

Meta's model card reports Llama 3.3 70B Instruct matching or beating Llama 3.1 70B Instruct on most of its listed benchmarks, at the same size and memory cost. For a new 70B deployment it is the usual choice.

Wandering Giants Compute

Rent the GPU for this, by the minute.

Launch an H100 with Llama 3.3 70B FP8 already served behind an OpenAI-compatible API, or take root and run these commands yourself, 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

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.