Fine-Tuning AI Models in 2026: Services, Tools and Costs
Fine-tuning improves consistency for a defined task, format or behavior. It does not create a live knowledge base. In 2026, the decision also depends on service availability, endpoint commitments, GPU memory and model licenses.
Choose fine-tuning, prompting or RAG
Prompting is the cheapest first test when instructions change often. A system message and examples can impose a format without creating a training job, model artifact or tuned endpoint. Prompting also permits immediate updates.
Retrieval augmented generation, or RAG, fits changing documents, records and policies. Retrieval supplies current material at request time and can preserve document references. Fine-tuning is a poor storage layer for a catalog or policy set that changes regularly.
Fine-tuning is useful when the same behavior recurs across many requests:
- Fixed JSON or XML output.
- Classification or routing.
- A repeatable house style.
- Tool selection and argument formatting.
- A narrow task where examples outperform prompts.
The methods can work together. RAG can supply current passages while a tuned model learns how to classify, cite or format them. Begin with a prompt baseline and a held-out test set. Training adds little value when the baseline already meets the target.
Hosted services and current prices
Hosted training removes most GPU setup, but the training line is only part of the bill. Count tokens, epochs, validation, grader calls, inference, storage and endpoint time.
| Product | Price | Best for | Limits |
|---|---|---|---|
| OpenAI SFT | $1.50-$25 per 1M training tokens | OpenAI workflows | Closed to new users; retirements apply |
| Gemini 3.5 Flash-Lite SFT | $0.003 per 1,000 tokens | Gemini tuning | Model and region support varies |
| Amazon Bedrock Llama 2 13B | $1.49 per 1M tokens | AWS customization | Storage and Provisioned Throughput apply |
| Microsoft Foundry o4-mini RFT | $100 per core hour | Reinforcement tuning | Hosting and tier rules differ |
| Together AI | Model-specific token rates | SFT, DPO and LoRA | Use the selected-job estimator |
| Fireworks AI | Model-specific token meters | Managed post-training | LoRA needs dedicated GPU deployment |
OpenAI lists GPT-4.1 SFT at $25 per million training tokens, GPT-4.1 mini at $5 and nano at $1.50. Inference is separate. Its o4-mini reinforcement fine-tuning price is $100 per core training hour, with grader tokens billed separately. The platform is closed to new users. Eligible existing users can train until January 6, 2027. The listed o4-mini and nano snapshots retire October 23, 2026; GPT-4.1 and mini versions retire January 14, 2027.
Google's Gemini Enterprise Agent Platform, including Vertex AI tuning APIs, lists Gemini 3.5 Flash-Lite SFT at $0.003 per 1,000 tokens and Gemini 3.5 Flash at $0.01. Gemini 2.5 Pro SFT is $0.025 per 1,000. Training uses dataset tokens multiplied by epochs. Gemini 3 tuned endpoint prediction costs 1.5 times the base price.
Bedrock charges processed training tokens and monthly custom-model storage. Customized inference generally requires Provisioned Throughput. Microsoft Foundry, formerly Azure AI Foundry, bills SFT and DPO by training tokens multiplied by epochs. RFT adds training time and grader tokens. Standard or Global Standard deployment adds hosting, while Developer deployment is evaluation-only and removed after 24 hours.
Mistral's official fine-tuning page is deprecated and no longer actively supported. Its old $4 minimum job fee and $2 monthly storage charge are historical service details, not a current catalog. Together and Fireworks use model-specific meters, so calculate the selected configuration rather than applying a universal rate.
Open-source tools and adapters
Open-source training gives control over files, data and deployment. It also assigns responsibility for CUDA, checkpoints, evaluation, storage and licensing.
Hugging Face TRL supports PEFT adapters across its trainers. Its QLoRA guidance combines LoRA with 4-bit bitsandbytes quantization, recommends NF4 and bf16 compute, and describes double quantization as saving about 0.4 bits per parameter. LoRA keeps base weights frozen and trains smaller adapters.
Unsloth recommends QLoRA as a starting point for many beginners. Its model-specific guidance says a Qwen3-30B-A3B workload can fit in about 30 GB of VRAM, while another 30B QLoRA example needs about a 40 GB A100. These figures depend on context, batch size and conversion requirements.
Axolotl offers configuration-driven training and publishes estimates for short contexts and micro-batches of one or two. Its QLoRA estimates are 6-8 GB for 1B-3B, 10-14 GB for 7B-8B, 16-20 GB for 13B-14B, 24-32 GB for 30B-34B, and 40-48 GB for 70B-72B. Longer sequences raise activation memory. Gradient checkpointing lowers memory with a reported speed cost of about 30 percent.
LLaMA-Factory supports SFT, DPO and related methods. Its guidance warns against merging an adapter into a quantized base. Merge with the matching unquantized model, then quantize, using calibration data where required. Torchtune's QLoRA tutorial reports a Llama 2 7B example under 10 GB on one GPU.
GPU memory and rental costs
Weight arithmetic is only a starting point. Sixteen-bit weights use about 2 bytes per parameter, or roughly 14 GB for 7B and 140 GB for 70B before runtime overhead. Four-bit storage uses about 0.5 bytes per parameter, but metadata, activations, gradients, optimizer state, KV cache and CUDA workspace add memory.
A 7B QLoRA estimate of 10-14 GB assumes short contexts and small micro-batches. It is not a promise that every 7B run fits on a 12 GB card, nor that every 70B run fits on 48 GB. Measure a small run with the intended sequence length and batch size.
Listed H100 prices show why cloud comparison needs care. Lambda lists H100 SXM at $3.99 per GPU-hour and H100 PCIe at $3.29 on a one-GPU tier. RunPod lists H100 PCIe at $1.99 Community and $2.89 Secure, with H100 SXM at $2.69 and $3.99. Modal lists H100 SXM5 at $3.9492 per hour before CPU and RAM, and bills load time plus a default 60-second idle period.
A GPU-only price is not a complete machine price. Add CPU, RAM, disk, transfer and idle time. Start with a small dataset, verify that the run works, measure tokens per second, and estimate the full job from that measurement.
Dataset design and evaluation
Dataset coverage matters more than a universal example count. No authoritative minimum applies to every task. Include production formats, difficult cases, minority classes and confusing neighbors.
Keep evaluation data separate. Hugging Face guidance describes a 90/10 train/test example and says retaining 10 to 30 percent for evaluation can be reasonable, depending on dataset size. The test set should resemble production and avoid near-duplicates of training records.
Use the final interaction format in each record. Remove duplicates, repair malformed outputs and validate structured responses before scoring them. A useful evaluation set includes ordinary cases, edge cases and safety or refusal cases where relevant.
Check three signals:
- Training loss, to confirm learning.
- Validation metrics, to detect generalization problems.
- Held-out outputs, to catch fluent errors.
Hugging Face recommends smoke-testing with small training and evaluation samples before a long run. Its examples use 50 records for each test sample. Start with one to three epochs and monitor validation. Rising validation loss alongside falling training loss can indicate overfitting.
Compare prompting, RAG and tuning on the same fixed test set. Report metrics, sample counts, failure categories, training cost and inference cost. A single quality score hides the failures that determine production risk.
Model licenses and distribution
License terms vary by checkpoint and version. Read the exact repository license, acceptable-use rules, attribution requirements and distribution conditions before shipping a derivative.
Meta's Llama 3.1 uses the Llama Community License, not Apache-2.0. Customization and fine-tuning are permitted subject to that license and acceptable-use terms. Gemma versions also differ. Google describes Gemma 2 under Gemma terms, while its Gemma 4 announcement says Gemma 4 is Apache 2.0.
Qwen has exceptions by size and release. Qwen2.5 lists many sizes under Apache-2.0, while Qwen2.5-3B uses Qwen Research terms and Qwen2.5-72B uses Qwen License. Do not infer a license from the Qwen brand.
Mistral likewise has Apache-2.0 releases and modified-MIT releases. Its model overview identifies Mistral Medium 3.5 as modified MIT and lists Mistral Small 4, Mistral Large 3 and Ministral 3 as Apache 2.0. Some modified-MIT terms include a $20 million monthly-revenue commercial-license or Studio condition.
A tuned adapter can inherit restrictions from the base model. Check commercial use, redistribution, branding, acceptable use and hosted-service terms before publishing weights or an endpoint.
A practical purchasing workflow
Write the failure that training must fix. Stale knowledge points to RAG. Inconsistent formatting or task behavior points to a tuning experiment. If prompting meets the target at acceptable cost, stop there.
Choose hosted training when managed operations matter and the model, region, price and endpoint terms fit. Choose open-source training when data control, model ownership or deployment flexibility justify GPU operations. Start with LoRA, then use QLoRA when memory is the constraint and quality remains acceptable.
Freeze validation and test sets. Measure the prompt baseline, train one adapter, compare failure categories, and record training and serving costs. Do not merge or quantize before evaluating the unmerged adapter.
Recommendations by reader type
- Solo developer: Start with prompting, then try TRL or Unsloth QLoRA on a 7B or smaller model. Use workload-specific memory estimates.
- Startup with private documents: Use RAG with a hosted model. Tune response format or routing only when prompts are inconsistent.
- Enterprise buyer: Compare Gemini Enterprise Agent Platform, Bedrock and Microsoft Foundry by region, storage, residency, endpoint commitment and retirement dates.
- Open-source team: Compare Axolotl, LLaMA-Factory and torchtune. Record the exact checkpoint license and merge procedure.
- High-volume API team: Price training and inference together. Endpoint hosting can exceed a small training bill.
- Research team: Use a smoke test, fixed held-out data and a reproducible configuration before renting a larger GPU.
Frequently asked questions
When should I fine-tune an AI model instead of using RAG?
Fine-tune for repeatable behavior such as classification, structured output, tone or tool-call formatting. Use RAG for changing knowledge in documents or records. They can work together: RAG supplies current passages, while fine-tuning teaches the model how to classify, format or cite them.
How much GPU memory does QLoRA need for a 7B model?
Axolotl estimates 10-14 GB for QLoRA on a 7B-8B model with 512-2,048-token contexts and micro-batches of one or two. Longer sequences, larger batches and implementation details raise usage. An older TRL example tested 7B QLoRA on a 16 GB T4.
What does OpenAI fine-tuning cost in 2026?
OpenAI lists SFT at $25 per million training tokens for GPT-4.1, $5 for GPT-4.1 mini and $1.50 for GPT-4.1 nano. Inference is separate. RFT for o4-mini-2025-04-16 is $100 per core training hour, with grader-token charges added. New users cannot access the platform.
Is Mistral fine-tuning still available?
Mistral's official fine-tuning page is deprecated and no longer actively supported. It lists a $4 minimum job fee and $2 monthly storage charge for the old service, but no current model-specific training catalog. Treat those figures as historical, and price current inference separately.
How much data is needed for fine-tuning?
There is no universal minimum. Build records that cover production behavior, difficult cases and output formats, then reserve evaluation data. Hugging Face guidance describes retaining 10-30 percent for evaluation and recommends small smoke tests before a longer run. Coverage and quality matter more than a raw example count.
Are Llama, Gemma, Qwen and Mistral models Apache-2.0?
No. Llama 3.1 uses the Llama Community License. Gemma terms vary by version, and Google says Gemma 4 is Apache 2.0. Qwen has Apache-2.0 releases and exceptions. Mistral has Apache-2.0 and modified-MIT models. Check the exact repository before distribution. Review distribution conditions too.
Sources
- OpenAI API pricing; Availability and shutdowns: https://developers.openai.com/api/docs/guides/supervised-fine-tuning
- OpenAI RFT billing
- Google tuning pricing
- Amazon Bedrock pricing
- Microsoft Foundry costs
- Together AI pricing; Mistral service status: https://docs.mistral.ai/resources/deprecated/finetuning
- Fireworks training
- Hugging Face TRL PEFT; Unsloth: https://docs.unsloth.ai/get-started/fine-tuning-for-beginners/faq-+-is-fine-tuning-right-for-me; LLaMA-Factory: https://llamafactory.readthedocs.io/en/latest/getting_started/merge_lora.html; LLaMA-Factory algorithms: https://llamafactory.readthedocs.io/en/latest/advanced/tuning_algorithms.html
- Axolotl method comparison; Evaluation splits: https://huggingface.co/docs/evaluate/en/considerations; Training guidance: https://huggingface.co/docs/transformers/training
- torchtune QLoRA tutorial
- GPU rental pricing; Lambda pricing: https://lambda.ai/pricing; Modal pricing: https://modal.com/pricing
- Model license references; Gemma 4 license: https://developers.googleblog.com/bring-state-of-the-art-agentic-skills-to-the-edge-with-gemma-4/; Gemma 2 terms: https://developers.googleblog.com/en/smaller-safer-more-transparent-advancing-responsible-ai-with-gemma/; Qwen licenses: https://qwenlm.github.io/blog/qwen2.5-llm/; Mistral licenses: https://help.mistral.ai/en/articles/347393-under-which-license-are-mistral-s-open-models-available