🚀 B200 starting at $3.75/hr. The best price you'll find. DC in US West → (Access it from button on top after login).

Get Your B200 →
Start Building
Infrastructure

Fine-Tuning LLMs on GPU Cloud: A100 vs H100, QLoRA Memory Math and Cost Per Run

QLoRA fine-tuning a 70B model on a single A100 80GB costs $34–$51 and takes 24–36 hours. H100 at $2.50/hr cuts that to 8–12 hours and $20–$30. Here is the full cost math by method and model size.

Author photo
packet.ai Team
July 24, 2026

Fine-tuning an LLM on a cloud GPU costs $3–$51 per run in 2026: a 7B QLoRA job on an A100 80GB at $1.43/hr takes 2–4 hours, while a 70B QLoRA on the same card takes 24–36 hours. Switching to an H100 at $2.50/hr cuts 70B training time to 8–12 hours, with lower total cost despite the higher hourly rate.

Key takeaways

  • QLoRA reduces VRAM requirements by ~4x versus full fine-tuning: a 70B model that needs ~480 GB for full weights fits on a single A100 80GB at ~41 GB with 4-bit quantization and gradient checkpointing.
  • A100 80GB ($1.43/hr on packet.ai) wins on total cost for short jobs under 8 hours. H100 SXM ($2.50/hr) wins for jobs over 8 hours because it trains 2–3x faster, lowering the wall-clock bill on long runs.
  • Unsloth cuts training time by 2x and VRAM usage by up to 70% versus baseline Transformers on the same GPU: the single highest-ROI optimization before choosing a cloud provider.
  • Fine-tuning vs RAG is not an either/or: RAG handles factual grounding, fine-tuning handles behavioral consistency. The 2026 production pattern is a fine-tuned 8B model with RAG retrieval on top.
  • DPO and SFT both run on a single A100 80GB for 7B–13B models. RLHF and GRPO require a reward model alongside the policy model and need 2x the VRAM; plan for H100 on 70B RLHF.
  • packet.ai A100 80GB starts at $1.43/hr dedicated. H100 SXM from $2.50/hr. No minimum commitment on either.

Fine-tuning an LLM means adapting a pretrained model to a specific task using your own data. In 2026, parameter-efficient methods like LoRA and QLoRA have made this viable on a single cloud GPU for models up to 70B. This guide covers which GPU to pick, how much memory each method actually uses, what each run costs on packet.ai, and when upgrading from A100 to H100 reduces your total bill rather than increasing it.

For the full picture of which models fit which GPU at FP16 inference, the packet.ai VRAM requirements guide maps every major model to a minimum GPU and hourly rate.

Fine-Tuning an LLM vs RAG vs Prompting: When Each Approach Wins

Most teams reach for fine-tuning the LLM when they should be writing a better system prompt. The wrong choice wastes GPU hours and produces no measurable improvement. Fine-tuning is the correct answer for exactly three situations: you need behavioral consistency at scale (the model must always output a specific JSON schema), you need domain vocabulary the base model does not use correctly, or you are compressing a large model's capabilities into a smaller one for cost at inference time.

RAG is the correct answer when your problem is factual: the model does not know your product documentation, pricing, or case history. Fine-tuning does not reliably inject facts into weights. When the policy changes, you would need to retrain. RAG handles this without retraining.

Fine-tune when

  • Output schema must be exact and consistent at scale
  • Brand voice or domain vocabulary the base model gets wrong
  • Task has a verifiable correct answer (code, math, classification)
  • Distilling a 70B into a faster 8B for the same narrow task
  • Latency or inference cost makes large-model APIs prohibitive

Use RAG instead when

  • The knowledge changes frequently (pricing, docs, policies)
  • You have fewer than 500 high-quality training examples
  • The base model already behaves correctly and you just need more context
  • You cannot evaluate the fine-tuned model against a held-out set
  • Your task is open-ended Q&A with no fixed output structure

