Skip to content

Cost reference

What it costs to fine-tune Llama 3.1 8B

The cheapest setup we compared is LoRA on one L40S: about $0.067 per million training tokens, so $0.67 for 10 million and $6.72 for 100 million. Full fine-tuning costs about $1.01 per 10 million tokens on 4 × L40S.

By Will Schulz · Checked 15 November 2026 · Prices as of November 2026

GPU-hours and cost by GPU and method

Per epoch over the token count shown; multiply by your number of epochs. GPU-hours are the same however many GPUs the job is split over.

GPU · methodGPUs for memoryTokens/s per GPUGPU-hours per 1M1.0M tokens10M tokens100M tokens
H100 SXM · LoRA$4.39/hr112,3160.02$0.099$0.99$9.90
H100 SXM · QLoRA$4.39/hr19,6070.03$0.13$1.27$12.69
H100 SXM · Full fine-tuning$4.39/hr28,2110.03$0.15$1.49$14.85
B200 · LoRA$7.99/hr128,0200.01$0.079$0.79$7.92
B200 · QLoRA$7.99/hr121,8560.01$0.10$1.02$10.16
B200 · Full fine-tuning$7.99/hr118,6800.01$0.12$1.19$11.88
L40S · LoRA$1.09/hr14,5080.06$0.067$0.67$6.72
L40S · QLoRA$1.09/hr13,5160.08$0.086$0.86$8.61
L40S · Full fine-tuning$1.09/hr43,0050.09$0.10$1.01$10.07
RTX 5090 · LoRA$1.39/hr12,6090.11$0.15$1.48$14.80
RTX 5090 · QLoRA$1.39/hr12,0350.14$0.19$1.90$18.97
RTX 5090 · Full fine-tuning$1.39/hrDoesn't fit1,7390.16———

Compared with fine-tuning APIs

OptionPer 1M tokens10M tokens100M tokens
Rented GPU: LoRA on L40S (our estimate)$0.067$0.67$6.72
Together AI, Llama 3.1 8B LoRA$0.34$3.40$34.00
Together AI, Llama 3.1 8B full fine-tuning$0.38$3.80$38.00
OpenAI gpt-4.1-mini fine-tuning (closed model; closed to new users)$5.00$50.00$500

API prices are per training token processed (dataset tokens × epochs), seen on 15 November 2026. Together AI charges a minimum per job ($4 for this model). OpenAI's pricing page says fine-tuning is closed to new users. Rented GPU estimates leave out setup, failed runs and idle time, which an API absorbs.

Your run

Pre-filled for Llama 3.1 8B: 10M tokens, 3 epochs, LoRA on an H100.

Estimated cost

$2.97

H100 SXM-hours

0.68

Time on 1 GPU

41 minutes

Tokens per second per GPU

12,316

30M tokens processed. Fits on one H100 SXM at 2,048-token sequences. GPU-hours assume perfect scaling across GPUs.

Assumptions

  • Compute per token: 6 FLOPs per active parameter for full fine-tuning (forward plus backward) and about 4 for LoRA and QLoRA, which skip the frozen weights' gradients. Llama 3.1 8B uses 8.03B parameters per token.
  • Utilisation: 40% of each GPU's dense BF16 peak. torchtune measured 3,083 tokens a second for Llama 3.1 8B LoRA on one RTX 4090, about 60% on the same accounting, so well-tuned code can beat these figures.
  • QLoRA runs at 78% of LoRA's speed, the ratio torchtune measured (2,413 vs 3,083 tokens a second), because the 4-bit weights are dequantised on the fly.
  • Memory decides the GPU count, from our Llama 3.1 8B VRAM estimates at 2,048-token sequences. Consumer cards are counted as single GPUs only.
  • Prices: on-demand Runpod Secure Cloud rates (page dated 12 November 2026). Community Cloud and spot capacity cost less.

Frequently asked questions

How much does it cost to fine-tune Llama 3.1 8B?
About $0.067 per million training tokens at the cheapest setting we compared (LoRA on one L40S, $1.09/hour per GPU), so about $0.67 for 10M tokens and $6.72 for 100M. Budget for several runs: the first rarely wins.
How long does it take to fine-tune Llama 3.1 8B on an H100?
LoRA processes about 12,316 tokens a second on one H100 at 40% utilisation, so 10M tokens take about 14 minutes. Full fine-tuning needs 2 H100s for memory and about 1.5× the compute.
Is it cheaper to fine-tune Llama 3.1 8B through an API?
Together AI listed Llama 3.1 8B LoRA fine-tuning at $0.34 per million tokens (minimum $4 per job) in November 2026, about $3.40 for 10M tokens, against roughly $0.67 of rented GPU time by our estimate. The API includes the setup, retries and idle time a rented GPU doesn't.
Should I use LoRA or full fine-tuning for Llama 3.1 8B?
Start with LoRA or QLoRA. Full fine-tuning Llama 3.1 8B needs about 132 GB, so 2 × 80 GB GPUs with sharded optimiser state, and about 1.5× the compute per token. LoRA usually gets close for format, style and task adaptation; move to full fine-tuning only when evaluation shows LoRA has plateaued.

Sources

  1. [1]Hugging Face. meta-llama/Llama-3.1-8B-Instruct config.json
  2. [2]Meta. meta-llama/Llama-3.1-8B-Instruct model card
  3. [3]Meta. The Llama 3 Herd of Models (arXiv:2407.21783)
  4. [4]Hu et al., 2021. LoRA: Low-Rank Adaptation of Large Language Models (arXiv:2106.09685)
  5. [5]Dettmers et al., 2023. QLoRA: Efficient Finetuning of Quantized LLMs (arXiv:2305.14314)
  6. [6]Kaplan et al., 2020. Scaling Laws for Neural Language Models (arXiv:2001.08361)
  7. [7]PyTorch. torchtune: memory and throughput benchmarks (Llama 3.1 8B on RTX 4090)
  8. [8]Together AI. Fine-tuning pricing (seen 15 November 2026)
  9. [9]OpenAI. API pricing: fine-tuning (seen 15 November 2026)
  10. [10]Runpod. GPU pricing (updated 12 November 2026)

Fine-tune Llama 3.1 8B without renting the GPU yourself.

Kojen trains LoRA adapters on Llama 3.1 8B from your input/expected rows on the cheapest GPU in stock across Modal, Runpod, Vast.ai and Lambda, billed by the second in GPU credits.

Start training free