7,300+ 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 to RAG pipelines, computer vision to reinforcement learning — with custom GPU kernels that are up 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 Downloads GitHub Stars .NET 10 + .NET Framework 4.7.1 Apache 2.0 Licensed

Faster than PyTorch. On any GPU.

AiDotNet.Tensors ships custom GPU kernels built on ILGPU — no CUDA lock-in. Your code runs on NVIDIA, AMD, and Intel 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 via ILGPU for NVIDIA, AMD, and Intel GPUs. Up to 500x GEMM speedup, 200x Conv2D. Adaptive CPU/GPU routing.

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 AiDotNet ML.NET TorchSharp PyTorch
Language Pure C# C# + ONNX C# wrapper Python
Neural Network Layers 160+ ~10 50+ 100+
Classical ML Algorithms 155+ ~30 None None
Computer Vision Models 115+ Limited Via LibTorch Via torchvision
Vision-Language Models 165+ None None Via HF
Diffusion Models 75+ None None Via diffusers
Audio / Speech / TTS 250+ None Limited Via torchaudio
Reinforcement Learning 50+ None Manual Via SB3
GPU Support Any GPU (ILGPU) ONNX only CUDA only CUDA only
Federated Learning 180+ None None Via Flower
Model Serving Built-in Manual None TorchServe
Runtime Dependency None None ~700MB LibTorch Python 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
ILGPU
Custom GPU kernels for any GPU vendor

From training to production

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

AiDotNet

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

Training Inference AiModelBuilder

AiDotNet.Tensors

Custom GPU kernels via ILGPU. Works on NVIDIA, AMD, and Intel GPUs. Adaptive CPU/GPU routing for optimal performance.

GPU Kernels ILGPU Any GPU

AiDotNet.Serving

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

REST API Encryption Stripe

Ready to build AI in .NET?

Install from NuGet and start training models in minutes. The full library is free and open source.