The 2026 production pattern that minimises both GPU cost and output quality risk: fine-tune a 7B-8B open-weight model on behavior and format, then add RAG retrieval for factual grounding at inference time. The fine-tuned 8B with RAG consistently outperforms a general-purpose 70B on narrow tasks while costing roughly 10x less to serve.

LoRA vs QLoRA vs Full Fine-Tuning: GPU Memory Math by Method

LoRA (Low-Rank Adaptation) freezes the base model weights and trains small low-rank adapter matrices. The adapter represents roughly 0.1–1% of total parameters, which means gradients and optimizer states apply only to the adapter, not the full model. QLoRA takes this further: the frozen base model is loaded in 4-bit NF4 quantization, reducing its memory footprint by ~4x, while the LoRA adapters are trained in BF16. The combination makes 70B fine-tuning viable on a single 80 GB GPU.

MethodHow it worksVRAM vs full FTQuality vs full FTBest for
Full fine-tuningAll weights updated in FP16Baseline (100%)HighestLarge budget, max quality
LoRAAdapter matrices only, FP16 base~20–30% of fullWithin 1–3% of fullSingle-task, A100 available
QLoRAAdapter in BF16, 4-bit NF4 base~5–8% of fullWithin 3–5% of fullDefault for most teams in 2026
SFT / DPOSupervised / preference tuning on top of LoRA/QLoRASame as base methodTask-dependentInstruction following, alignment

QLoRA on a 70B model with 4-bit quantization and gradient checkpointing uses approximately 41 GB of VRAM, confirmed by Unsloth benchmarks on Llama 3 70B. That is the difference between needing a $300K 8-GPU cluster for full fine-tuning and a single A100 80GB at $1.43/hr for a QLoRA run.

Model sizeFull FT VRAMLoRA VRAMQLoRA VRAMMin GPU
7B~60 GB~14 GB~6 GBRTX 4090 / L40S
13B~120 GB~26 GB~14 GBL40S / A100
34B~320 GB~68 GB~30 GBA100 80GB
70B~480 GB~160 GB~41 GBA100 80GB / H100
405BMulti-node onlyMulti-node only~200 GB+3+ H100 80GB

Note on gradient checkpointing

VRAM figures above assume gradient checkpointing enabled. Without it, add 20–40% to the QLoRA column. Always enable gradient checkpointing on A100 for 34B+ models; it reduces VRAM at the cost of ~15% extra training time, which is a worthwhile trade.

A100 80GB vs H100 80GB for Fine-Tuning: Speed, Cost Per Run and When to Upgrade

The A100 vs H100 decision for fine-tuning is a total cost calculation, not an hourly rate comparison. The H100 SXM is roughly 2–3x faster than the A100 SXM on transformer training workloads due to its Transformer Engine, FP8 support, and 3.35 TB/s HBM3 bandwidth versus the A100's 2.0 TB/s HBM2e. At $2.50/hr versus $1.43/hr, the H100 costs 75% more per hour. The crossover is at 8–10 hours of training time.

For Llama 3.1 70B QLoRA on a single GPU: the A100 80GB takes 24–36 hours ($34–$51 total at $1.43/hr). The H100 completes the same job in 8–12 hours ($20–$30 at $2.50/hr). The H100 is cheaper on total cost, faster to iterate, and frees the GPU sooner for the next experiment.

Total cost per fine-tuning run. QLoRA, packet.ai pricing July 2026

Llama 3.1 7B QLoRA (2–4 hr)

A100 80GB
$2.86–$5.72
H100 SXM
$2.50–$5.00

Llama 3.1 13B QLoRA (4–8 hr)

A100 80GB
$5.72–$11.44
H100 SXM
$5.00–$7.50

Llama 3.1 70B QLoRA (single GPU)

A100 80GB
$34–$51
H100 SXM
$20–$30

packet.ai: A100 80GB $1.43/hr, H100 SXM $2.50/hr. Times estimated with Unsloth enabled. Source: computecomparison.com, Spheron benchmarks July 2026.

