AI fine-tuning service: domain models that truly understand your data

Generic LLMs are powerful, but they rarely deliver output that is right for your organisation in terms of tone of voice, specialist jargon or structured output. We fine-tune open-source models (Llama, Mistral, Qwen, Gemma) and hosted models on your own instruction data, so that a smaller, cheaper model in production outperforms an expensive general-purpose API. From dataset curation and supervised fine-tuning to DPO, evaluation and deployment on vLLM or Inferentia.

Supervised fine-tuning LoRA / QLoRA DPO Continued pretraining Evaluation & guardrails vLLM deployment
Discuss your fine-tuning case To fine-tune or not?
Base model Llama-3.1-8B + instructie-data SFT / LoRA + preferenties DPO / RLHF Fine-tuned model eval pass@1 87% cost / 1k tok -72% vLLM TGI GGUF

When to fine-tune, when to use RAG, when prompting alone is enough

The biggest mistake in AI projects in 2024 and 2025: fine-tuning because you can, when a better prompt or a retrieval-augmented setup would deliver more. Fine-tuning is expensive, requires re-curated data and has to be redone with every base-model update. That is why we start every project with a sober decision tree.

Fine-tuning is the right choice when you want to transfer patterns that do not fit in a prompt: a writing style, a specific output structure, specialist jargon, or a reasoning chain that the base model does not produce on its own. For example, a publisher who wants summaries to follow the house style exactly, or a legal team that wants memos drafted to a fixed structure. Prompting stays endlessly brittle there, whereas a few thousand curated examples in an SFT set solve the problem permanently.

RAG (retrieval-augmented generation) is the right choice when you want to add knowledge that changes regularly: product catalogues, documentation, policy texts, customer files. A fine-tuned model that has "learned" facts goes out of date; a RAG pipeline that retrieves the same facts from your own knowledge base stays current. In practice we combine the two: a model fine-tuned on your writing style and output format, fed by RAG for the up-to-date content. You will see this pattern in custom LLM integrations and in AI document processing.

SituationApproachWhy
Fixed output structure or JSON schemaSupervised fine-tuning (SFT)A few hundred golden samples deliver tighter structured output than any prompt can.
Industry jargon and domain reasoningContinued pretraining + SFTFirst train unsupervised on a domain corpus, then instruction-tune for task behaviour.
Tone of voice or house styleSFT with paired examplesStyle is a pattern, not facts — fine-tuning bakes it in.
Preferred behaviour between two good answersDPO (Direct Preference Optimization)Cheaper and more stable than classic RLHF, with no reward model needed.
Up-to-date facts or frequently changing contentRAG (no fine-tuning)Fine-tuned facts go stale; retrieval stays live.
One-off task, <100 examplesFew-shot promptingFine-tuning only pays off from roughly 500-1,000 high-quality samples.

Methods we use

Fine-tuning isn't a monolith. Which technique fits depends on your budget, dataset size, hosting requirements and the kind of behaviour you want to transfer.

SFT

Supervised fine-tuning

The workhorse technique. We train the model on paired input-output examples — your instruction data. Suited to structured output, task execution, format compliance and style transfer. Works on virtually any model scale from 1B to 70B parameters.

LoRA

LoRA and QLoRA

Parameter-efficient fine-tuning in which we train small adapter matrices instead of the whole model. QLoRA adds 4-bit quantisation, allowing us to tune 70B models on a single H100 or even a 24GB consumer GPU. Dramatically cheaper than full fine-tuning, and the adapters are small enough to store separately per customer or task.

DPO

Direct Preference Optimization

An alignment technique for situations where two correct answers exist and you want one preferred over the other. We use DPO as the successor to classic RLHF — no separate reward model, no unstable PPO runs, just direct preference data. Suited to tone, politeness, refusal behaviour and hallucination suppression.

CPT

Continued pretraining

For extremely domain-specific language — medical literature, legal case law, technical standards — we continue training the model on an unlabelled corpus before instruction-tuning. This gives us a base model that understands the vocabulary and reasoning style of your domain. It requires more GPU time but delivers a fundamentally more capable starting point.

PEFT

Adapters and PEFT variants

Besides LoRA, there are adapters, prefix-tuning, IA3 and prompt-tuning. We choose the PEFT method based on model architecture, the amount of training data and deployment requirements. For multi-tenant deployments, adapters are particularly powerful: one base model in memory, with a dedicated adapter loaded on the fly for each customer.

RLHF

RLHF when needed

Reinforcement learning from human feedback remains relevant for projects where continuous feedback from end users needs to steer model behaviour. We use it selectively — usually only in phase 3 of an engagement, after SFT and DPO — because the cost and complexity are considerable. For most use cases, DPO is the better cost-benefit choice.

Dataset preparation: where 80% of the work lies

A fine-tuned model is only as good as its training data. In every engagement we spend most of our time compiling, cleaning and validating the instruction set. A few thousand carefully curated examples consistently deliver better results than tens of thousands of raw records.

