PluginBench
Skill
Official
Review
Audit score 70

finetuning

microsoft/azure-skills

Fine-tune models on Azure AI Foundry with SFT, DPO, or RFT training methods.

What is finetuning?

Fine-tune language and vision models on Azure AI Foundry using supervised (SFT), preference (DPO), or reinforcement (RFT) training. Use this skill when preparing training data, submitting and monitoring training jobs, calibrating graders, deploying fine-tuned models, and evaluating results.

  • Submit and monitor SFT, DPO, and RFT training jobs on Azure AI Foundry
  • Prepare, validate, and convert training datasets between formats
  • Calibrate graders and pass thresholds for reinforcement fine-tuning
  • Deploy fine-tuned models via ARM REST API
  • Evaluate fine-tuned models using LLM judges
  • Generate synthetic training data and score dataset quality

How to install finetuning

npx skills add https://github.com/microsoft/azure-skills --skill microsoft-foundry
Prerequisites
  • Azure AI Foundry project and API credentials
  • Training data in JSONL format (SFT, DPO, or RFT)
  • Python 3.8+ with openai SDK >= 1.0
  • For RFT: a grader function or tool endpoint
Claude Code
Cursor
Windsurf
Cline

How to use finetuning

  1. 1.Prepare training data in the appropriate JSONL format (SFT, DPO, or RFT)
  2. 2.Run validation script to check data quality and format
  3. 3.Submit training job using submit_training.py with model, data files, and training type
  4. 4.Monitor job progress with monitor_training.py until completion
  5. 5.Analyze training curves and checkpoints with check_training.py
  6. 6.Deploy the selected fine-tuned model using deploy_model.py
  7. 7.Evaluate the deployed model on test data with evaluate_model.py

Use cases

Good for
  • Fine-tune a base model on domain-specific supervised examples to improve task accuracy
  • Use DPO to align model outputs with preference rankings from human feedback
  • Train with RFT using custom graders to optimize for specific evaluation criteria
  • Prepare and validate JSONL training datasets before submission
  • Monitor training curves and select optimal checkpoints for deployment
Who it's for
  • ML engineers building custom models for specific domains
  • Data scientists optimizing model behavior with preference or reinforcement training
  • Teams deploying fine-tuned models to production on Azure
  • Researchers experimenting with different training types and hyperparameters

finetuning FAQ

When should I use SFT vs DPO vs RFT?

Use SFT for supervised learning on labeled examples. Use DPO when you have preference pairs (better/worse responses). Use RFT when you have a grader function that can score outputs and want to optimize for specific criteria.

How do I prepare training data?

Format data as JSONL with required fields per training type. For SFT: messages array. For DPO: chosen and rejected completions. For RFT: prompt and expected behavior. Run validate_sft.py, validate_dpo.py, or validate_rft.py before submission.

What should my RFT grader pass rate be?

Target 25-50% failure rate on the base model. Use calibrate_grader.py to find the optimal pass_threshold that achieves this range.

How do I know if my fine-tuned model is better?

Always baseline the original model first. Compare metrics on a held-out test set using evaluate_model.py. Also measure token cost alongside accuracy for production decisions.

What if my training job fails or gets stuck?

Check error messages in the job logs. Common issues: API version mismatch (upgrade openai SDK), under-provisioned tool endpoint for RFT (scale to S2+), or content safety blocks (review training data for PII). See platform-gotchas.md for detailed troubleshooting.

Full instructions (SKILL.md)

Source of truth, from microsoft/azure-skills.


name: finetuning description: "Fine-tune models on Azure AI Foundry using SFT (supervised), DPO (preference), or RFT (reinforcement with graders). Covers dataset preparation, training job submission, deployment, and evaluation. USE FOR: fine-tune, SFT, DPO, RFT, training data, grader, distillation, fine-tuned model, training job, large file upload, calibrate grader, deploy fine-tuned model, evaluate fine-tuned model. DO NOT USE FOR: general model deployment without fine-tuning (use deploy-model), agent creation (use agents), prompt optimization without training (use prompt-optimizer)." license: MIT metadata: author: Microsoft version: "0.0.0-placeholder"

