From overfit
Adds local, in-process LLM inference to an existing .NET project using Overfit — no Python, no Ollama, no cloud. Loads a GGUF model in C#, adds chat/RAG/embeddings on CPU, or replaces an OpenAI/Ollama/Azure call with an on-device model.
How this skill is triggered — by the user, by Claude, or both
Slash command
/overfit:overfit-add-llmThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Wires [Overfit](https://github.com/DevOnBike/Overfit) — a pure-C#/.NET, in-process LLM runtime — into an
Wires Overfit — a pure-C#/.NET, in-process LLM runtime — into an existing project so it loads a GGUF model and runs on the CPU. No Python, no model server, no data egress.
New project? Use the template instead: dotnet new install DevOnBike.Overfit.Templates →
dotnet new overfit-chat. This skill is for adding Overfit to an existing codebase.
Identify the target. Find the .csproj to add inference to and classify it: web / DI host
(ASP.NET, Minimal API — has WebApplication.CreateBuilder) vs console / library (direct calls).
Overfit targets net10.0; if the project is older, say so and confirm before bumping the TFM.
Add the packages.
dotnet add package DevOnBike.Overfit # the runtime
dotnet add package DevOnBike.Overfit.Extensions.AI # only if you want IChatClient / DI / Semantic Kernel
Add Microsoft.Extensions.AI too if the app will call builder.Services.AddChatClient(...).
Get a model (GGUF). Check for an existing one first: a *.gguf in the repo, an OVERFIT_MODEL_DIR
env var, or ask the user for a path. If there is none, download a small one to test with:
curl -L -o model.gguf https://huggingface.co/bartowski/Qwen2.5-0.5B-Instruct-GGUF/resolve/main/Qwen2.5-0.5B-Instruct-Q4_K_M.gguf
Then gitignore it — add *.gguf to .gitignore (models are large; never commit them). Size guidance:
a 0.5B–1B Q4_K is a good default; only go to 3B+ if the box has the RAM (mmap keeps the managed heap tiny,
but the OS still pages the weights).
Wire it. Pick the path that matches the project:
Web / DI — as a standard IChatClient (drops into the .NET AI template & Semantic Kernel):
using DevOnBike.Overfit.LanguageModels;
using DevOnBike.Overfit.Extensions.AI;
using Microsoft.Extensions.AI;
var overfit = OverfitClient.LoadGguf(builder.Configuration["ModelPath"] ?? "model.gguf", mmap: true);
builder.Services.AddSingleton(overfit);
builder.Services.AddChatClient(overfit.AsChatClient()); // inject IChatClient anywhere
Stream in an endpoint via IChatClient.GetStreamingResponseAsync(prompt) (update.Text per token).
Console / library — direct:
using DevOnBike.Overfit.LanguageModels;
using var client = OverfitClient.LoadGguf("model.gguf", mmap: true);
Console.WriteLine(client.Send("Say hello in one sentence."));
Verify end-to-end. dotnet build, then actually run it and send one prompt — confirm tokens come
back (don't stop at "it compiles"). For a web app, hit the endpoint; for a console app, run it.
Report the wiring + the model path, and point at the follow-ons the user is likely to want next (below). Leave the tree clean/staged — do not commit (that's the user's call).
SentenceEmbedder.ForMiniLm(dir).AsEmbeddingGenerator() → a standard IEmbeddingGenerator;
pair with Overfit's in-process VectorStore.dotnet tool install -g DevOnBike.Overfit.Cli then
overfit serve model.gguf → point any OpenAI client at http://localhost:8080/v1.ChatSession / SamplingOptions.*.gguf). Add them to .gitignore.mmap: true for GGUF — low, reclaimable working set instead of an F32 blow-up.[email protected]).npx claudepluginhub devonbike/overfit --plugin overfitIntegrates AI services into .NET apps using Microsoft.Extensions.AI for chat completions, streaming, and function calling; covers Semantic Kernel, embeddings, vector search, and agents.
Azure OpenAI client library for .NET enabling chat completions, embeddings, image generation, audio transcription, and assistants.
Working with .NET, C#, ASP.NET Core, or related frameworks. Routes to specialist skills.