LLMValidation 1.0.0.3

dotnet add package LLMValidation --version 1.0.0.3
                    
NuGet\Install-Package LLMValidation -Version 1.0.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LLMValidation" Version="1.0.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LLMValidation" Version="1.0.0.3" />
                    
Directory.Packages.props
<PackageReference Include="LLMValidation" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LLMValidation --version 1.0.0.3
                    
#r "nuget: LLMValidation, 1.0.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LLMValidation@1.0.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LLMValidation&version=1.0.0.3
                    
Install as a Cake Addin
#tool nuget:?package=LLMValidation&version=1.0.0.3
                    
Install as a Cake Tool

📚 LLMValidator Documentation

💡 The Vision: AI Made Simple

The creation of Microsoft.Extensions.AI enables a bunch of possibilities to integrate AI packages and bring AI to your code. It makes AI accessible for developers without needing to know infrastructure details or complex setup procedures.

The result? Developers can use the benefits of AI with just one line of code.

LLMValidator brings the power of Large Language Models (LLMs) to your validation workflows. It complements traditional validation by handling scenarios where regex and algorithmic validation fall short - like grammar, tone, meaning, and context.

License: MIT .NET

📖 Documentation

Getting Started Integration Advanced
🎯 Quick Start 🔄 FluentValidation 🎭 Quality Variants
📝 Prompt Templates ⚙️ Configuration 🚀 Performance

LLMValidator is a .NET library that complements traditional validation by handling scenarios where regex and algorithmic validation fall short - like grammar, tone, meaning, and context.

// Traditional validation - Perfect for format validation
public bool IsValidEmailFormat(string email)
{
    var pattern = @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$";
    return Regex.IsMatch(email, pattern); // Fast, reliable, offline
}

// LLM validation - For things traditional validation can't handle
var result = await validator.ValidateAsync(emailContent, new LLMValidationOptions
{
    ValidationPrompt = "Check if this email is professional and follows business communication standards",
    ClientModelName = "gpt-4"
});

// Best practice: Combine both approaches
public async Task<bool> ValidateBusinessEmailAsync(string email, string content)
{
    // 1. Format validation first (fast, reliable)
    if (!IsValidEmailFormat(email))
        return false;

    // 2. Content validation with LLM (for nuanced checks)
    var contentResult = await validator.ValidateAsync(content, new LLMValidationOptions
    {
        ValidationPrompt = "Check if this email content is professional and appropriate",
        ClientModelName = "gpt-4"
    });

    return contentResult.IsValid;
}

✨ Key Features

  • 🧠 Natural Language Rules: Describe validation in plain English
  • ⚡ Quality Variants: Fast/Balanced/Accurate modes for different needs
  • 🔄 FluentValidation Integration: Works with existing validation
  • 📝 Built-in Templates: Grammar, tone, appropriateness, business content
  • 🎯 Multiple Models: OpenAI, Azure, Anthropic, local models

🌟 Why LLMValidator?

Traditional validation (regex, algorithms) is perfect for format/structure validation. LLM validation handles what traditional validation can't: grammar, tone, meaning, context.

Use both together for comprehensive validation.

📦 Installation

dotnet add package LLMValidation
dotnet add package LLMValidation.FluentValidation
dotnet add package Microsoft.Extensions.AI.OpenAI

🚀 Get Started

  1. Quick Start - 5-minute setup
  2. Prompt Templates - Available validation templates
  3. FluentValidation - Integration guide

🏆 Features

Built on Microsoft.Extensions.AI for maximum compatibility and extensibility. See the Configuration Guide for setup details including:

  • Multiple LLM Providers: OpenAI, Azure, Anthropic, Ollama, local models
  • Distributed Caching: Redis, SQL Server, Memory caching support
  • Dependency Injection: Clean resolver pattern, no service locator anti-patterns
  • .NET Aspire: Full orchestration support with automatic model setup
  • Extensible Architecture: Custom resolvers, validators, and prompt templates

For complete setup instructions, examples, and advanced configuration, see the 📖 Documentation above.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on LLMValidation:

Package Downloads
LLMValidation.FluentValidation

FluentValidation integration for LLMValidation. Enables intelligent string validation with any LLM provider using FluentValidation's fluent API.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0.3 262 10/26/2025
1.0.0.2 228 10/26/2025
1.0.0.1 222 10/26/2025