On a single GPU, the A100 80GB at $1.43/hr on packet.ai beats the H100 on total cost only for short jobs: QLoRA on 7B–13B models that finish in under 6 hours. For 34B and 70B, or any multi-epoch run, the H100's speed advantage flips the economics. The full comparison of A100 and H100 architecture, bandwidth, and production workload benchmarks is in the packet.ai A100 vs H100 deep dive.

WorkloadA100 80GB
$1.43/hr
H100 SXM
$2.50/hr
Cheaper total
7B QLoRA SFT (50K samples)2–4 hr · $2.86–$5.721–2 hr · $2.50–$5.00Roughly equal
13B QLoRA SFT4–8 hr · $5.72–$11.442–3 hr · $5.00–$7.50A100 (marginally)
34B QLoRA SFT12–18 hr · $17–$265–7 hr · $12.50–$17.50H100
70B QLoRA SFT24–36 hr · $34–$518–12 hr · $20–$30H100
70B QLoRA DPO36–48 hr · $51–$6912–16 hr · $30–$40H100

Fine-Tuning Llama 4, Llama 3.1 and Qwen: VRAM by Model and Method

Llama 4 Scout (109B total parameters, 17B active per token as a Mixture-of-Experts model) loads all 109B weights at startup, not just the 17B active experts. QLoRA VRAM for Llama 4 Scout is approximately 55–65 GB, which fits an A100 80GB only with aggressive gradient checkpointing and a batch size of 1. Llama 4 Maverick (400B+ MoE) requires multi-GPU. For teams running Llama 4 fine-tuning, plan for H100 with at least 80 GB. See the Llama GPU sizing guide for the full parameter-to-VRAM breakdown across the Llama 3 and Llama 4 families.

ModelQLoRA VRAMFits single A100?Recommended GPUEst. cost/run
Llama 3.1 8B~6 GBYes (any)A100 80GB$3–$6
Llama 3.1 70B~41 GBYes (tight)H100 SXM$20–$30
Llama 4 Scout (109B MoE)~60 GBTight (bs=1 only)H100 SXM$30–$50
Qwen 2.5 7B~6 GBYesA100 80GB$3–$6
Qwen 2.5 72B~42 GBYes (tight)H100 SXM$20–$30
Llama 3.1 405B~200 GB+No (3+ H100 needed)H100 cluster$150+

Unsloth, Axolotl and TRL: Which Training Framework Runs Fastest on Cloud GPUs

Framework choice affects training speed as much as GPU choice on the same hardware. Unsloth rewrites CUDA kernels for attention and gradient computation: on an A100 80GB it delivers 2x the throughput of baseline Transformers/PEFT and reduces VRAM usage by up to 70%, confirmed by the Unsloth project benchmarks across Llama, Mistral, and Qwen models. For single-GPU QLoRA jobs on cloud A100 or H100, Unsloth is the default starting point in 2026.

FrameworkSpeed vs baselineMulti-GPU supportDPO / GRPOBest for
Unsloth2x faster, 70% less VRAMSingle-GPU onlyYes (via TRL)Single GPU QLoRA SFT/DPO
Axolotl~1.3x vs baselineYes (FSDP, DeepSpeed)YesMulti-GPU YAML pipelines
TRLBaselineYesYes (all objectives)Research, custom objectives
LLaMA-Factory~1.2x vs baselineYesYesWeb UI, many model families

Axolotl is the correct choice when you move beyond a single GPU. It handles FSDP2 and DeepSpeed ZeRO-3 via a YAML config file, making distributed fine-tuning on 2–8 H100s manageable without custom training loop code. For 70B models requiring multiple GPUs, or for teams running weekly fine-tuning pipelines in production, Axolotl on an H100 cluster on packet.ai is the standard configuration.

What Fine-Tuning Costs on packet.ai: Real Prices by GPU and Job Type

packet.ai A100 80GB dedicated starts at $1.43/hr. H100 SXM from $2.50/hr. No minimum commitment on either: spin up for a 4-hour QLoRA run and stop. The table below shows total job cost at packet.ai rates for the most common fine-tuning configurations in 2026.

