Code samples and reusable assets to help you build with Microsoft AI (MAI) models.
Explore practical developer scenarios through runnable code, notebooks, and hands-on workshops. Each sample calls a MAI model deployment to demonstrate model capabilities, with step-by-step setup instructions you can follow, learn from, and adapt for your own projects.
| Type | Name | What you'll build | MAI models |
|---|---|---|---|
| Workshop | Multimodal Product Launch | A launch kit for a retail product: posters and ads, a radio spot, checked transcripts, and a new storefront | MAI-Image-2.6, MAI Voice 2.1, MAI Transcribe 2, MAI Code Flash |
| Sample | Text to speech with MAI-Voice | A podcast opening generated from a script, with voices, speaking styles and SSML | MAI Voice 2.1, MAI Voice 2.1 Flash |
| Sample | Speech to text with MAI-Transcribe | A podcast transcript with speaker diarization, word timestamps and keyword hints | MAI Transcribe 2 |
| Sample | Multi-model podcast studio | Narrated, source-checked decks and podcasts generated from model release announcements | MAI Voice 2.1, MAI-Image-2.6, MAI-Image-2.6-Flash, MAI Transcribe 2 (+ Microsoft-Decision-1, GPT-6 Sol) |
| Dataset | Contoso Retail | Shared product catalog (20 products, manuals, photos) for retail scenarios | — |
Find the rest of the catalog in samples/, workshops/, and data/. More notebooks and workshops will be added as they become available.
Content is organized into three top-level locations:
.
├── workshops/ # End-to-end workshops
├── samples/ # Notebook samples
└── data/ # Scenario-specific data
| Folder | What it contains | Status |
|---|---|---|
workshops/ |
End-to-end, hands-on learning paths that take you from setup to a working solution, with guided exercises. Each workshop lives in its own subfolder with a README, requirements.txt and infra/ for its Azure resources. |
1 workshop |
samples/ |
Self-contained Jupyter notebooks for exploring MAI models and focused, practical use cases. | 10 samples |
data/ |
Sample datasets and input files used by specific scenarios. Data is grouped by scenario so workshops and notebooks can share it. | 1 dataset |
The assets/ folder holds images and other files used by repository documentation. The .devcontainer/ sets up Python, Node.js, the Azure CLI and the Azure Developer CLI, and installs every workshop's requirements into a shared .venv.
Use MAI in your coding workflow through GitHub Copilot, or integrate MAI into your application through Microsoft Foundry, Azure Speech, or OpenRouter.
| Developer goal | Where | How to access |
|---|---|---|
| Code with MAI | GitHub Copilot | Select an available MAI coding model (MAI Code 2 or MAI Code 2 Flash) in Copilot's model picker. Availability depends on your plan, Copilot surface, and organization policies. |
| Build an app on Azure | Microsoft Foundry / Azure Speech | Use your Azure subscription to set up a supported model or service, authenticate, and call its API. Start with the reasoning, image, or voice guide. |
| Build an app through a unified third-party API | OpenRouter | Create an OpenRouter API key, choose a listed MAI model ID, and follow that model's API guide. |
Model availability, pricing, and data-handling terms vary by platform. Copilot access does not provide an API key for your application, and not every MAI model is available on every platform. Check the linked documentation for current models, regions, preview restrictions, and any additional access requirements.
- Open the repo in GitHub Codespaces or a VS Code dev container to get every tool preinstalled.
- Choose a notebook in
samples/or a workshop inworkshops/that matches what you want to build. - Follow its README to install prerequisites and dependencies.
- Configure model access using your own credentials and the environment variables documented by that sample.
- Run, explore, and adapt the code for your own project.
Requirements, supported models, endpoint configuration, and environment variable names will be documented per sample. Access to a model deployment is required; any usage charges depend on your endpoint provider and account.
Samples connect to MAI model deployments through publicly available endpoints. You supply your own credentials through environment variables.
- Never put credentials directly in source code or notebooks.
- Never commit secrets, local credential files, or notebook outputs containing sensitive information.
- Use only data you are authorized to send to your configured model endpoint.
This repository contains sample code and documentation only. It does not include model weights, customer data, internal source code, or secrets.
- Additional Foundry Model Samples: https://github.com/microsoft-foundry/model-releases
- MAI in the Microsoft Ignite Keynote: Watch the keynote segment
- MAI Model Release Blog Thread: Read the thread
This repository is under active preparation. The sample catalog and contribution guidance will grow as content is published.
Maintained by Microsoft Developer Relations (Cloud Advocacy) in partnership with the Microsoft AI (MAI) team, and hosted in the Microsoft Foundry GitHub organization.
See Support for sample issues and help. Report security vulnerabilities privately using the instructions in Security, not through public issues.
This project has adopted the Microsoft Open Source Code of Conduct.
The sample code and documentation in this repository are licensed under the MIT License. The license does not grant access to MAI models or change the terms of your configured model endpoint.