GPT-OSS is OpenAI's first open-weight model since GPT-2, offering developers powerful AI capabilities without cloud dependency. The guide demonstrates how to build a local AI chat application using C# and Ollama, leveraging Microsoft.Extensions.AI libraries for unified abstractions. The 20B model runs on just 16GB of memory, making it accessible for local development. The tutorial covers setting up a console app, adding necessary NuGet packages, implementing streaming chat with conversation history, and preparing for advanced scenarios like function calling and agentic applications.
Table of contents
What you’ll need Copy linkC# toolbox Copy linkStep 1: Create a new console app Copy linkStep 2: Add the NuGet packages Copy linkStep 3: Write your chat code Copy linkStep 4: Run your application Copy linkBuild agentic apps next Copy linkUp next — Foundry Local Copy linkSummary Copy linkSort: