
Fine-Tuning on Microsoft Foundry
OfficialFreeEfficiently fine-tune models with SFT, DPO, or RFT.
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 source1. Install with the skills CLI
npx skills add microsoft/azure-skills/finetuning --agent claude-code2. 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 microsoftFine-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
| Stage | Guide |
|---|---|
| Quick start | workflows/quickstart.md |
| Full pipeline | workflows/full-pipeline.md |
| Create data | workflows/dataset-creation.md |
| Iterate | workflows/iterative-training.md |
| Diagnose | workflows/diagnose-poor-results.md |
References
| Topic | File |
|---|---|
| SFT vs DPO vs RFT | references/training-types.md |
| Hyperparameters | references/hyperparameters.md |
| Data formats | references/dataset-formats.md |
| Grader design (RFT) | references/grader-design.md |
| Reward hacking | references/reward-hacking.md |
| Agentic RFT (tools) | references/agentic-rft.md |
| Deployment | references/deployment.md |
| Training curves | references/training-curves.md |
| Evaluation | references/evaluation.md |
| Vision fine-tuning | references/vision-fine-tuning.md |
| Large file uploads | references/large-file-uploads.md |
| Platform gotchas | references/platform-gotchas.md |
Scripts
| Script | Purpose |
|---|---|
scripts/submit_training.py | Submit SFT/DPO/RFT jobs |
scripts/monitor_training.py | Poll job until completion |
scripts/calibrate_grader.py | Find optimal RFT pass_threshold |
scripts/check_training.py | Analyze curves, list checkpoints |
scripts/deploy_model.py | Deploy via ARM REST API |
scripts/evaluate_model.py | LLM judge evaluation |
scripts/convert_dataset.py | Convert between SFT/DPO/RFT formats |
scripts/generate_distillation_data.py | Generate synthetic training data |
scripts/score_dataset.py | Quality scoring on training data |
scripts/cleanup.py | Delete old files and deployments |
scripts/validate/ | Data validators (SFT, DPO, RFT) + stats |
Rules
- Always baseline first — evaluate the base model before fine-tuning
- Validate data before submitting — run
scripts/validate/validate_sft.py - Calibrate RFT graders — target 25-50% failure rate on the base model
- Evaluate checkpoints — don't blindly deploy the final one
- Measure token cost alongside accuracy when comparing models
Quick Reference
| Task | Command |
|---|---|
| Validate SFT data | python scripts/validate/validate_sft.py data.jsonl |
| Submit SFT job | python scripts/submit_training.py --model gpt-4.1-mini --training-file train.jsonl --validation-file val.jsonl --type sft |
| Monitor job | python scripts/monitor_training.py --job-id ftjob-xxx |
| Analyze curves | python scripts/check_training.py --job-id ftjob-xxx |
| Deploy model | python scripts/deploy_model.py --model-id ft:gpt-4.1-mini:... --name my-eval |
| Evaluate model | python scripts/evaluate_model.py --deployment-name my-eval --test-file test.jsonl |
Error Handling
| Error | Cause | Fix |
|---|---|---|
| "API version not supported" | Older openai SDK on /v1/ endpoint | Upgrade to openai>=1.0 |
| "does not support fine-tuning with Standard TrainingType" | OSS model needs globalStandard | Use --use-rest flag or script auto-falls back |
| Job stuck in post-training eval | Under-provisioned tool endpoint (RFT) | Scale to S2+, enable Always On |
| "DeploymentNotReady" after ARM succeeds | ARM/data-plane race condition | Delete and recreate deployment, wait 5 min |
| Content safety block at deployment | PII-dense training data | Remove problematic document types |
Frequently asked questions about Fine-Tuning on Microsoft Foundry
Similar skills
Spring Boot Testing
Master testing techniques for Spring Boot 4 applications.
GitHub Issues
Manage GitHub issues efficiently with MCP tools.
Geofeed Tuner
Optimize your IP geolocation feeds in CSV format.
Batch Files
Master Windows batch scripting for automation and task management.
Adobe Illustrator Scripting
Automate your Illustrator workflows with ExtendScript.
Plugin Structure
Create and organize Claude Code plugins effectively.
