pure C# · private AI · voice · OpenAI-compatible · no sidecar

Private LLMs and voice, inside your .NET app.

Overfit runs local LLMs (Qwen, Llama, Phi, Gemma, Mistral, Bielik), RAG and agents — plus speech-to-text and text-to-speech — directly inside your process. It also serves an OpenAI-compatible API as a tiny Native-AOT binary or a ~34 MB container. No Python, no Ollama, no model server, no data egress.

$ dotnet add package DevOnBike.Overfit $ dotnet tool install -g DevOnBike.Overfit.Cli $ docker run -p 8080:8080 -v ./models:/models devonbikeit/overfit /models/model.gguf
No PythonNo OllamaNo model serverNo native binaryNo data egressNo CUDANo vendor lock-in
New demo

Bielik inside ASP.NET.

A Polish local-agent preset loads Bielik from GGUF, indexes Polish documents, answers with RAG, calls C# tools and returns well-formed JSON — all in one ASP.NET process.

$ cd Demo/LocalAgentAspNetDemo $ .\download-bielik.cmd $ .\download-embedder.cmd $ .\run-bielik.cmd
0 Ballocated per token on the decode hot path
7.6×faster than ONNX Runtime on single Linear inference
up to ~24 tok/sQwen2.5‑3B Q4_K_M on CPU
~220 MBlive managed heap for mmap-backed 3B load path
100%pure C# / .NET 10 runtime path
1e‑4ONNX output parity vs PyTorch
Bielik local agent

Polish RAG, tools and JSON — without Python.

The Bielik preset is the most practical Polish demo: local Bielik GGUF, Polish documents, RAG, C# tool calling, business-decision JSON and metrics from one ASP.NET service.

cd Demo/LocalAgentAspNetDemo
.\download-bielik.cmd      # Bielik GGUF -> C:\bielik
.\download-embedder.cmd    # MiniLM embedder -> C:\minilm
.\run-bielik.cmd           # launch-profile bielik

# Try:
POST /rag/query
POST /agent
POST /decision/refund
GET  /metrics
🇵🇱

What it proves

  • Bielik loads from a local GGUF file inside .NET.
  • Polish documents are indexed and queried through in-process RAG.
  • Polish requests become C# tool calls.
  • Business decisions return as well-formed JSON objects.
  • No model server, Python process or API key.

Open Bielik page

ASP.NET demo

One service. Six useful endpoints.

The Local Agent demo exposes chat, RAG, tool calling, guaranteed JSON and metrics over HTTP.

GET /health
POST /chat
POST /rag/query
POST /agent
POST /chat/json
GET /metrics
Core capabilities

Everything needed for private .NET agents.

Overfit is not a wrapper around a server. The runtime, retrieval, constrained JSON, tool dispatch and inference hot paths live in managed .NET.

🤖

Local LLMs

Qwen2.5/Qwen3, Llama, Mistral, Phi-3.5/4, Gemma 2, Mixtral & MoE, Bielik and GPT-style models from GGUF, safetensors or ONNX — 0 B/token decode.

🎙️

Voice: speech ⇄ text

Whisper speech-to-text and text-to-speech with voice cloning — the full voice loop in one .NET process, on the CPU.

🔌

OpenAI-compatible server

/v1/chat/completions (SSE), /v1/embeddings, /v1/audio/speech — a dependency-free server, Native-AOT into a ~34 MB container that idles at ~0% CPU. Point any OpenAI client at it.

🔎

In-process RAG

Embeddings, built-in vector store and cosine search without an external vector DB.

🛠️

C# tool calling

Constrained decoding forces a valid tool-call envelope and dispatches straight to your C# delegate.

{}

Guaranteed JSON

Structured output is valid by construction. Invalid tokens cannot be sampled under the active constraint.

🧩

Pure-managed engine

Predictable CPU inference, explicit memory ownership, Native AOT-compatible paths and zero-allocation hot paths.

📦

Flexible model I/O

GGUF, K-quants, safetensors, ONNX, GPT-2 .bin, embeddings, LoRA, OCR and small deep networks.

🎯

Fine-tuning

LoRA stages, autograd training, Adam/SGD, LR schedules, CNNs, gradient checkpointing and data-parallel CPU training (a full 60k-image MNIST CNN trains in ~2 s).

🔁

ONNX import

Linear topology plus DAG support, skip connections, ResNet-style models and output parity checks vs PyTorch.

Benchmarks

Honest performance story.

Overfit optimizes for pure-managed, in-process .NET deployment, low allocation pressure and predictable CPU behavior. It is not trying to beat llama.cpp or native GPU stacks on every raw throughput metric.

WorkloadHeadline resultAllocation
Single inference Linear(784→10)~7.6× faster than ONNX Runtime0 B
Qwen2.5‑3B Q4_K_M decode~19 tok/s on CPU, up to ~24 tok/s with the opt-in repacked-GEMV mode; RAM footprint in llama.cpp range~1 B/token
Bielik-4.5B Q4_K_M preset~17 tok/s on CPU, −36% working set vs same-file llama.cpp~1 B/token
GPT-2 KV-cache decode~6.5× faster than naive O(N²)0 B/token

Raw tokens/sec is not the main axis. llama.cpp / LLamaSharp can be faster. Overfit optimizes for pure C#, in-process deployment, Native AOT-friendly paths, low allocation pressure and no data egress.

Commercial integration

Get a private .NET agent into production.

Private .NET RAG / Agent PoC

Local model, document indexing, RAG, C# tools, guaranteed JSON and ASP.NET endpoints in your infrastructure.

Bielik for Polish documents

Polish local agent over policies, support docs, contracts, claims and internal knowledge bases.

Sidecar replacement

Move inference from Python, Ollama, ONNX Runtime or a model server into your .NET process.

Contact

Tell me what you need to ship.

Best first message: current stack, target deployment, model size, data constraints, whether Python/native binaries are allowed, and what the first demo must prove.

Direct email: devonbike@gmail.com

Static form: opens your email client. No backend, no stored form data.