r/LocalAIStack • • Oct 10 '26

A C# Local inference engine beat llama.cpp at its own game: ~30% faster first token, ~20% faster decode - running in .NET on a 4-thread laptop

A C# Local inference engine beat llama.cpp at its own game: ~30% faster first token, ~20% faster decode - running in .NET on a 4-thread laptop

I needed a .NET-only GGUF engine - no pip packages, no native libs, no runtime installs, just a managed dependency my other projects can call. So I built SharpMind, a pure-C# transformer + MoE inference engine (with training) on .NET 10. Zero native code. I never expected it to compete on performance - managed code vs hand-tuned SIMD C++, right? So I benchmarked it against the real engines: same raw prompt (What is the capital of France?), greedy, 64 tokens, 4 threads, warmup + best-of-3, interleaved per model on one host.

ModelEngineLoad (s)TTFT (s)Decode (tok/s)
qwen2-0.5B Q8_0SharpMind6.20.2914.65
llama.cpp3.90.1114.24
dotLLM2.01.365.74
Llama-3.2-1B Q8_0SharpMind32.11.223.69
llama.cpp7.70.175.02
dotLLM3.32.853.23
gemma-3-270m Q8_0SharpMind3.10.1018.52
llama.cpp5.20.1320.28
dotLLM---
Qwen1.5-MoE-2.7B Q2_KSharpMind102.413.440.61
llama.cpp21.70.253.88
dotLLM---

(dotLLM DNF the last two - it only supports Llama/Mistral/Phi/Qwen/DeepSeek and no K-quants below Q4_K.)

A dependency-free C# engine that wins some metrics and matches the OG llama.cpp on others - int8-kv decode at 24.1 tok/s vs llama.cpp's 20.3 with(not shown) , TTFT cut ~30% on gemma-3, decode edge on qwen2, and a 6× MoE loss I fully expect and own. Respectable company for managed code, and if "no native installs" is your constraint, you no longer have to sacrifice everything

Open source: https://github.com/Integral2u/SharpMind.

18 Upvotes

6 comments sorted by

4

u/iezhy Oct 10 '26

Why are you running benchmark on those ancient models?

2

u/pixelwhippedme Oct 10 '26

AMD Ryzen 3 2200U (2C/4T, 2.5GHz base) w/ Radeon Vega Mobile Graphics, 12GB RAM.
But I'm trying to squeeze more out of it and get new ones working.

4

u/HyperWinX Oct 10 '26

And also it doesnt beat llama.cpp at all. Its many, many times worse. How tf do you read the table to make conclusions like that??

1

u/Icy_Rub6290 Oct 10 '26

The lightweight old model i think can denotes the newer one ot it maybe that op was lazy to download the sharp edged one or it mean that this can run old or new model idk

This is some guess and guts

4

u/Choice_Celery9481 Oct 10 '26

faster than llama.cpp. lol wtf

1

u/pixelwhippedme Oct 10 '26

Not often as the chart shows, did not expect it to but seeing the odd metric win I think is an accomplishment.