Conceptual image of wiring OpenAI Codex CLI to any LLM with 50 lines of C#

Running OpenAI Codex CLI on Top of Claude, Gemini, or Llama — in 50 Lines of C#

OpenAI’s Codex CLI ships a great editor-agent UX — shell tools, apply_patch, plan tracking, all of it. The catch: as of February 2026, it only speaks the OpenAI Responses API. Chat Completion support was removed (the WireApi enum in codex-rs/model-provider-info/src/lib.rs now has only Responses), which leaves Chat-Completion-only endpoints — Ollama, LM Studio, your favourite Llama runner — locked out. This post walks through how I used .NET 10 file-based programs and the IChatClient abstraction from Microsoft.Extensions.AI to stand up a Responses-compatible server in a single 50-line C# file, with OpenRouter as the backend, so that Codex CLI can run on top of whichever model I feel like that day. ...

May 27, 2026 · 9 min ·  rkttu
Conceptual image of C# and Python meeting for machine learning interop

Calling Hugging Face Models from C#: Running Whisper, sentence-transformers, and Stable Diffusion with DotNetPy 0.6.0

Over the weekend I shipped 0.6.0 of DotNetPy, a small C# library that calls CPython’s C API directly to run Python inside a .NET app. This post walks through the three machine learning samples bundled with 0.6.0 — semantic search with sentence-transformers, speech recognition with Whisper, and text-to-image with Stable Diffusion Turbo — and explains how the same release was also validated on PEP 703 free-threaded CPython. Starting Point: You Only Have C#, but the Model Lives on Hugging Face Every few months the same pattern repeats. I need Whisper for subtitles, or a sentence-transformer for search, or occasionally something like Stable Diffusion — but the only tool in hand is C#. The usual workarounds all come with a decisive downside. ...

May 11, 2026 · 10 min ·  rkttu
Concept image of code running from a single C# file

A New Genre in .NET: The Era of NuGet-Free Single File C# Coding

C# isn’t becoming as lightweight as a scripting language — scripting languages are becoming envious of how fast it’s getting. Introduction dotnet run file.cs — the so-called file-based app — introduced in .NET 10, lets you run C# code with just a single .cs file, without a .csproj. However, its current execution speed is roughly 1.5 seconds on Windows and 0.8 seconds on WSL2 for the first run. Compared to Python’s python script.py at around 50ms, it’s hard to call this “scripting” with a straight face. ...

March 16, 2026 · 12 min ·  rkttu