JobGPUTime (Unsloth)Total costvs managed API
7B QLoRA SFT (50K samples)A100 80GB2–4 hr$3–$6Together AI: ~$23
13B QLoRA SFTA100 80GB4–8 hr$6–$11Fireworks: ~$38
34B QLoRA SFTA100 80GB12–18 hr$17–$26Not offered
70B QLoRA SFT (single GPU)H100 SXM8–12 hr$20–$30Not offered
70B QLoRA DPOH100 SXM12–16 hr$30–$40Not offered

Managed API costs based on Together AI ($0.30/1M tokens for 7B, $1.20/1M for 70B) and Fireworks ($0.50/1M) at 76.8M training tokens (50K samples x 512 tokens x 3 epochs). DIY on packet.ai GPU is 3–8x cheaper than managed fine-tuning APIs for equivalent dataset sizes, with no per-token billing ceiling.

The packet.ai dedicated GPU cloud gives single-tenant access to the full GPU with no noisy-neighbour interference during a training run and no scheduler preemption mid-epoch. For multi-day fine-tuning pipelines or weekly retraining schedules, dedicated pricing reduces total cost versus on-demand billing.

Frequently asked questions

For 7B–13B QLoRA jobs, the A100 80GB at $1.43/hr on packet.ai is the lowest total cost option at $3–$11 per run. For 34B–70B QLoRA, the H100 SXM at $2.50/hr finishes 2–3x faster and costs less total despite the higher hourly rate: $20–$30 for a 70B run versus $34–$51 on the A100.
QLoRA with gradient checkpointing enabled requires approximately 41 GB for a 70B model. This fits on a single A100 80GB or H100 80GB. Without gradient checkpointing, add 20–40%. Full fine-tuning a 70B requires approximately 480 GB, meaning 6–8 H100 80GB GPUs with tensor parallelism.
LoRA trains low-rank adapter matrices on top of a full-precision (FP16/BF16) base model. QLoRA loads that same base model in 4-bit NF4 quantization, reducing VRAM by ~4x. The adapters are still trained in BF16. Quality is within 3–5% of full fine-tuning in most benchmarks. QLoRA is the default for single-GPU fine-tuning in 2026 because it makes 70B models trainable on a single 80 GB GPU.
Yes, for jobs over 8 hours. The H100 trains 2–3x faster than the A100, so despite costing 75% more per hour ($2.50 vs $1.43), total run cost is lower for 34B and 70B QLoRA jobs. A 70B QLoRA on the A100 costs $34–$51; on the H100 it costs $20–$30. For 7B–13B models with short run times, the A100 wins on total cost.
Use RAG when your problem is factual knowledge that changes: pricing, documentation, case history. Use fine-tuning when your problem is behavioral: the model uses wrong tone, incorrect output schema, or wrong domain vocabulary. The production pattern in 2026: fine-tune on behavior, add RAG for facts. The two are complementary, not competing.
For instruction following and tone: 500–2,000 high-quality curated examples reliably beat 50,000 noisy ones. For domain adaptation with QLoRA: 5,000–20,000 examples in the target distribution. For DPO preference tuning: 1,000–5,000 ranked pairs. Quality and formatting consistency matter far more than raw count.
Llama 4 Scout (109B MoE, 17B active) requires approximately 60 GB of VRAM for QLoRA at batch size 1. It fits on a single H100 80GB but not an A100 80GB comfortably. Llama 4 Maverick (400B+ MoE) requires multiple H100s. For Scout fine-tuning, the H100 SXM at $2.50/hr on packet.ai is the minimum single-GPU configuration.

Last reviewed: 23 July 2026. Fine-tune on A100 80GB from $1.43/hr or H100 SXM from $2.50/hr on packet.ai, no minimum commitment, SSH-ready in under 5 minutes.

Waste less compute.

Same models. Same API. Fraction of the cost. Start free — no credit card required.

Start Building →

More from the blog