How azure/llm-fine-tuning-azure works
Project type and purpose
• This is a documentation & sample‐code repository (labs) for demonstrating LLM fine-tuning patterns on Azure.
• It provides three “lab tracks”:
• No-Code via Azure AI Foundry dashboard
• Low-Code via Azure Python SDK & Azure ML
• Pro-Code via open-source frameworks (Unsloth AI, Hugging Face TRL)
File structure
• Top‐level files: .md policies, README.md (overview + learning path).
• labs/fine_tuning_dashboards: markdown demos of UI driven workflows.
• labs/fine_tuning_notebooks: Jupyter notebooks grouped by model family (gpt_fine_tuning, llama2, llama3, phi) plus supporting data/config files.
Extract architectural insights from the README
• Three pillars of fine-tuning:
• Azure AI Foundry Dashboard
• Azure Python SDK / Azure ML workspace
• Open-source SDKs (Unsloth, HF TRL)
• Common flow: user supplies training & validation data → triggers fine-tune job → monitors progress → obtains custom model.
Main components
a. Users & roles
• Data Scientists / ML Engineers
b. Code & content repo
• GitHub (this repo: notebooks, dashboards, markdown)
c. No-Code path
• Azure AI Foundry UI
• Azure backend services (compute, data store, fine-tune API)
d. Low-Code path
• Azure Machine Learning workspace
• Python SDK in notebooks
• Compute resources (Compute Instances/Clusters)
• Data storage (Blob Storage for JSONL datasets)
• Model Registry / endpoints
e. Pro-Code path
• Local or cloud notebooks running Unsloth AI / Hugging Face TRL
• Containerized training environments
• Artifact store (e.g., HF Hub or local file system)
f. External services
• OpenAI APIs (for GPT-3.5, GPT-4 variants)
• Hugging Face model hub
• Azure subscription resources
Relationships & data flows
• User → GitHub repo (clone labs)
• For No-Code:
User → Azure AI Foundry UI → submit fine-tune job → underlying compute & storage → retrieve fine-tuned model
• For Low-Code:
Notebook → Azure ML Python SDK → Workspace → compute cluster + blob storage → run fine-tuning job → register model → deploy endpoint
• For Pro-Code:
Notebook → Unsloth/TRL SDK → local or cloud GPU environment → training data → fine-tune → save artifacts locally or push to HF hub
Architectural patterns & principles
• Layered separation:
• Presentation/UI layer (dashboard, notebooks)
• Orchestration layer (Azure services, SDK)
• Compute layer (clusters, containers)
• Data layer (blob storage, model registry)
• Modular “lab” modules—each notebook is a self-contained pipeline
• Reusable components: shared data & config (azure.env, JSONL files)
Technologies & frameworks to annotate
• Azure AI Foundry
• Azure Machine Learning SDK (azure-ml)
• Azure Blob Storage
• Compute Instances / Clusters (AML Compute)
• Jupyter Notebooks
• Unsloth AI Python SDK
• Hugging Face TRL
• OpenAI APIs