How can I integrate AI into my Windows client app?
Integrating AI into your Windows application can be achieved through two primary methods: a local model or a cloud-based model. For the local model option, you have the ability to utilize a pre-existing model or train your own using platforms like TensorFlow or PyTorch, and then incorporate it into your application via OnnxRuntime. Microsoft Foundry on Windows offers APIs for various functions, including OCR or utilizing the Phi Silica model. On the other hand, hosting your model on the cloud and accessing it through a REST API allows your application to remain streamlined by delegating resource-intensive tasks to the cloud. See Use Machine Learning models in your Windows app for more information.
Do I need the latest version of Windows 11 and a Copilot+ PC with an NPU to use AI features?
There are many ways to run AI workloads, both by installing and running models locally on your Windows device or by running cloud-based models (see Get started with AI on Windows), however, the AI features supported by Windows AI APIs currently require a Copilot+ PC with an NPU.
What programming languages are best for developing AI in Windows client apps?
You can use any programming language you prefer. For instance, C# is widely used for creating Windows client apps. If you require more control over low-level details, C++ is an excellent option. Alternatively, you might consider using Python. You can also use the Windows Subsystem for Linux (WSL) to run Linux-based AI tools on Windows.
What are the best AI frameworks for Windows client apps?
We recommend using OnnxRuntime.
How should I handle data privacy and security when using AI in Windows client apps?
Respecting the privacy and security of user data is essential when developing AI-powered apps. You should follow best practices for data handling, such as encrypting sensitive data, using secure connections, and obtaining user consent before collecting data. You should also be transparent about how you are using data and give users control over their data. Make sure to read Developing Responsible Generative AI Applications and Features on Windows too.
What are the system requirements for running AI in Windows client apps?
System requirements for Windows apps that use AI depend on the complexity of the AI model and the hardware acceleration used. For simple models, a modern CPU may be sufficient, but for more complex models, a GPU or NPU may be required. You should also consider the memory and storage requirements of your app, as well as the network bandwidth required for cloud-based AI services.
How to optimize AI performance in Windows client apps?
To optimize AI performance in Windows apps, you should consider using hardware acceleration, such as GPUs or NPUs, to speed up model inference. Windows Copilot+ laptops are optimized for AI workloads and can provide a significant performance boost for AI tasks. See also Foundry Toolkit for Visual Studio Code overview.
Can I use pre-trained AI models in my Windows client app?
Yes, you can use pre-trained AI models in your Windows app. You can download pre-trained models from the internet or use a cloud-based AI service to access pre-trained models. You can then integrate these models into your app using a framework like OnnxRuntime.
What is DirectML?
DirectML is a low-level API for machine learning that provides GPU acceleration for common machine learning tasks across a broad range of supported hardware and drivers, including all DirectX 12-capable GPUs from vendors such as AMD, Intel, NVIDIA, and Qualcomm.
How can I find out what sort of CPU, GPU, or NPU my device has?
To check the type of CPU, GPU, or NPU on your Windows device and how it's performing, open Task Manager (Ctrl + Shift + Esc), then select the Performance tab and you will be able to see your machine's CPU, Memory, Wi-Fi, GPU, and/or NPU listed, along with information about its speed, utilization rate, and other data.
What is Windows ML?
Windows ML (Machine Learning) enables your app to use a shared system-wide copy of the ONNX Runtime (ORT), and adds support to dynamically download vendor-specific execution providers (EPs) so that your model inference can be optimized across the wide variety of CPUs, GPUs, and NPUs in the Windows ecosystem without requiring your app to carry heavy runtimes or EPs itself.