Skip to main content

Getting started with AI development in .NET

Getting started in the world of AI development can be a challenge. Every day new libraries, models and possibilities appear. So what is your first step and where can I find good examples on how to tackle different problems?

This is where Microsoft wants to help through the AI Dev Gallery. The AI Dev Gallery is an open-source app designed to help Windows developers integrate AI capabilities within their own apps and projects.

The app contains the following:

  • Over 25 interactive samples powered by local AI models
  • Easily explore, download, and run models from Hugging Face and GitHub
  • The ability to view the C# source code and simply export a standalone Visual Studio project for each sample

You can download the AI Dev Gallery directly or through the Windows App Store:

A walkthrough

Let me walk you through some of the features in the AI Dev Gallery application.

  • After opening the app you arrive on the Home page where you have a carrousel of different use cases:

 

  • When you click on a specific example, I can first select and download a model from Hugging Face:

 

  • After agreeing with the Terms and Conditions for the selected model, the download starts:

 

  • Once the download is completed, we can continue by selecting the downloaded model and clicking on Run sample:

 

  • We now see the sample in action:
  • By clicking on the Code button, we can see the exact code used to create this example:

  • We can use this example as a starting point for our own solution by clicking on the Export button. We are asked to either use the central model cache or create a copy of the model in our project directory:

 

That is a good start. Let’s now discover some of the other features of this app.

The samples

The home page only shows a limited set of samples. If you want to explore the full set of available applications, you need to go to the Samples page. This page gives you an overview of all samples split out in multiple categories.

If you click on a specific example, you go through the same steps as I showed you in the walkthrough above.

The models

Next we have the models page. On this page you find a list of models that can be run locally split out in different categories. For every model you get some instructions on how to run it, a button to download the model and a list of samples where this model can be used:

The APIs

The last page is the Windows AI APIs page. Here you can learn and explore all the Windows APIs that are available for different use cases.

When you click on a specific use case, you get example code to explore the API in more detail:

 

Remark: For most of these APIs a Windows AI Copilot+ PC is required.

More information

Introducing the AI Dev Gallery: Your Gateway to Local AI Development with .NET - .NET Blog

Overview for AI Dev Gallery app | Microsoft Learn

AI Dev Gallery (Preview) - Free download and install on Windows | Microsoft Store

Popular posts from this blog

Azure DevOps/ GitHub emoji

I’m really bad at remembering emoji’s. So here is cheat sheet with all emoji’s that can be used in tools that support the github emoji markdown markup: All credits go to rcaviers who created this list.

Kubernetes–Limit your environmental impact

Reducing the carbon footprint and CO2 emission of our (cloud) workloads, is a responsibility of all of us. If you are running a Kubernetes cluster, have a look at Kube-Green . kube-green is a simple Kubernetes operator that automatically shuts down (some of) your pods when you don't need them. A single pod produces about 11 Kg CO2eq per year( here the calculation). Reason enough to give it a try! Installing kube-green in your cluster The easiest way to install the operator in your cluster is through kubectl. We first need to install a cert-manager: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.5/cert-manager.yaml Remark: Wait a minute before you continue as it can take some time before the cert-manager is up & running inside your cluster. Now we can install the kube-green operator: kubectl apply -f https://github.com/kube-green/kube-green/releases/latest/download/kube-green.yaml Now in the namespace where we want t...

Podman– Command execution failed with exit code 125

After updating WSL on one of the developer machines, Podman failed to work. When we took a look through Podman Desktop, we noticed that Podman had stopped running and returned the following error message: Error: Command execution failed with exit code 125 Here are the steps we tried to fix the issue: We started by running podman info to get some extra details on what could be wrong: >podman info OS: windows/amd64 provider: wsl version: 5.3.1 Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM Error: unable to connect to Podman socket: failed to connect: dial tcp 127.0.0.1:2655: connectex: No connection could be made because the target machine actively refused it. That makes sense as the podman VM was not running. Let’s check the VM: >podman machine list NAME         ...