We work with the concept of "golden samples": a core collection of a few hundred examples that demonstrate exactly the desired behaviour. Around that, we build synthetic extensions through paraphrasing, back-translation and model-assisted generation, with spot checks by domain experts. For instruction tuning, we use Alpaca-, ShareGPT- or OpenAssistant-style JSONL formats, depending on the target architecture.

Catastrophic forgetting is a real risk: a model that is fine-tuned too narrowly loses general capabilities. We mitigate this by mixing a fraction of generic data into SFT (for example 5-10% of a Tulu or FLAN mix) and by evaluating along the way on a held-out general-purpose benchmark. For preference data (DPO), we use paired samples where human annotators or a stronger reference model choose between two candidate answers.

For clients with sensitive data, we run the entire dataset pipeline in a controlled environment: your cloud, our VPC, or on-premise. No data leaves the agreed perimeter, and no training runs take place on shared infrastructure. This is not an optional feature; it is a prerequisite for projects in healthcare, finance and government. Read more in AI for banks and finance and AI in healthcare.

Our fine-tuning workflow

From dataset assessment to production deployment in four phases. Each phase delivers a verifiable intermediate result, so you never face a black-box project that runs for months.

Data assessment and goal setting

We take stock of your data, determine whether fine-tuning is the right tool, and work with you to define the evaluation criteria: pass@k, BLEU, ROUGE, task-specific metrics and hallucination rate.

Dataset curation

Building golden samples, choosing the instruction format, synthetic expansion via a stronger model, and quality control by domain experts. Output: a train/validation/test split that meets your target metrics.

Training and evaluation

Selecting the base model, tuning hyperparameters, and running training (LoRA/QLoRA/full FT), with tracking via MLflow or Weights & Biases. We evaluate iteratively on a held-out set until the model reaches the target metrics.

Deployment and monitoring

Exporting the model to vLLM, TGI, llama.cpp GGUF or a managed endpoint (Inferentia, Replicate). Drift monitoring, latency tracking, A/B evaluation against the previous model, and a retraining cadence.

Use cases that consistently pay for themselves

Not every AI problem should be solved with fine-tuning, but where it fits, it delivers measurable benefits in cost, latency and quality. A few recurring patterns.

Domain-specific generation (legal, medical, financial)

A law firm that wants to draft memos in a fixed structure with the right legal terminology, or a medical team that generates triage summaries that comply with a specific protocol. A fine-tuned 7B-13B model is usually both more accurate and more predictable than a generic API here and, critically, it can run on-premise.

Tone of voice for customer service and publications

A publisher that generates copy in a specific house style, or a customer service team that wants to respond consistently according to its communication handbook. Style transfer is a pattern that fine-tuning solves permanently, whereas prompts remain unstable as soon as the input changes. Often combined with AI customer service automation.

Structured output and function calling

For pipelines that need to produce JSON, XML or a custom DSL, for example in document extraction, ticket routing or agent tooling, fine-tuning gives stronger guarantees than schema prompting. A model that has seen 100k examples of your schema no longer violates it.

Cost reduction: a smaller fine-tuned model instead of GPT-4

A common scenario: a team runs a high-volume task on GPT-4 or Claude and watches the API bill explode. Targeted SFT on a Llama-3.1-8B or Mistral-7B often achieves 90-95% of the quality at a fraction of the cost and latency, hosted on vLLM in your own VPC.

Not sure about a large project yet?

Test your idea first: a working prototype in 1 day

With OneDayBuild, we make your idea tangible in a single day for €1,150, so you know whether further development is worth the investment. Decide to go ahead with the full build? Then we deduct the cost in full.

View OneDayBuild →

Our training and deployment stack

We are deliberately framework-agnostic: the right tool depends on model architecture, dataset size, available GPUs and deployment requirements. What follows is what we actually use, not what is trending on X.

For training, we use the Hugging Face Trainer and TRL library for SFT and DPO, Axolotl for configurable YAML-driven runs on larger models, and Llama-Factory for broad multi-architecture support, depending on the situation. For extremely efficient tuning on consumer GPUs, we use Unsloth, a set of optimisations that makes LoRA runs on 7B models up to 2x faster. Tracking and experiment management go through MLflow or Weights & Biases, depending on your existing MLOps stack.

For compute, we work in your own cloud (AWS, Azure, GCP) wherever possible. If you don't want to build up GPU quota, we use Modal, Replicate or RunPod for occasional training runs. For production inference, we run vLLM or Hugging Face Text Generation Inference (TGI) on your own infrastructure, or we convert to GGUF for llama.cpp when CPU or edge deployment is the better fit. AWS Inferentia and Trainium come into play at high volumes, where the unit economics otherwise don't add up.

PyTorch Hugging Face Transformers TRL PEFT Axolotl Llama-Factory Unsloth DeepSpeed vLLM TGI llama.cpp / GGUF MLflow Weights & Biases Modal RunPod AWS Inferentia Llama 3.1 / Mistral / Qwen / Gemma

