AGENT SKILL

finetuning

Fine-tune models on Microsoft 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
所属仓库
microsoft/skills
最近更新
2026-11-14
Stars
★ 3.2k
Forks
368

01 前言 Front Matter

name
finetuning
license
MIT
metadata
{ "author": "Microsoft", "version": "0.0.0-placeholder" }
description
Fine-tune models on Microsoft 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).

02 资源文件 33

03 SKILL.md 正文

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

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

  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

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

04 同仓库更多 Skills

microsoft
microsoft/skills

skill-creator

Guide for creating effective skills for AI coding agents working with Azure SDKs and Microsoft Foundry services. Use when creating new skills or updating existing skills.

Skill与智能体开发
★ 3.2k
microsoft
microsoft/skills

podcast-generation

Generate AI-powered podcast-style audio narratives using Azure OpenAI's GPT Realtime Mini model via WebSocket. Use when building text-to-speech features, audio narrative generation, podcast creation from content, or integrating with Azure OpenAI Realtime API for real audio output. Covers full-stack implementation from React frontend to Python FastAPI backend with WebSocket streaming.

前端开发后端与接口
★ 3.2k
microsoft
microsoft/skills

microsoft-docs

Understand Microsoft technologies by querying official documentation. Use whenever the user asks how something works, wants tutorials, needs configuration options, limits, quotas, or best practices for any Microsoft technology (Azure, .NET, M365, Windows, Power Platform, etc.)—even if they don't mention "docs." If the question is about understanding a concept rather than writing code, this is the right skill.

Skill与智能体开发
★ 3.2k
microsoft
microsoft/skills

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP), Node/TypeScript (MCP SDK), or C#/.NET (Microsoft MCP SDK).

Skill与智能体开发
★ 3.2k
microsoft
microsoft/skills

kql

KQL language expertise for writing correct, efficient Kusto Query Language queries. Covers syntax gotchas, join patterns, dynamic types, datetime pitfalls, regex patterns, serialization, memory management, result-size discipline, and advanced functions (geo, vector, graph). USE THIS SKILL whenever writing, debugging, or reviewing KQL queries — even simple ones — because the gotchas section prevents the most common errors that waste tool calls and cause expensive retry cascades. Trigger on: KQL, Kusto, ADX, Azure Data Explorer, Fabric Real-Time Intelligence, EventHouse, Log Analytics, log analysis, data exploration, time series, anomaly detection, summarize, where clause, join, extend, project, let statement, parse operator, extract function, any mention of pipe-forward query syntax.

数据分析师内容创作者写作与文案Skill与智能体开发
★ 3.2k
microsoft
microsoft/skills

github-issue-creator

Convert raw notes, error logs, voice dictation, or screenshots into crisp GitHub-flavored markdown issue reports. Use when the user pastes bug info, error messages, or informal descriptions and wants a structured GitHub issue. Supports images/GIFs for visual evidence.

★ 3.2k