New to Claude Skills? Learn how to install them →

Fmicrosoft on GitHub

Fine-Tuning on Microsoft Foundry

OfficialFree

Efficiently fine-tune models with SFT, DPO, or RFT.

by microsoft1.4k stars on microsoft/azure-skills
2 views
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What Fine-Tuning on Microsoft Foundry does

The Fine-Tuning on Microsoft Foundry skill enables developers to fine-tune machine learning models using three distinct training methodologies: Supervised Fine-Tuning (SFT), Preference-based Training (DPO), and Reinforcement Fine-Tuning (RFT). This skill provides a comprehensive framework for preparing datasets, submitting training jobs, deploying models, and evaluating their performance. It is particularly useful for those who need to adapt pre-existing models to specific tasks or datasets, ensuring that the models perform optimally in their intended applications.

Users can leverage the included scripts to manage various aspects of the fine-tuning process. For instance, submit_training.py allows for the submission of training jobs, while monitor_training.py helps track job status until completion. Additionally, the skill includes tools for validating data, calibrating graders for RFT, and generating synthetic training data, which can enhance the quality of the training datasets. This makes it suitable for both novice and experienced users who are looking to refine their models with precision.

The skill also emphasizes the importance of evaluating the base model before fine-tuning, validating datasets prior to submission, and carefully selecting training types based on project requirements. With a structured approach to fine-tuning, users can effectively diagnose poor results and iterate on their training processes. The included workflows guide users through the entire pipeline, from dataset creation to model deployment and evaluation, making it a valuable resource for machine learning practitioners.

When to use it

Use this skill when you need to fine-tune models using SFT, DPO, or RFT, and when you require tools for dataset preparation and training job management.

When not to use it

This skill is not suitable for general model deployment without fine-tuning or for tasks like agent creation or prompt optimization without training.

What you can build with it

Fine-tuning for Specific Tasks

A developer needs to adapt a pre-trained model for a specific application, utilizing SFT to enhance performance on task-specific data.

Dataset Validation and Preparation

A data scientist prepares a new dataset for training, using the validation scripts to ensure data quality before submission.

Monitoring Training Jobs

An engineer submits a training job and uses the monitoring script to track its progress and diagnose any issues that arise during training.

How to install Fine-Tuning on Microsoft Foundry

View source

1. Install with the skills CLI

npx skills add microsoft/azure-skills/finetuning --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by microsoft

Fine-Tuning on Microsoft 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

Frequently asked questions about Fine-Tuning on Microsoft Foundry

Similar skills