Plug in any IChatClient, and desktop, mobile and web share the same conversation logic
This post is based on version 0.6.0. The packages are still 0.x, so a minor release may still change the API; any change will be noted in the CHANGELOG .
Polhem.Chat is a set of AI chat packages for .NET, with a ChatView for Avalonia and one for Blazor. On the model side it takes an IChatClient from Microsoft.Extensions.AI (the official .NET interface for model clients, implemented for OpenAI, Azure OpenAI, Ollama and others), so it is not tied to any model provider. The view shows:
Streamed replies rendered as Markdown
A live line that says what the model is doing: thinking, calling tools, the time spent and the tokens
A usage summary for each turn
Stop, copy, regenerate, and edit the last prompt
Approval cards for tool calls, and file attachments
The Polhem framework already uses AI chat in places, such as importing a form from documents in its definition editor, and more parts of the framework will get AI…