Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This guide describes both hardware specifications and the steps required to configure a device and successfully build apps using the Windows Copilot Runtime APIs.
Dependencies
Ensure that your PC supports Windows Copilot Runtime and that all dependencies are installed. You can choose to do this automatically (recommended) or manually.
Download the Windows Copilot Runtime configuration .winget file from the winget-dsc GitHub repo (click ... > Download from the top of the page).
Next, double-click the file to open it with the Windows Package Manager client (or launch Terminal, navigate to the folder where you downloaded
configuration.winget
, and run the file usingwinget configure configuration.winget
).This performs the following tasks:
- Checks for minimum OS version.
- Enables Developer Mode.
- Installs Visual Studio Community Edition with WinUI and other required workloads.
- Installs the Windows App SDK.
Build a new app
The following steps describe how to build your own app that uses Windows Copilot Runtime APIs (select the tab for your preferred UI framework).
In Visual Studio, create a new WinUI project by selecting the Blank App, Packaged (WinUI 3 in Desktop) template.
In Solution Explorer, right-click the project node, select Properties > Application > General, and ensure that the target framework is set to .NET 8.0, and the target OS is set to 10.0.22621 or later.
Edit the Package.appxmanifest file (right click and select View code) and add the following snippets.
The
systemAIModels
capability to the<Capabilities>
node:<Capabilities> <systemai:Capability Name="systemAIModels"/> </Capabilities>
The
systemai
namespace specifier to the<Package>
node:xmlns:systemai="http://schemas.microsoft.com/appx/manifest/systemai/windows10"
Right-click the project node and select Manage NuGet Packages...
In NuGet Package Manager, check the Include prelease checkbox, and select Windows App SDK version 1.8.250410001-experimental1. Click Install or Update.
Ensure that your build configuration is set to ARM64.
Build and run your app.
If the app launches succesfully, then continue to Add your first AI API. Otherwise, see Troubleshooting.
Advanced tutorials and APIs
Now that you've successfully checked for model availability, explore the APIs further in the various Windows Copilot Runtime tutorials.
- Learn more about available Windows Copilot Runtime APIs
- Phi Silica API Walkthrough
- Text Recognition API Walkthrough
- Imaging API Walkthrough
Troubleshooting
If you encounter any errors, it's typically because of your hardware or lack of model availability.
- The GetReadyState method checks whether the model required by an AI feature is available on the user's device. You must call this method before any call to the model.
- If the model isn't available on the user's device, then you can call the method EnsureReadyAsync to install the required model. Model installation runs in the background, and the user can check the install progress on the Windows Settings > Windows Update Settings page.
- The EnsureReadyAsync method has a status option that can show a loading UI. If the user has unsupported hardware, then EnsureReadyAsync will fail with an error.
See Troubleshooting and FAQ for more assistance.