.NET Blog · 7 min readC# & .NET
Run local models in your .NET apps with Llama on Windows
The post shows how to install Llama on Windows, download a local Llama.cpp model, and call it from a .NET 11 C# file-based app using the OpenAI API format. It explains setting up the tray app, selecting a model, and using Microsoft.Extensions.AI to build a chat client with tool calling.
- Install Llama via winget and launch from the system tray.
- Use OpenAIClient with endpoint http://localhost:9931/v1 and no API key to chat locally.
- Add tool functions with AIFunctionFactory.Create for machine info and model listing.