Structured Outputs with Ollama and .NET

Part 6 in the “Local AI with Ollama and .NET” series: Part 1 – Ollama and .NET | Part 2 – Local RAG | Part 3 – AI Agents | Part 3.5 – MCP Server | Part 4 – Microsoft Agent Framework | Part 5 – Aspire | Version française

Asking a local model to reply in JSON directly in the prompt works most of the time. The problem is the rest of the time: the parsing blows up, and rarely at a good moment. Here’s a simple trick to get reliable JSON with Ollama and .NET.

[Read More]

Orchestrating Ollama and Blazor with .NET Aspire

Part 5 in the “Local AI with Ollama and .NET” series: Part 1 – Ollama and .NET | Part 2 – Local RAG | Part 3 – AI Agents | Part 3.5 – MCP Server | Part 4 – Microsoft Agent Framework | Version française

Through the rest of the series, Ollama ran by hand: installed locally on the machine, the ollama pull done manually, and the .NET app pointing at Ollama’s local address hardcoded. It works, but it’s several manual steps to repeat on every machine. Aspire takes care of this configuration. I wanted to see what it changes.

[Read More]
Categories: .NET  AI  Tags: .NET Aspire  Ollama  Blazor  .NET  AI  Orchestration 

Real-Time Weather and Swapping to the Claude API

This post is part of the Voice Assistant on Raspberry Pi series.

The assistant responds well, but it has no idea what the weather is like outside. We wire up Open-Meteo, a free, key-less weather API. And while we’re at it, we swap Ollama for the Claude API: a single line in appsettings.json.

The complete code for this article is available on GitHub.

[Read More]
Categories: .NET  AI  Tags: Raspberry Pi  .NET  Ollama  Claude API  Open-Meteo 

Memory, Silence Detection, and systemd

This post is part of the Voice Assistant on Raspberry Pi series.

The assistant from article #3 works, but every exchange starts from scratch. We fix that in three steps: conversational memory, automatic silence detection, and auto-start at boot with systemd.

The complete code for this article is available on GitHub.

[Read More]
Categories: .NET  AI  Tags: Raspberry Pi  .NET  Ollama  systemd  ffmpeg 

Ollama Integration and Home Context

This post is part of the Voice Assistant on Raspberry Pi series.

Article #2 ended with a hardcoded response, which was enough to confirm the audio pipeline works. Now we swap that line for a real HTTP call to Ollama on the pi-cerveau, and add a system prompt to give the assistant a personality and some knowledge about your home.

The complete code for this article is available on GitHub.

[Read More]
Categories: .NET  AI  Tags: Raspberry Pi  .NET  Ollama  Llama  Worker Service 

Setting Up Both Raspberry Pis

This post is part of the Voice Assistant on Raspberry Pi series.

Two Raspberry Pi 4s, a few hours of setup, and at the end you have a voice assistant running entirely on your local network. Before writing a single line of .NET code, here’s the setup for both Pis.

[Read More]
Categories: .NET  AI  Tags: Raspberry Pi  .NET  Ollama  Piper TTS  Whisper  Linux 

Microsoft Agent Framework: First Agent, MCP, and Multi-Agent Workflows

Microsoft Agent Framework replaces Semantic Kernel and AutoGen. Here’s how to create a local agent with Ollama, connect an MCP server, and orchestrate two agents in sequence. [Read More]