BitNet b1.58 Sharp is a .NET 10 C# reference implementation of the paper-aligned BitNet b1.58 decoder-only transformer architecture with ternary -1/0/+1 weights, BitLinear projections, RoPE, RMSNorm, SwiGLU, and Microsoft Agent Framework-oriented hosting.
- A paper-aligned BitNet core model in
/src/BitNetSharp.Core - A decoder-only transformer implementation with
BitLinear,RmsNorm, RoPE, causal attention, SwiGLU, andBitNetTransformer - Microsoft Agent Framework-oriented hosting in
/src/BitNetSharp.App - BenchmarkDotNet-based local model comparison in
/src/BitNetSharp.App - DataGen synthetic dataset generation from JSON seed examples
- Chain-Bucket Speculative Decoding and Training-Time Sequence Compression via the bucketing subsystem
- Default American English interaction behavior
- Seeded transformer inspection and ternary weight summaries
- GitBook-formatted project documentation in
/docs
dotnet build BitNet-b1.58-Sharp.slnx
dotnet run --project src/BitNetSharp.App/BitNetSharp.App.csproj -- chat "hello"
dotnet run --project src/BitNetSharp.App/BitNetSharp.App.csproj -- datagen --domain "customer-support" --count 10 --seeds examples/seed-examples.json --output data/customer-support.jsonl
dotnet run --project src/BitNetSharp.App/BitNetSharp.App.csproj -- visualize
dotnet test BitNet-b1.58-Sharp.slnx- Architecture
- Azure DevOps pipelines
- Benchmarking and model comparison
- Bucketing guide
- Bucketing implementation plan v1.0
- DataGen guide
- Implementation plan
- Full implementation plan: real training + benchmarks + purity v1.0
- Real training implementation plan v1.0
- Releases and packaging
- Repository alignment guidelines
- Usage
- Training and visualization
- Distributed training (coordinator + workers)
- Training corpus scope and sources
- Scaling TruckMate corpus v1.0 (v1 → v2)
- State of completion and remaining work