ElBruno.S1Mini
0.1.0
See the version list below for details.
dotnet add package ElBruno.S1Mini --version 0.1.0
NuGet\Install-Package ElBruno.S1Mini -Version 0.1.0
<PackageReference Include="ElBruno.S1Mini" Version="0.1.0" />
<PackageVersion Include="ElBruno.S1Mini" Version="0.1.0" />
<PackageReference Include="ElBruno.S1Mini" />
paket add ElBruno.S1Mini --version 0.1.0
#r "nuget: ElBruno.S1Mini, 0.1.0"
#:package ElBruno.S1Mini@0.1.0
#addin nuget:?package=ElBruno.S1Mini&version=0.1.0
#tool nuget:?package=ElBruno.S1Mini&version=0.1.0
ElBruno.S1Mini
Local ASR transcript normalizer for .NET ๐งน
Clean raw speech-to-text transcripts into well-formed written text in .NET. Powered by superwhisper/s1-mini (a 0.6B Qwen3 fine-tune) running locally via ONNX Runtime GenAI. Auto-downloads the INT4 ONNX model from HuggingFace.
โ ๏ธ s1-mini is not a chat model. It performs exactly one task โ normalizing an ASR transcript. Give it anything else and you get unpredictable output.
Packages
| Package | NuGet | Downloads | Description |
|---|---|---|---|
ElBruno.S1Mini |
Self-contained transcript normalizer with S1MiniClient (IChatClient) and TranscriptNormalizer. |
Features
- ๐งน Filler removal + punctuation + capitalization in one call
- ๐ Self-correction resolution โ
"nine am no sorry ten thirty"becomes10:30 - ๐ข Written form for spoken numbers, dates, times, currency, emails
- ๐๏ธ Control-line settings โ
Styling(formal / semi-formal / casual) andContext(general / email) with empirically verified behavior - ๐ฆ Auto-download โ INT4 ONNX model fetched from HuggingFace on first use
- ๐งต
IChatClientcompatible โS1MiniClientplugs intoMicrosoft.Extensions.AI - ๐ DI-friendly โ
AddTranscriptNormalizer()for ASP.NET Core - ๐ช Chunking helper โ
NormalizeChunkedAsyncfor transcripts longer than the ~1,000-token recommended input - ๐ Empty-in / empty-out โ pure filler returns
string.Empty, as the model card documents - ๐ฆบ Temperature-0 safe โ the ORT-GenAI native divide-by-zero trap is guarded at the runtime layer so callers can always use greedy decoding
Installation
dotnet add package ElBruno.S1Mini
Quick Start
using ElBruno.S1Mini.Normalization;
// Downloads elbruno/s1-mini-onnx (int4) on first run.
using var normalizer = await TranscriptNormalizer.CreateAsync();
var cleaned = await normalizer.NormalizeAsync(
"so um i need to like send the the report by uh friday no wait make that thursday");
Console.WriteLine(cleaned);
// So I need to send the report by Thursday.
Control-line options
using ElBruno.S1Mini.Normalization;
var cleaned = await normalizer.NormalizeAsync(
transcript,
new TranscriptNormalizerOptions
{
Styling = TranscriptStyling.Formal,
Context = TranscriptContext.Email,
});
Empirically verified against the real INT4 model:
Styling:SemiFormal(default),Formal,Casualโ all three produce distinct output.Structure:Prose(default),Listsโ caveat:Listsdid not reliably produce Markdown bullets in testing; output stayed prose. Kept as a model-card value.Context:General(default),Emailโ distinct.MessageandNotesare accepted but empirically behave identically toGeneral; kept for API completeness.
See docs/transcript-normalization.md for the full behavior table and before/after examples.
Dependency Injection
using ElBruno.S1Mini;
builder.Services.AddTranscriptNormalizer(options =>
{
options.CacheDirectory = @"C:\models";
});
TranscriptNormalizer is registered as its own service type โ not as IChatClient. s1-mini is not a chat model, and exposing it as one would mislead consumers expecting chat semantics.
Compose with any IChatClient
TranscriptNormalizer is a control-line + prompt-builder layer over any IChatClient. Supply your own client (as long as it is really pointed at s1-mini):
using ElBruno.S1Mini;
using ElBruno.S1Mini.Normalization;
using var chatClient = await S1MiniClient.CreateAsync();
using var normalizer = new TranscriptNormalizer(chatClient);
S1MiniClient also implements IChatClient directly, so you can plug it into any Microsoft.Extensions.AI pipeline โ with the caveat that it only handles the exact prompt shape s1-mini was fine-tuned on.
Chunking long transcripts
var cleaned = await normalizer.NormalizeChunkedAsync(longTranscript, maxCharsPerChunk: 3500);
Each chunk is normalized statelessly at sentence boundaries; for tighter control on transcripts with context spanning boundaries, chunk manually at a natural pause instead.
FP16 is currently broken on CPU
elbruno/s1-mini-onnx also has an fp16/ subfolder, but that variant fails at inference on CPU with onnxruntime-genai 0.15.1 (upstream ORT GQA repeat_kv Reshape shape-mismatch bug). Use INT4 (the default). This library will not switch to FP16 automatically.
Model license
superwhisper/s1-mini is Apache-2.0 with a naming clause. The converted ONNX artifacts (elbruno/s1-mini-onnx) are an explicitly unofficial, unaffiliated, non-endorsed derivative. ElBruno.S1Mini's C# code is MIT; the downloaded model weights remain under the upstream Apache-2.0 license. Vendor quality claim: 94.8% token accuracy on 7,519 held-out English cases (Superwhisper's measurement, not independently re-verified here). English only, v1.
Building from Source
git clone https://github.com/elbruno/ElBruno.S1Mini
cd ElBruno.S1Mini
dotnet build ElBruno.S1Mini.slnx
dotnet test ElBruno.S1Mini.slnx --framework net8.0
What's New
- ๐
v0.1.0โ Initial release:TranscriptNormalizerAPI with styling/structure/context control line, chunking helper, and DI extension. - ๐งต
S1MiniClientโ self-containedIChatClientimplementation with automatic HuggingFace download ofelbruno/s1-mini-onnx(int4). - ๐งช Qwen3 non-thinking prompt format โ ported verbatim from the model's own
chat_template.jinja, verified byte-for-byte against the real model. - ๐ฆบ ORT-GenAI temperature-0 crash guard โ the native
temperature=0divide-by-zero trap is guarded at the runtime layer; greedy decoding is safe for every call. - ๐ฌ Empirically-verified control-line documentation โ enum XML docs and README table reflect what the real INT4 model actually does, including the
lists/message/notescaveats.
Documentation
- Getting Started โ installation, first steps, configuration
- Transcript Normalization โ full API guide, control-line reference, empirical behavior table
Samples
| Sample | Description |
|---|---|
| HelloS1Mini | Console sample covering default normalization, Context.Email, Structure.Lists, and pure-filler input. |
Testing
dotnet test ElBruno.S1Mini.slnx --framework net8.0
Tests use a fake IChatClient and a recording IGenerationSearchOptions seam โ no model downloads, no network, no GPU required.
๐ License
MIT โ see LICENSE. The downloaded s1-mini model weights are Apache-2.0 (upstream), not MIT.
๐ Acknowledgments
superwhisper/s1-miniโ the fine-tuned ASR normalizer this library wraps. All model design and training credit belongs to the Superwhisper team.Qwen/Qwen3-0.6Bโ the base model s1-mini is fine-tuned from.- ONNX Runtime GenAI โ inference engine.
- Hugging Face โ model hosting.
- Microsoft.Extensions.AI โ the
IChatClientcontract this library implements.
Related Projects
- ElBruno.LocalLLMs โ Run local LLMs in .NET
- ElBruno.Whisper โ Local Whisper speech-to-text in .NET
- ElBruno.HuggingFace โ HuggingFace model utilities for .NET
๐ About the Author
Hi! I'm ElBruno ๐งก, a passionate developer and content creator exploring AI, .NET, and modern development practices.
- ๐ป Blog: ElBruno.com
- ๐บ YouTube: youtube.com/@inthelabs
- ๐ LinkedIn: linkedin.com/in/inthelabs
- ๐ Twitter: @inthelabs
- ๐๏ธ Podcast: inthelabs.dev
Made with โค๏ธ by ElBruno
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- ElBruno.HuggingFace.Downloader (>= 0.6.0)
- Microsoft.Extensions.AI.Abstractions (>= 10.7.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.ML.OnnxRuntimeGenAI (>= 0.15.1)
-
net8.0
- ElBruno.HuggingFace.Downloader (>= 0.6.0)
- Microsoft.Extensions.AI.Abstractions (>= 10.7.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.ML.OnnxRuntimeGenAI (>= 0.15.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.