Skip to content

andrewleader/FoundryLocalLabDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foundry Local on Windows Lab Demo

Prerequisites

Step 1: Open the solution

Double click the FoundryLocalLabDemo.sln file in the root directory to open the solution.

image

Step 2: Deploy the app

Click the Start Debugging button to deploy the app. We'll keep it open while we edit, and see changes appear live!

image

The app should look like this when it launches.

image

Notice that no models appear in the middle section. We're going to add the ability to use local LLMs using Foundry Local!

Step 3: Inspect the NuGet packages

Back in Visual Studio, open the Solution Explorer and inspect the dependencies of the project. Notice that the Foundry Local NuGet package is installed, along with some Azure AI (cloud) libraries. If you were starting new, you would install the Foundry Local NuGet package yourself. We have it pre-installed since we leverage some of the types in the sample project.

image

Step 4: Open the ExecutionLogic.cs file

Further down in the Solution Explorer, find and open the ExecutionLogic.cs file. Notice that we have a static FoundryLocalManager initialized, but the rest has not been implemented.

image

Step 5: Implement getting the catalog models

First, we have to start the Foundry Local service. Update StartServiceAsync to return the result from manager.StartServiceAsync().

public static Task StartServiceAsync()
{
    // Start the Foundry Local service
    return manager.StartServiceAsync();
}

Then, we need to implement the method to list all the models available in the catalog. This will return a list of all local models that your device can run, even if they haven't been downloaded.

Within ListCatalogModelsAsync, simply call

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages