Skip to main content

Posts

Showing posts with the label AI & ML

Generative AI in .NET: Enterprise Architecture Patterns

Learn generative AI in .NET with proven enterprise patterns: RAG, function calling, IChatClient, resilience and cost control. Start building with C# today. Generative AI in .NET has moved from experiment to production requirement. In 2026, most enterprise teams building on C# are being asked to add chat assistants, document summarization, or intelligent search to existing line-of-business apps. The hard part is not calling a model. The hard part is doing it in a way that survives a compliance review, a traffic spike, and a vendor price change. This guide covers the architecture patterns that work for generative AI in .NET enterprise applications, with runnable C# examples and the pitfalls that catch most teams on their first project. Why Generative AI in .NET Needs Real Architecture A prototype that calls an LLM from a controller action works on a laptop. It fails in production for predictable reasons: Vendor lock-in. Model providers change pricing, deprecate models, and releas...

ML.NET Image Classification in C#: Train & Deploy a Model

Learn ML.NET image classification in C#. Train a custom image classifier with transfer learning, evaluate it, and deploy it in ASP.NET Core. Start now. ML.NET image classification lets you train a custom image classifier in pure C# without leaving the .NET ecosystem. You don't need Python, you don't need to hand-write a neural network, and you don't need a PhD. In this tutorial you'll build an image classification model in C# using transfer learning, evaluate it properly, save it, and deploy it behind an ASP.NET Core Web API. Along the way we'll cover why each step matters, the best practices that separate a demo from a production model, and the pitfalls that catch most developers the first time. What Is ML.NET Image Classification and Why Use It? ML.NET is Microsoft's open-source, cross-platform machine learning framework for .NET. Its image classification API wraps a TensorFlow-based training pipeline and exposes it through the same MLContext and IDataV...

Fine-Tune AI Models & Call Them From C# (2026 Guide)

Learn how to fine-tune AI models and call them from C# with OpenAI and Azure OpenAI. Step-by-step code examples inside — start building today. Why Fine-Tuning AI Models Matters for C# Developers Fine-tuning AI models is one of the most searched-for skills in modern software development — and for good reason. While base models like GPT-4o and Claude are impressively general, they don't know your company's tone of voice, your domain-specific terminology, or your internal classification rules. Fine-tuning solves this: you take a pre-trained model and continue training it on your own examples, producing a custom model that responds exactly the way your business needs. In this guide, you'll learn how fine-tuning works, when to use it (and when not to), how to prepare training data, how to run a fine-tuning job, and — most importantly for us — how to call your fine-tuned model from a C# application using .NET 8/9. Here's the WHY before the HOW: a fine-tuned smaller mode...

Build a Recommendation System in C# with ML.NET

Learn how to build a recommendation system in C# using ML.NET collaborative filtering. Step-by-step tutorial with full code — start building today. Every time Netflix suggests your next binge or Amazon shows you "customers also bought," you're seeing a recommendation system at work. These systems drive an enormous share of engagement and revenue for the world's biggest platforms — and thanks to ML.NET, you can build a production-ready recommendation system in C# without leaving the .NET ecosystem or writing a single line of Python. In this tutorial, you'll build a movie recommendation engine using collaborative filtering with ML.NET's matrix factorization trainer. We'll cover the theory (just enough to make smart decisions), the full working code, how to evaluate your model, and the pitfalls that trip up most developers on their first attempt. What Is a Recommendation System and How Does Collaborative Filtering Work? A recommendation system pre...

NLP with C# and ML.NET: Complete Guide with Examples

Learn natural language processing in C# with ML.NET: text classification, sentiment analysis, tokenization and TF-IDF with runnable code. Start building today. Natural language processing (NLP) in C# used to mean calling a Python service or a cloud API. That is no longer the case. With ML.NET , Microsoft's open-source machine learning framework for .NET, you can train and run natural language processing in C# entirely inside your own application—no Python, no external runtime, and no per-request fees. This complete guide walks through the core NLP concepts, builds a working sentiment analysis model, shows multi-class text classification, and covers the best practices and pitfalls you will hit in production. What Is Natural Language Processing in C# and Why ML.NET? NLP is the branch of machine learning that teaches software to understand human text: classifying reviews as positive or negative, routing support tickets, detecting spam, extracting topics, and more. Under the ho...

Azure AI Search with C# Tutorial: Build Smart Search (2026)

Learn Azure AI Search with C# step by step: create an index, upload documents, run full-text, semantic and vector search with the .NET SDK. Start building today. If your application still relies on WHERE Name LIKE '%term%' for search, your users are getting a worse experience than they deserve. Azure AI Search with C# (formerly Azure Cognitive Search) gives you a fully managed search engine that handles full-text ranking, typo tolerance, faceting, semantic re-ranking and vector similarity — all accessible from .NET through the Azure.Search.Documents SDK. In this tutorial you will build a working product search from scratch: create an index, upload documents, run keyword queries, add filters and facets, and finish with hybrid vector search that powers modern RAG (Retrieval-Augmented Generation) applications. Everything here runs on .NET 8/9 with the current stable SDK, and every code sample is complete enough to paste into a console app and run. What Is Azure AI Searc...