ai-dev-gallery
Copilot instructions1.5k starsChanged 11 months agoMITView on GitHub
AI Dev Gallery is a WinUI 3 desktop application showcasing local AI capabilities for Windows developers. It features interactive samples powered by local AI models, and enables exporting standalone Visual Studio projects. Tech Stack: C#, WinUI 3, Windows App SDK, ONNX Runtime, WinML, .NET 9.0
Trending
Quiet since February.about the whole repository
Who's talking about microsoft/ai-dev-gallery
- @metulev.bsky.social“My team has had a lot of fun working on the AI Dev Gallery and we are excited to share it with the world. …”Bluesky · Nov 19, 2024 · 28 likes
- @thejoefin.com“Oooooo! New AI Dev Gallery app repo is now public! Check it out here github.com/microsoft/ai... #WinDev …”Bluesky · Nov 19, 2024 · 15 likes
- @adefwebserver.com“Easily download and install the AI Dev Gallery to run LLM models on your local computer - …”Bluesky · Mar 1, 2025 · 6 likes
- contosomodels/Contoso.AI“Add embeddings model”GitHub · Feb 18, 2026 · 1 reactions
- contosomodels/Contoso.AI“Update copilot instructions for ingesting from AI Dev Gallery”GitHub · Feb 18, 2026 · 1 reactions
The biggest 5 of 15 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 15
Talked about on GitHub and Bluesky (15 times).
On GitHub · 11
- Feb 18, 2026Add embeddings model — contosomodels/Contoso.AI1 reaction
- Feb 18, 2026Update copilot instructions for ingesting from AI Dev Gallery — contosomodels/Contoso.AI1 reaction
- Aug 21, 2025Integrate the phi silica chat client — mattleibow/Maui.Essentials.AI1 reaction
- Aug 6, 2025Windows Support — praeclarum/CrossIntelligence1 reaction · 2 comments
- Feb 18, 2026Add text embeddings with multi-model pattern — contosomodels/Contoso.AI0 reactions
6 more on GitHub
- Feb 18, 2026Add AI Dev Gallery integration guide to Copilot instructions — contosomodels/Contoso.AI0 reactions
- Dec 27, 2025Add translation to Grab Frame and Edit Text Window using Windows AI — TheJoeFin/Text-Grab0 reactions · 4 comments
- Oct 24, 2025Modernize Activity Bar with NavigationView — dotnet/XAMLStudio0 reactions · 8 comments
- Sep 8, 2025AI Dev Gallery — lagimik/PartnerCrucible0 reactions
- Aug 21, 2025Windows Notes — mattleibow/Maui.Essentials.AI0 reactions
- Jan 17, 2025Blue screen when running AI Dev Gallery model with shared memory — microsoft/DirectML0 reactions · 1 comment
On Bluesky · 4
- Nov 19, 2024My team has had a lot of fun working on the AI Dev Gallery and we are excited to share it with the world. Experiment with models and local… — @metulev.bsky.social28 likes and reposts
- Nov 19, 2024Oooooo! New AI Dev Gallery app repo is now public! Check it out here github.com/microsoft/ai... #WinDev #Windows #ai #localFirst #dotnet… — @thejoefin.com15 likes and reposts · 1 reply
- Mar 1, 2025Easily download and install the AI Dev Gallery to run LLM models on your local computer - github.com/microsoft/ai... — @adefwebserver.com6 likes and reposts
- Dec 30, 2024微软推出 AI Dev Gallery,可便捷运行本地 AI 模型 微软为 Windows 11 AI+ PC 设备推出 AI Dev Gallery 功能,支持开发者集成本地 AI 模型。相比云端服务,该功能通过本地调用 AI 模型,具备更快响应速度。 AI Dev… — @youtechinfo.bsky.social1 likes and repost
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
33 rules. About 0 are common, 16 are distinctive, and 17 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
17
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Check for hardcoded secrets, API keys, or credentials
- Distinctive: line 13
Verify Limited Access Features (LAF) tokens are not committed
- Distinctive: line 14
Ensure model URLs point to trusted sources (HuggingFace, GitHub)
- Distinctive: line 15
Verify telemetry events don't log sensitive data (user paths, usernames)
- Very specific: line 18
Ensure model inference runs on background threads (Task.Run)
- Very specific: line 19
Verify proper disposal of InferenceSession and other resources
- Distinctive: line 20
Check for memory leaks in image processing code
- Distinctive: line 23
When reviewing PRs that add or modify samples:
- Very specific: line 26
Must inherit from BaseSamplePage
- Very specific: line 27
Must have [GallerySample] attribute with all required properties
- Very specific: line 28
Must override LoadModelAsync(SampleNavigationParameters) or LoadModelAsync(MultiModelSampleNavigationParameters)
- Very specific: line 29
Must register Unloaded event handler for cleanup
- Very specific: line 41
Call sampleParams.NotifyCompletion() when initialization finishes
- Very specific: line 42
Use await sampleParams.GetIChatClientAsync() for language models
- Very specific: line 43
Use sampleParams.WinMlSampleOptions for WinML EP configuration
- Distinctive: line 63
When reviewing WinML samples:
- Very specific: line 74
Use sessionOptions.GetCompiledModel() when CompileModel is true
- Distinctive: line 77
Verify input dimensions match model expectations
- Distinctive: line 78
Check batch size is set correctly
- Distinctive: line 79
Ensure proper preprocessing (resize, normalize)
- Very specific: line 82
When reviewing .model.json or .modelgroup.json:
- Very specific: line 92
Must have PromptTemplate referencing promptTemplates.json
- Very specific: line 95
When scenarios.json is modified:
- Very specific: line 96
Verify the scenario has unique Id
- Very specific: line 97
Check Name, Description, and Instructions are meaningful
- Distinctive: line 107
Use pattern matching and modern C# features
- Very specific: line 108
Use async/await for asynchronous operations
- Distinctive: line 117
Follow accessibility guidelines (narrator support, keyboard navigation)
- Very specific: line 124
Run with filter: --filter "FullyQualifiedName~UnitTests"
- Distinctive: line 127
Verify sample appears in correct category
- Distinctive: line 128
Test model loading and inference
- Distinctive: line 129
Verify project export generates valid VS solution
- Distinctive: line 130
Test on both x64 and ARM64 if possible
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI Dev Gallery - GitHub Copilot Custom Instructions
Repository Overview
AI Dev Gallery is a WinUI 3 desktop application showcasing local AI capabilities for Windows developers. It features interactive samples powered by local AI models, and enables exporting standalone Visual Studio projects.
Tech Stack: C#, WinUI 3, Windows App SDK, ONNX Runtime, WinML, .NET 9.0
PR Review Focus Areas
Security
- Check for hardcoded secrets, API keys, or credentials
- Verify Limited Access Features (LAF) tokens are not committed
- Ensure model URLs point to trusted sources (HuggingFace, GitHub)
- Verify telemetry events don't log sensitive data (user paths, usernames)
Performance
- Ensure model inference runs on background threads (
Task.Run) - Verify proper disposal of
InferenceSessionand other resources - Check for memory leaks in image processing code
Sample Implementation Standards
When reviewing PRs that add or modify samples:
- Class Structure
- Must inherit from
BaseSamplePage - Must have
[GallerySample]attribute with all required properties - Must override
LoadModelAsync(SampleNavigationParameters)orLoadModelAsync(MultiModelSampleNavigationParameters) - Must register
Unloadedevent handler for cleanup
- Must inherit from
- [GallerySample] Attribute Requirements
Name: Display name (required)Model1Types: Array of supported model types (required)Scenario: Must reference a ScenarioType from scenarios.jsonId: Unique GUID (required)Icon: Segoe MDL2 glyph (required)NugetPackageReferences: Array of needed packagesSharedCode: Array of SharedCodeEnum values if using shared utilities
- Model Loading Pattern
- Call
sampleParams.NotifyCompletion()when initialization finishes - Use
await sampleParams.GetIChatClientAsync()for language models - Use
sampleParams.WinMlSampleOptionsfor WinML EP configuration - Handle exceptions with
ShowException(ex, message)
- Call
- Resource Cleanup
public MySample() { this.Unloaded += (s, e) => CleanUp(); this.InitializeComponent(); } private void CleanUp() { _session?.Dispose(); _cts?.Cancel(); _cts?.Dispose(); }
WinML/ONNX Patterns
When reviewing WinML samples:
- EP Registration
var catalog = Microsoft.Windows.AI.MachineLearning.ExecutionProviderCatalog.GetDefault(); await catalog.EnsureAndRegisterCertifiedAsync(); - Session Options
- Always call
sessionOptions.RegisterOrtExtensions() - Honor
WinMlSampleOptions.PolicyorEpName/DeviceType - Use
sessionOptions.GetCompiledModel()whenCompileModelis true
- Always call
- Tensor Handling
- Verify input dimensions match model expectations
- Check batch size is set correctly
- Ensure proper preprocessing (resize, normalize)
Model Definition Files
When reviewing .model.json or .modelgroup.json:
- Required Fields
- Unique
Idfor model family and individual models - Valid HuggingFace/GitHub
Url - Correct
Sizein bytes - Valid
Licenseidentifier HardwareAccelerator: CPU, GPU, NPU, etc.
- Unique
- For Language Models
- Must have
PromptTemplatereferencing promptTemplates.json
- Must have
Scenario Updates
When scenarios.json is modified:
- Verify the scenario has unique
Id - Check
Name,Description, andInstructionsare meaningful - Remember: rebuild required for changes to take effect
Code Style
C# Conventions
- Use file-scoped namespaces
- Copyright header:
// Copyright (c) Microsoft Corporation. All rights reserved. - License header:
// Licensed under the MIT License. - Enable nullable reference types
- Use pattern matching and modern C# features
- Use
async/awaitfor asynchronous operations
Naming Conventions
- Sample classes: Descriptive name matching the feature (e.g.,
Chat,ImageClassification) - Private fields:
_camelCasewith underscore prefix - Public properties:
PascalCase
XAML Conventions
- Use WinUI 3 controls
- Follow accessibility guidelines (narrator support, keyboard navigation)
Testing Requirements
Unit Tests
- Location:
AIDevGallery.Tests/UnitTests/ - Framework: MSTest
- Run with filter:
--filter "FullyQualifiedName~UnitTests"
When Adding Samples
- Verify sample appears in correct category
- Test model loading and inference
- Verify project export generates valid VS solution
- Test on both x64 and ARM64 if possible
Common Issues to Flag
- Missing cleanup code -
Unloadedhandler not disposing resources - Blocking UI thread - Model inference not on background thread
- Missing NotifyCompletion - Loading spinner never dismissed
- Invalid GUIDs - Duplicate or malformed sample IDs
- Missing NuGet references - SharedCode files require corresponding packages
- Incorrect HardwareAccelerator - Model won't run on intended hardware
- scenarios.json not rebuilt - New scenarios don't appear in app
Documentation References
- Adding Samples Guide
- WinML Beginner Guide
- Telemetry Guide
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

