8,100+ classes • 139 modules • Pure C# • Open Source

The complete AI platform
for .NET developers.

Train, serve, and monetize AI models entirely in C#. From neural networks toRAG pipelines,computer vision toreinforcement learning — with custom GPU kernels that areup to 500x faster than PyTorch. No Python. No wrappers. No compromises.

$dotnet add package AiDotNet
0
x GPU Speedup vs PyTorch
0
Public Classes
0
AI/ML Modules
0
Python Dependencies
NuGet DownloadsGitHub Stars.NET 10 + .NET Framework 4.7.1BSL 1.1 Licensed

Faster than PyTorch. On any GPU.

AiDotNet.Tensors ships hand-tuned GPU kernels via CUDA, OpenCL, HIP, Metal, Vulkan, and WebGPU — no CUDA lock-in, no third-party GPU libraries. Your code runs on NVIDIA, AMD, Intel, and Apple GPUs with zero configuration.

500x
GEMM (2048x2048)
Matrix multiplication speedup vs CPU
200x
Conv2D
Convolution speedup for vision models
100x
GEMV
Matrix-vector multiply speedup
40x
MaxPool2D
Pooling layer speedup

Adaptive thresholds automatically route small operations to CPU and large operations to GPU for optimal performance.

NVIDIA (CUDA)AMD (OpenCL)Intel (OpenCL)CPU (SIMD/AVX-512)

Every AI domain. One NuGet package.

139 modules covering neural networks, classical ML, computer vision, audio, NLP, reinforcement learning, model serving, and more.

Any GPU

GPU Acceleration

Custom GPU kernels for NVIDIA, AMD, Intel, and Apple GPUs via CUDA, OpenCL, HIP, Metal, Vulkan, and WebGPU. Up to 500x GEMM speedup. Faster than PyTorch.

160+

Neural Networks

CNN, RNN, Transformer, GAN, VAE, GNN, Diffusion, NeRF and more. 160 layer types covering every major architecture.

115+

Computer Vision

YOLO v8-11, DETR, RT-DETR, SAM/SAM2, segmentation, OCR, text detection. Full detection-to-recognition pipeline.

75+

Diffusion & Generation

40+ image diffusion models (SD, SDXL, SD3, Flux, ControlNet), 29 video generation models, 7 audio diffusion models.

155+

Classical ML

50 classifiers, 57 regressors, 48 clustering algorithms. Complete traditional ML toolkit with AutoML and NAS.

250+

Audio & Speech

Speech recognition, text-to-speech, music generation, audio classification. 250+ implementations across the full audio pipeline.

165+

Vision-Language Models

LLaVA, InternVL, CLIP, DINOv2/v3, Florence2, Qwen-VL. Instruction-tuned VLMs and vision encoders.

50+ agents

Reinforcement Learning

DQN, PPO, SAC, A3C, TD3, MuZero, Decision Transformer, MADDPG. 50+ agents for games, robotics and optimization.

Full stack

Model Serving & API

Production REST API with AiDotNet.Serving. Model encryption, license management, API key auth, Stripe billing. Deploy your AI as a product.

50+ adapters

LoRA Fine-tuning

LoRA, QLoRA, DoRA, AdaLoRA, VeRA, MoRA and more adapters plus training strategies. Fine-tune models with minimal compute.

180+

Federated & Distributed

FedAvg, FedProx, scaffold, and 30+ distributed training strategies. Train across hospitals, banks, or edge devices while keeping data private.

30+ models

NER & NLP

BERT, BioBERT, FinBERT, LegalBERT, DeBERTa and 30+ named entity recognition models. BiLSTM-CRF, span-based and transformer NER.

One API for everything

AiModelBuilder is a single fluent API with 130+ configuration methods. Simple for beginners, fully customizable for experts.

var result = await new AiModelBuilder<double, double[], double>()
    .ConfigureModel(new RandomForestClassifier<double>(nEstimators: 100))
    .ConfigurePreprocessing()
    .BuildAsync(features, labels);

var prediction = result.Predict(newSample); // That's it.

How we compare

AiDotNet is the only .NET platform that covers training, serving, and monetization. No compromises.

Feature comparison between AiDotNet, ML.NET, TorchSharp, and PyTorch
FeatureAiDotNetML.NETTorchSharpPyTorch
LanguagePure C#C# + ONNXC# wrapperPython
Neural Network Layers160+~1050+100+
Classical ML Algorithms155+~30NoneNone
Computer Vision Models115+LimitedVia LibTorchVia torchvision
Vision-Language Models165+NoneNoneVia HF
Diffusion Models75+NoneNoneVia diffusers
Audio / Speech / TTS250+NoneLimitedVia torchaudio
Reinforcement Learning50+NoneManualVia SB3
GPU SupportAny GPU (6 backends)ONNX onlyCUDA onlyCUDA only
Federated Learning180+NoneNoneVia Flower
Model ServingBuilt-inManualNoneTorchServe
Runtime DependencyNoneNone~700MB LibTorchPython runtime

Why not TorchSharp?

  • ~700MB LibTorch runtime dependency
  • Slow startup loading PyTorch runtime
  • Array copying between .NET and LibTorch
  • No classical ML, no AutoML, no serving

Why not ML.NET?

  • Only ~10 neural network architectures
  • No computer vision, audio, VLMs, or RL
  • No GPU acceleration or custom kernels
  • No model serving or monetization tools

Why not Python?

  • GIL limits real concurrency
  • Separate runtime in production stack
  • No native .NET type safety or AOT
  • Separate team/skills from your .NET devs

Native .NET performance

No Python runtime. No C++ interop. Pure .NET speed with hardware-level optimizations.

SIMD
AVX2/AVX-512 vectorized tensor operations
Span<T>
Zero-copy memory operations throughout
AOT
Ahead-of-time compilation support
6 GPU APIs
CUDA, OpenCL, HIP, Metal, Vulkan, WebGPU

From training to production

AiDotNet covers the entire lifecycle. Train models, deploy as APIs, and manage customers — all in .NET.

AiDotNet

The core library. 8,100+ classes for training, inference, and experimentation. Install from NuGet and start building.

TrainingInferenceAiModelBuilder

AiDotNet.Tensors

Hand-tuned GPU kernels via P/Invoke. CUDA, OpenCL, HIP, Metal, Vulkan, and WebGPU backends. Adaptive CPU/GPU routing for optimal performance.

GPU Kernels6 BackendsAny GPU

AiDotNet.Serving

Deploy models as REST APIs. Encrypted model protection, API key auth, license management, and Stripe billing built in.

REST APIEncryptionStripe

Ready to build AI in .NET?

Install from NuGet and start training models in minutes. Training and inference are always free.