Evaluation, eval frameworks and guardrails

A fine-tuned model that scores well on your eval set is a product. A fine-tuned model without an eval set is a gamble. We deliberately invest in evaluation infrastructure before we start serious training.

Task-specific metrics

Alongside generic perplexity, we use metrics that fit your task: BLEU and ROUGE for summarisation, pass@k for code, exact match and F1 for extraction, and LLM-as-judge for open-ended generation. We build every eval suite to be reproducible, with the same test set, the same prompts and the same decoding parameters, so that improvement between runs can be demonstrated.

Hallucination and safety evaluation

For production models, we measure the hallucination rate using a curated set with known correct answers, and we run a safety eval (jailbreak resistance, refusal behaviour, toxicity). Results are recorded per model version, so regressions are immediately visible.

A/B evaluation against a baseline

Every fine-tuned version is compared with a clear baseline: the base model with few-shot prompts, or the previous production model. Without that comparison, you don't know whether the fine-tuning paid off or whether a better prompt would have achieved the same.

Production monitoring and drift detection

After deployment, we log input-output pairs (anonymised), monitor latency percentiles, and run periodic regression evals against our fixed test set. Models are retrained when the output distribution shifts or when a newer base model scores significantly better.

Why Appfront for fine-tuning

An honest decision tree before we start

We'll say "no fine-tuning" when a better prompt or a RAG pipeline solves the problem. That saves you months of work and significant compute costs. We don't want to sell you a project you didn't need.

Full pipeline responsibility

From dataset curation through training and evaluation to production deployment and ongoing maintenance. No handover to an MLOps team you still have to find; one team that guides the model from conception to retirement.

Privacy and hosting within your perimeter

Training in your cloud or VPC, deployment on your infrastructure, and no data through US APIs unless you deliberately choose that. For healthcare, finance and government, that isn't a luxury but a GDPR and sector requirement.

Frequently asked questions about AI fine-tuning

When is fine-tuning better than RAG?
When you want to transfer patterns — writing style, output structure, reasoning chains or domain jargon — that don't fit reliably into a prompt. RAG is better when you want to add facts or frequently changing content. In practice, we combine both: fine-tuning for the how, RAG for the what.
How much data do I need for a fine-tuning project?
For SFT on an open-source model, we typically see usable results from 500-1,000 carefully curated instruction pairs. For LoRA on specific style transfer, 200-500 is sometimes enough. For continued pretraining or large-scale domain adaptation, you're talking about millions of tokens of unlabelled corpus.
What is the difference between LoRA and QLoRA?
LoRA trains small adapter matrices instead of the full model, saving a lot of memory and compute time. QLoRA combines that with 4-bit quantisation of the base model, so you can fine-tune even a 70B-parameter model on a single H100 or a 24GB consumer GPU. QLoRA has become the standard starting point for most modern projects.
When do I choose DPO over RLHF?
In almost all cases. DPO is cheaper, more stable and requires no separate reward model or PPO loop. RLHF remains relevant for projects where continuous feedback from end users needs to steer model behaviour, but for most business fine-tuning, DPO delivers a better cost-benefit ratio.
Which base model do you recommend?
That depends on licensing requirements, language and deployment context. For English and Dutch, Llama 3.1 (8B/70B), Mistral, Qwen 2.5 and Gemma work well. For strictly commercial licences without restrictions, we look at the Apache 2.0 models in those families. For extremely small, CPU-deployable models, Phi-3 or Gemma-2 are often in the mix.
Does a fine-tuned model lose general knowledge (catastrophic forgetting)?
It can, especially with one-sided datasets and learning rates that are too high. We mitigate this by training on a fraction of generic instruction data alongside, setting learning rates conservatively and periodically evaluating against a general benchmark. For strictly domain-only models, some loss is acceptable — for general assistants it is not.
Can we host the fine-tuned model on-premises?
Yes. We deploy on vLLM or TGI in your own Kubernetes cluster, on AWS Inferentia/Trainium for unit-cost optimisation, or we convert to GGUF for llama.cpp on CPU or edge hardware. No mandatory use of external APIs, and no data leaves your perimeter.
How do we measure whether the fine-tuning worked?
Before we start, we define which metrics determine success — pass@k, BLEU/ROUGE, task-specific F1, hallucination rate, latency, cost per 1,000 tokens. We measure every run reproducibly against the same held-out set and compare explicitly with the baseline (the base model with few-shot prompts or your existing production model).
What happens when a newer base model is released?
That is a recurring cycle. We maintain your eval set and run a baseline on the new base model. If the gain is significant, we repeat the fine-tuning on the new base. Because dataset curation is the heaviest work and can be reused, a base model update is usually a matter of weeks, not months.

A fine-tuned model for your domain?

Discuss your use case, dataset and target metrics with us. We'll give you an honest answer on whether fine-tuning is the right tool — and if so, how we get to a production model.

Schedule a call

Edit content