{"id":1950,"date":"2025-04-22T17:19:04","date_gmt":"2025-04-22T17:19:04","guid":{"rendered":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2025\/04\/22\/introducing-the-ai-dev-gallery-your-gateway-to-local-ai-development-with-net\/"},"modified":"2025-04-22T17:19:04","modified_gmt":"2025-04-22T17:19:04","slug":"introducing-the-ai-dev-gallery-your-gateway-to-local-ai-development-with-net","status":"publish","type":"post","link":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2025\/04\/22\/introducing-the-ai-dev-gallery-your-gateway-to-local-ai-development-with-net\/","title":{"rendered":"Introducing the AI Dev Gallery: Your Gateway to Local AI Development with .NET"},"content":{"rendered":"<p>The world of AI development is evolving rapidly, with new models, techniques, and tools emerging every day.<\/p>\n<p>For developers looking to incorporate AI into their applications, the landscape can be both exciting and overwhelming.<\/p>\n<p>How do you experiment with different models?<br \/>\nHow do you see working examples of AI patterns like RAG, chat, or object detection?<br \/>\nAnd most importantly, how do you bridge the gap between experimentation and production-ready code?<\/p>\n<p>If you missed our <a href=\"https:\/\/techcommunity.microsoft.com\/blog\/azuredevcommunityblog\/getting-started-with-the-ai-dev-gallery\/4354803\">initial announcement on the Azure Developer Community Blog<\/a>, we\u2019re excited to introduce you to the <a href=\"https:\/\/aka.ms\/adg-from-dotnet-blog\">AI Dev Gallery<\/a>. In this post, we\u2019ll explore this Windows application in greater depth, showcasing how it simplifies AI development with .NET through interactive samples, easy model downloads, and exportable source code.<\/p>\n<h2>What is the AI Dev Gallery?<\/h2>\n<p>The AI Dev Gallery is a Windows application that serves as a comprehensive playground for AI development using .NET. It provides everything you need to explore, experiment with, and implement AI capabilities in your applications, all without requiring a connection to cloud services.<\/p>\n\n<div class=\"wp-video\"><!--[if lt IE 9]&gt;document.createElement('video');&lt;![endif]--><br \/>\n<a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2025\/04\/ai-dev-gallery.mp4\">https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2025\/04\/ai-dev-gallery.mp4<\/a><\/div>\n<h3>Features<\/h3>\n<h4>Over 25 Interactive Local AI Samples<\/h4>\n<p>The AI Dev Gallery includes a diverse collection of interactive samples that demonstrate different AI capabilities:<\/p>\n<p><strong>RAG (Retrieval-Augmented Generation)<\/strong> implementations that combine search with generative AI<br \/>\n<strong>Chat interfaces<\/strong> powered by various local models<br \/>\n<strong>Object detection<\/strong> samples for identifying objects in images<br \/>\n<strong>Image generation<\/strong> using stable diffusion models<br \/>\n<strong>Text-to-speech and speech-to-text<\/strong> conversion<br \/>\n<strong>Semantic search<\/strong> for finding conceptually related content<br \/>\n<strong>Document summarization<\/strong> and analysis<br \/>\nAnd many more\u2026<\/p>\n<p>All these samples run entirely on your local machine, allowing you to experiment without cloud dependencies or API costs.<\/p>\n<h4>Easy Model Discovery and Download<\/h4>\n<p>Finding and setting up AI models is often a significant hurdle in development. The AI Dev Gallery simplifies this process by allowing you to:<\/p>\n<p>Browse models from popular repositories like Hugging Face and GitHub<br \/>\nDownload models with a single click, including:<\/p>\n<p>Phi 4 and Phi Silica for efficient text generation<br \/>\nStable Diffusion for image creation<br \/>\nWhisper for speech recognition<br \/>\nall-MiniLM (L6 and L12 versions) for text embeddings<br \/>\nSpecialized models for various tasks like pose detection, street segmentation, and more<\/p>\n<p>The gallery handles model compatibility, ensuring you get versions that work with the .NET ecosystem.<\/p>\n\n<div class=\"alert alert-success\">\n<p class=\"alert-divider\"><strong>Tip<\/strong><\/p>\n<p>Models are cached locally after download, so you only need to download them once even if you use them across multiple samples.<\/p><\/div>\n<h4>View and Export Source Code<\/h4>\n\n<div class=\"alert alert-info\">\n<p class=\"alert-divider\"><strong>Key Feature<\/strong><\/p>\n<p>One of the most powerful features of the AI Dev Gallery is the ability to view the C# source code behind each sample and export it as a standalone Visual Studio project with a single click.<\/p><\/div>\n<p>This feature bridges the gap between experimentation and implementation, allowing you to:<\/p>\n<p>Explore how each AI capability is implemented in C#<br \/>\nUnderstand the patterns and best practices for AI integration<br \/>\nExport the code as a complete, buildable project<br \/>\nUse the exported code as a starting point for your own applications<\/p>\n<h2>Built using .NET AI Building Blocks<\/h2>\n<p>What makes the AI Dev Gallery particularly valuable for .NET developers is that it\u2019s built entirely using the foundational pieces of the .NET AI ecosystem. This means that the code you see and export uses the same libraries and patterns you\u2019ll use in production applications.<\/p>\n<h3>Microsoft.Extensions.AI for Model Integration<\/h3>\n<p>For chat and embedding generation, the AI Dev Gallery uses Microsoft.Extensions.AI \u2013 a unified set of abstractions for AI model integration in .NET applications.<\/p>\n<p>\/\/ Example of chat completion using Microsoft.Extensions.AI<br \/>\nvar chatOptions = new ChatOptions<br \/>\n{<br \/>\n    Temperature = 0.7f,<br \/>\n    MaxTokens = 800<br \/>\n};<\/p>\n<p>var chatCompletionService = serviceProvider.GetRequiredService&lt;IChatCompletionService&gt;();<br \/>\nvar response = await chatCompletionService.GetChatCompletionAsync(messages, chatOptions);<\/p>\n<p>Microsoft.Extensions.AI provides a consistent programming model regardless of the underlying model implementation, whether it\u2019s a local model or a cloud service. This allows you to swap models without changing your application code.<\/p>\n<p>For generative language models specifically, the gallery leverages ONNX Runtime GenAI, which builds on top of Microsoft.Extensions.AI to provide optimized local model execution and an effective chat client implementation.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/introducing-microsoft-extensions-ai-preview\/\">Learn more about Microsoft.Extensions.AI<\/a><\/p>\n<h3>Microsoft.ML.Tokenizers for Text Processing<\/h3>\n<p>To convert text into tokens (the numerical representations that models understand), the AI Dev Gallery uses Microsoft.ML.Tokenizers, which supports a wide range of tokenization schemes:<\/p>\n<p>\/\/ Example of tokenization using Microsoft.ML.Tokenizers<br \/>\nvar tokenizer = BertTokenizer.Create(&#8220;vocab.txt&#8221;);<br \/>\nvar tokens = tokenizer.EncodeToIds(&#8220;How does tokenization work?&#8221;);<\/p>\n<p>The tokenizer library in .NET 9 supports multiple tokenization schemes:<\/p>\n<p>BERT for bidirectional encoding<br \/>\nBPE (Byte Pair Encoding) for efficient subword tokenization<br \/>\nSentencePiece (BPE and Unigram algorithms) for language-agnostic tokenization<br \/>\nTiktoken for GPT models<br \/>\nLlama and Phi for their respective model families<br \/>\nDeepSeek and other specialized tokenizers<\/p>\n<p>This flexibility ensures compatibility with virtually any text-based AI model.<\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/dotnet\/ai\/conceptual\/understanding-tokens\">Learn more about tokenizers in .NET<\/a><\/p>\n<h3>Microsoft.Extensions.VectorData for Semantic Search<\/h3>\n<p>For semantic search and RAG scenarios, the AI Dev Gallery uses Microsoft.Extensions.VectorData, which provides abstractions for working with vector databases and embeddings:<\/p>\n<p>\/\/ Example of vector search using Microsoft.Extensions.VectorData<br \/>\n\/\/ Create vector store with in-memory provider<br \/>\nvar vectorStore = new InMemoryVectorStore&lt;Document&gt;();<\/p>\n<p>\/\/ Add documents with embeddings<br \/>\nawait vectorStore.UpsertAsync(<br \/>\n    [new Document { Id = &#8220;1&#8221;, Text = &#8220;Example document&#8221;, Vector = embeddings[0] }],<br \/>\n    CancellationToken.None);<\/p>\n<p>\/\/ Define a query embedding (example placeholder)<br \/>\nfloat[] queryEmbedding = new float[] { \/* embedding values *\/ };<\/p>\n<p>\/\/ Search for similar documents<br \/>\nvar results = await vectorStore.SearchAsync(<br \/>\n    queryEmbedding,<br \/>\n    new VectorSearchOptions { Limit = 5 },<br \/>\n    CancellationToken.None);<\/p>\n<p>This library makes it easy to implement semantic search and RAG patterns without being tied to a specific vector database implementation.<\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/dotnet\/ai\/quickstarts\/build-vector-search-app?tabs=azd&amp;pivots=openai\">Learn more about vector search in .NET<\/a> or read our <a href=\"https:\/\/techcommunity.microsoft.com\/blog\/azuredevcommunityblog\/semantic-search-with-the-ai-dev-gallery\/4400142\">detailed blog post about semantic search with the AI Dev Gallery<\/a> for a deeper dive into implementation details.<\/p>\n<h3>System.Numerics.Tensors for Efficient Computation<\/h3>\n<p>For post-processing model outputs and performing operations like cosine similarity, the AI Dev Gallery uses Tensor and TensorPrimitives provided by System.Numerics.Tensors:<\/p>\n<p>\/\/ Example of using TensorPrimitives for cosine similarity<br \/>\nReadOnlySpan&lt;float&gt; embedding1 = [&#8230;]; \/\/ First embedding<br \/>\nReadOnlySpan&lt;float&gt; embedding2 = [&#8230;]; \/\/ Second embedding<\/p>\n<p>\/\/ Calculate cosine similarity using TensorPrimitives<br \/>\nfloat similarity = TensorPrimitives.CosineSimilarity(embedding1, embedding2);<\/p>\n<p>The Tensor types in .NET 9 provide high-performance numeric operations with minimal memory allocations, which is crucial for AI workloads that often involve large numeric arrays.<\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/dotnet\/core\/whats-new\/dotnet-9\/overview#tensorprimitives\">Learn more about Tensor and TensorPrimitives<\/a><\/p>\n<h2>Start Your AI Development Journey Today<\/h2>\n<p>The AI Dev Gallery represents a significant step forward in making AI development accessible to .NET developers. By providing interactive samples, easy model access, and exportable code, it removes many of the barriers that have traditionally made AI integration challenging.<\/p>\n<p>Whether you\u2019re new to AI or an experienced developer looking to explore new capabilities, the AI Dev Gallery provides a comprehensive environment for learning, experimentation, and implementation.<\/p>\n\n<div class=\"d-flex justify-content-left\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/aka.ms\/adg-from-dotnet-blog\" target=\"_blank\">Download AI Dev Gallery from Microsoft Store<\/a><\/div>\n\n<div class=\"alert alert-primary\">\n<p class=\"alert-divider\"><strong>Open Source<\/strong><\/p>\n<p>The AI Dev Gallery is open source! If you want to contribute or explore how it\u2019s built, check out the <a href=\"https:\/\/aka.ms\/adg-repo-from-dotnet-blog\">AI Dev Gallery GitHub repository<\/a>.\n<\/p><\/div>\n<p>We\u2019re continuously adding new samples and features to the AI Dev Gallery. We\u2019d love to hear your feedback and suggestions on what you\u2019d like to see next.<\/p>\n<p>The post <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/introducing-ai-dev-gallery-gateway-to-local-ai-development\/\">Introducing the AI Dev Gallery: Your Gateway to Local AI Development with .NET<\/a> appeared first on <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\">.NET Blog<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>The world of AI development is evolving rapidly, with new models, techniques, and tools emerging every day. For developers looking [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[],"class_list":["post-1950","post","type-post","status-publish","format-standard","hentry","category-dotnet"],"_links":{"self":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/1950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/comments?post=1950"}],"version-history":[{"count":0,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/1950\/revisions"}],"wp:attachment":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media?parent=1950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/categories?post=1950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/tags?post=1950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}