Fine-Tuning on Azure AI Foundry

Fine-tune models using SFT (supervised), DPO (preference), or RFT (reinforcement with graders). Covers dataset prep, training, deployment, and evaluation.

When to Use

Use this sub-skill when the user asks about:

  • Fine-tuning a model (SFT, DPO, or RFT)
  • Preparing, validating, or formatting training data
  • Submitting, monitoring, or diagnosing training jobs
  • Calibrating graders or pass thresholds for RFT
  • Deploying or evaluating a fine-tuned model
  • Choosing between training types (SFT vs DPO vs RFT)
  • Distillation, synthetic data generation, or dataset quality scoring
  • Large file uploads for training data
  • Cleaning up fine-tuning resources (files, deployments)

Do NOT use for: General model deployment without fine-tuning (use deploy-model), agent creation (use agents), prompt optimization without training (use prompt-optimizer).

Workflows

StageGuide
Quick startworkflows/quickstart.md
Full pipelineworkflows/full-pipeline.md
Create dataworkflows/dataset-creation.md
Iterateworkflows/iterative-training.md
Diagnoseworkflows/diagnose-poor-results.md

References

TopicFile
SFT vs DPO vs RFTreferences/training-types.md
Hyperparametersreferences/hyperparameters.md
Data formatsreferences/dataset-formats.md
Grader design (RFT)references/grader-design.md
Reward hackingreferences/reward-hacking.md
Agentic RFT (tools)references/agentic-rft.md
Deploymentreferences/deployment.md
Training curvesreferences/training-curves.md
Evaluationreferences/evaluation.md
Vision fine-tuningreferences/vision-fine-tuning.md
Large file uploadsreferences/large-file-uploads.md
Platform gotchasreferences/platform-gotchas.md

Scripts

ScriptPurpose
scripts/submit_training.pySubmit SFT/DPO/RFT jobs
scripts/monitor_training.pyPoll job until completion
scripts/calibrate_grader.pyFind optimal RFT pass_threshold
scripts/check_training.pyAnalyze curves, list checkpoints
scripts/deploy_model.pyDeploy via ARM REST API
scripts/evaluate_model.pyLLM judge evaluation
scripts/convert_dataset.pyConvert between SFT/DPO/RFT formats
scripts/generate_distillation_data.pyGenerate synthetic training data
scripts/score_dataset.pyQuality scoring on training data
scripts/cleanup.pyDelete old files and deployments
scripts/validate/Data validators (SFT, DPO, RFT) + stats

Rules

  1. Always baseline first — evaluate the base model before fine-tuning
  2. Validate data before submitting — run scripts/validate/validate_sft.py
  3. Calibrate RFT graders — target 25-50% failure rate on the base model
  4. Evaluate checkpoints — don't blindly deploy the final one
  5. Measure token cost alongside accuracy when comparing models

Quick Reference

TaskCommand
Validate SFT datapython scripts/validate/validate_sft.py data.jsonl
Submit SFT jobpython scripts/submit_training.py --model gpt-4.1-mini --training-file train.jsonl --validation-file val.jsonl --type sft
Monitor jobpython scripts/monitor_training.py --job-id ftjob-xxx
Analyze curvespython scripts/check_training.py --job-id ftjob-xxx
Deploy modelpython scripts/deploy_model.py --model-id ft:gpt-4.1-mini:... --name my-eval
Evaluate modelpython scripts/evaluate_model.py --deployment-name my-eval --test-file test.jsonl

Error Handling

ErrorCauseFix
"API version not supported"Older openai SDK on /v1/ endpointUpgrade to openai>=1.0
"does not support fine-tuning with Standard TrainingType"OSS model needs globalStandardUse --use-rest flag or script auto-falls back
Job stuck in post-training evalUnder-provisioned tool endpoint (RFT)Scale to S2+, enable Always On
"DeploymentNotReady" after ARM succeedsARM/data-plane race conditionDelete and recreate deployment, wait 5 min
Content safety block at deploymentPII-dense training dataRemove problematic document types