Repo for fine tuning examples and sample datasets
개요
This repository contains and for fine-tuning models on Azure AI Foundry. Use this repo to explore practical fine-tuning workflows and access ready-to-use data for your own projects. 1. - Best first demo! Fine-tune GPT-4.1-mini to detect code bugs — beat GPT-5.4 quality at 9x lower cost 2. - Understand data formats for SFT, DPO, and RFT - Open this repo in VS Code with Copilot, or use Claude/Codex — the agent skill auto-discovers and walks you through the full workflow - Or follow — fine-tune your first model in 6 steps (no demo notebook needed) - - Direct Preference Optimization - - Reinforcement Fine-Tuning Explore end-to-end fine-tuning experiences in the folder: 👉 See for detailed descriptions of each demo. Ready-to-use datasets for testing fine-tuning techniques in the folder: 👉 See for data format details and when to use each technique.
README
Fine-Tuning in AI Foundry
This repository contains 15 end-to-end demos and sample datasets for fine-tuning models on Azure AI Foundry. Use this repo to explore practical fine-tuning workflows and access ready-to-use data for your own projects.
📋 Table of Contents
🚀 Quick Start
New to fine-tuning? Start here:
- SFT_Bug_Detection - Best first demo! Fine-tune GPT-4.1-mini to detect code bugs — beat GPT-5.4 quality at 9x lower cost
- Sample_Datasets - Understand data formats for SFT, DPO, and RFT
Want an AI coding assistant to guide you?
- Open this repo in VS Code with Copilot, or use Claude/Codex — the agent skill auto-discovers and walks you through the full workflow
- Or follow Skills/workflows/quickstart.md — fine-tune your first model in 6 steps (no demo notebook needed)
Ready for advanced techniques?
- DPO_Intel_Orca - Direct Preference Optimization
- RFT_Countdown - Reinforcement Fine-Tuning
🎯 Demos
Explore end-to-end fine-tuning experiences in the Demos folder:
| Demo | Technique | Use Case | Difficulty |
|---|---|---|---|
| SFT_Bug_Detection | SFT | Code bug detection (beats GPT-5.4 teacher) | ⭐ Beginner |
| SFT_CNN_DailyMail | SFT | News summarization | ⭐ Beginner |
| SFT_PubMed_Summarization | SFT | Medical paper summarization | ⭐ Beginner |
| DPO_Intel_Orca | DPO | Preference optimization | ⭐⭐ Intermediate |
| RFT_Countdown | RFT | Math puzzle solving | ⭐⭐ Intermediate |
| DistillingSarcasm | Distillation | Knowledge transfer | ⭐⭐ Intermediate |
| Image_Breed_Classification_FT | Vision SFT | Dog breed classification | ⭐⭐ Intermediate |
| Image_FT_Chart_Analysis | Vision SFT | Chart understanding | ⭐⭐ Intermediate |
| Video_FT_Action_Recognition | Vision SFT | Video action detection | ⭐⭐⭐ Advanced |
| ZavaRetailAgent | SFT + RFT | Retail customer service agent | ⭐⭐⭐ Advanced |
| Agentic_RFT_PrivatePreview | RFT | Agentic workflows with tools | ⭐⭐⭐ Advanced |
| Evaluation | Evaluation | Multimodal model evaluation | ⭐⭐ Intermediate |
| SyntheticDatagen-ToolUse | SFT + Synthetic Datagen | Tool-calling assistants from a tool spec | ⭐⭐ Intermediate |
| TracesDistillation | Distillation + Traces | Distill a deployed agent from real production traces | ⭐⭐⭐ Advanced |
👉 See Demos/README.md for detailed descriptions of each demo.
📊 Sample Datasets
Ready-to-use datasets for testing fine-tuning techniques in the Sample_Datasets folder:
| Technique | Dataset | Description |
|---|---|---|
| SFT | Text-GSM8K | Grade school math problems |
| SFT | Text-Bug-Detection | Code bug detection and fix suggestions |
| SFT | Multimodal-chartqa | Chart interpretation |
| SFT | Tool-Calling | Function calling patterns |
| DPO | orca_dpo_pairs | Preference alignment |
| RFT | ClauseMatching | Legal contract analysis |
| RFT | MedMCQ | Medical Q&A |
👉 See Sample_Datasets/README.md for data format details and when to use each technique.
⚠️ Note: These datasets are for learning and experimentation only—not for production use. Training jobs may incur costs on your Azure subscription.
🤖 AI Agent Skills
This repo includes a fine-tuning skill that coding agents can auto-discover and use to help you submit, monitor, and evaluate fine-tuning jobs.
| Agent | Skill Path | Auto-discovery |
|---|---|---|
| GitHub Copilot (VS Code / CLI) | .github/skills/azure-ai-fine-tuning | ✅ Automatic |
| Claude Code | .claude/skills/azure-ai-fine-tuning | ✅ Automatic |
| Codex / other agents | .agents/skills/azure-ai-fine-tuning | ✅ Automatic |
All three paths are symlinks to the canonical skill at Skills/, which includes:
- SKILL.md — Agent instructions covering SFT, DPO, and RFT workflows
- 12 scripts — submit, monitor, calibrate, check, deploy, evaluate, validate, score, convert, generate, cleanup, and shared utilities
- 14 reference docs — grader design, hyperparameters, dataset formats, agentic RFT, cost management, and more
- 6 guided workflows — quickstart, full pipeline, dataset creation, iterative training, diagnosis, experiment review
- Sample data — SFT, DPO, and RFT example JSONL files
Using with GitHub Copilot (VS Code)
- Open this repo in VS Code with Copilot Chat enabled.
- Ask a fine-tuning task (e.g., “help me submit an SFT job with my dataset”).
- Copilot auto-discovers the skill from
.github/skills/and follows the workflow.
Using with Copilot CLI
cd /path/to/this/repo
copilot
# Then ask: "Submit an SFT fine-tuning job with my training data"
Using with Claude Code
cd /path/to/this/repo
claude
# Then ask: "Fine-tune gpt-4.1-mini on my dataset"
Scripts support uv for zero-setup execution (PEP 723 inline dependencies):
uv run Skills/scripts/submit_training.py --help
✅ Prerequisites
Before running any demo, ensure you have:
- Azure subscription with access to Azure AI Foundry
- Python 3.9+ installed
- Jupyter Notebook or VS Code with Jupyter extension
- Required Azure role assignments (see individual demo READMEs)
Each demo includes a requirements.txt and .env.template for setup.
👉 New here? See the Getting Started Guide for step-by-step setup instructions.
Contributing
See CONTRIBUTING.md for guidelines on submitting issues and pull requests.
Trademarks
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.
추천 도구
다른 키워드를 입력하거나 필터를 제거해 보세요.
설치
npx skillfish add microsoft-foundry/fine-tuning