ReviDotNet 0.1.0
dotnet add package ReviDotNet --version 0.1.0
NuGet\Install-Package ReviDotNet -Version 0.1.0
<PackageReference Include="ReviDotNet" Version="0.1.0" />
<PackageVersion Include="ReviDotNet" Version="0.1.0" />
<PackageReference Include="ReviDotNet" />
paket add ReviDotNet --version 0.1.0
#r "nuget: ReviDotNet, 0.1.0"
#:package ReviDotNet@0.1.0
#addin nuget:?package=ReviDotNet&version=0.1.0
#tool nuget:?package=ReviDotNet&version=0.1.0
ReviDotNet
ReviDotNet is a .NET library that makes working with modern LLMs straightforward, safe, and easily configurable. It separates prompt logic, provider connections, and model settings into simple repository files, adds resilience (retries, validators, output fixers), and provides Roslyn analyzers to catch mistakes at build time.
Note: ReviDotNet is still in development and some features may not be fully implemented yet.
Features
- Configuration-as-files (kept in your repo)
- Prompts:
.pmtfiles with sections for[[information]],[[settings]],[[tuning]], raw prompt content, and examples - Providers:
.rcfgfiles describing API host, keys, and protocol per provider - Models:
.rcfgfiles describing model profiles (limits, defaults, overrides)
- Prompts:
- Supports multiple providers and models with configurable model routing
- Chat and prompt completion interfaces (automatically chosen or forced per prompt/model)
- Agent orchestration via
.agentfiles (state loops, transitions, tool gating, guardrails) - Structured output guidance options (JSON/Regex/GBNF – manual and auto variants)
- Resilience: retries, timeout control, token accounting, safe JSON extraction from Markdown
- Built‑in fixers for common issues (e.g.,
json-fixerandenum-fixerprompts) - Input filtering and optional safety canary to detect injection attempts
- Simple, strongly-typed inference API:
ToObject<T>,ToEnum<TEnum>,ToStringList,ToStringListLimited,ToBool,ToString, streaming viaCompletionStream - First-class Roslyn analyzers for prompt and agent validation (
REVI001,REVI006,REVI007,REVI008) - Embeddings support via model profiles dedicated to embeddings
Why ReviDotNet?
ReviDotNet was built for ease of use with a combination of unique features that prioritize repository-centric configuration, compile-time safety, and built-in resilience. While other libraries provide broad abstractions, ReviDotNet focuses on a structured, file-based approach that keeps your prompts and model settings versioned alongside your code.
| Feature | ReviDotNet | Semantic Kernel | MEAI | LangChain.NET |
|---|---|---|---|---|
File-based prompt config (.pmt/.yaml) |
✅ Rich | ✅ Basic | ❌ | ❌ |
| File-based provider/model config | ✅ .rcfg |
⚠️ appsettings |
⚠️ Code | ⚠️ Code |
| Built-in agent orchestration | ✅ Full | ✅ Full | ⚠️ Partial | ⚠️ Partial |
| Built-in model routing | ✅ | ❌ | ❌ | ❌ |
| Roslyn compile-time analyzer | ✅ | ❌ | ❌ | ❌ |
| Strongly-typed inference API | ✅ | ✅ | ⚠️ | ⚠️ |
| Built-in JSON/enum fixers | ✅ | ⚠️ | ❌ | ❌ |
| Injection canary | ✅ | ❌ | ❌ | ❌ |
| Embeddings | ✅ | ✅ | ✅ | ✅ |
| Streaming | ✅ | ✅ | ✅ | ✅ |
| Multi-provider | ✅ | ✅ | ✅ | ✅ |
Repository layout (ReviDotNet)
ReviDotNet.Core– main runtime (config parsing, providers, models, inference API)ReviDotNet.Analyzers– Roslyn analyzers (prompt/agent validation at compile time)ReviDotNet.Tests– unit tests and helpers
Your app’s configuration files typically live under an RConfigs folder in your project:
RConfigs/Prompts–.pmtprompt files (any subfolders)RConfigs/Agents–.agentorchestration files (any subfolders)RConfigs/Providers– provider.rcfgfilesRConfigs/Models/Inference– inference model.rcfgfilesRConfigs/Models/Embedding– embedding model.rcfgfiles
Documentation
The core docs are in this repo:
- Prompt files:
ReviDotNet.Core/Docs/prompt-files.md - Agent files:
ReviDotNet.Core/Docs/agent-files.md - Provider files:
ReviDotNet.Core/Docs/provider-files.md - Model files:
ReviDotNet.Core/Docs/model-files.md - Inference API:
ReviDotNet.Core/Docs/inference.md - Analyzers:
ReviDotNet.Core/Docs/analyzers.md
Quick start
- Add ReviDotNet to your solution
- Reference the
ReviDotNet.Coreproject (or consume the package if you publish it internally). - (Recommended) Add the analyzers to projects that call the
Infer.*API:
<ItemGroup>
<PackageReference Include="ReviDotNet.Analyzers" Version="1.*" PrivateAssets="all" />
</ItemGroup>
- Create minimal configuration files in your app repo
- Provider (
RConfigs/Providers/claude.rcfg):
[[general]]
name = claude
enabled = true
protocol = Claude
api-url = https://api.anthropic.com/
api-key = environment
default-model = claude-3-5-sonnet-latest
supports-prompt-completion = true
Environment variables for API keys follow: PROVAPIKEY__CLAUDE (uppercase, hyphens/spaces to underscores). See ReviDotNet.Core/Docs/provider-files.md.
- Model (
RConfigs/Models/Inference/anth_sonnet_35.rcfg):
[[general]]
name = anth_sonnet_35
enabled = true
model-string = claude-3-5-sonnet-latest
provider-name = claude
[[settings]]
tier = A
token-limit = 100000
- Prompt (
RConfigs/Prompts/Search/analyze-specs.pmt):
[[information]]
name = analyze-specs
version = 1
[[settings]]
request-json = false
[[_system]]
You are a helpful assistant.
[[_instruction]]
Analyze the following specs and provide 3 bullet points.
[[_exin_1]]
[Specs]
The system should be fast.
[[_exout_1]]
- Low latency
- Efficient
- Responsive
- Call the API from C#
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Revi;
public static class Demo
{
public static async Task RunAsync(CancellationToken token = default)
{
List<Input> inputs =
[
new Input("Specs", "Users need a clean and fast UI.")
];
// Get raw text
string? text = await Infer.ToString("search/analyze-specs", inputs, token: token);
// Get a list of strings
List<string> points = await Infer.ToStringList("search/analyze-specs", inputs, token: token);
// Stream output (concatenate chunks)
StringBuilder builder = new StringBuilder();
await foreach (string chunk in Infer.CompletionStream("search/analyze-specs", inputs, token: token))
{
builder.Append(chunk);
}
// Strongly-typed object
AnalysisResult? result = await Infer.ToObject<AnalysisResult>(
"search/analyze-specs",
inputs,
modelName: null,
token: token);
}
public sealed class AnalysisResult
{
public List<string> Points { get; set; } = new List<string>();
}
}
Notes
- Prompt names are resolved as:
<lower-cased-subfolder(s)>/<[[information]] name>; the physical filename is not used for matching. SeeReviDotNet.Core/Docs/analyzers.md. - Use
ToEnum<TEnum>for constrained label tasks; passincludeEnumValues: trueto inject valid options. - When
request-json = trueor a guidance schema is enabled,ToObject<T>will validate and repair common JSON issues. ToStringListLimitedallows early stop based on count or a custom evaluator.
Analyzer integration (REVI001, REVI006, REVI007, REVI008)
The ReviDotNet.Analyzers package validates prompt and agent usage at compile time.
REVI001: prompt not found inRConfigs/PromptsREVI006: agent not found inRConfigs/AgentsREVI007: duplicate effective agent namesREVI008: non-constant agent name inAgent.Run/Agent.ToString/Agent.FindAgent
To enable prompt validation, include your .pmt files as AdditionalFiles in the projects that compile the calling code:
<Project>
<ItemGroup>
<AdditionalFiles Include="RConfigs\Prompts\**\*.pmt" />
</ItemGroup>
</Project>
If you use agent orchestration, include .agent files too so agent-related analyzer rules can run:
<Project>
<ItemGroup>
<AdditionalFiles Include="RConfigs\Agents\**\*.agent" />
</ItemGroup>
</Project>
See ReviDotNet.Core/Docs/analyzers.md for details and troubleshooting.
Configuration & secrets
- Non-secret runtime settings should go through your app’s runtime configuration mechanism (e.g., a
RuntimeConfigService). - Provider API keys are read from environment variables when you specify
api-key = environmentin the provider.rcfg. SeeReviDotNet.Core/Docs/provider-files.mdfor the exact variable naming convention.
Embeddings
Define embedding model profiles under RConfigs/Models/Embedding and use them where vectorization is required. See ReviDotNet.Core/Docs/model-files.md for the supported options (dimensions, encoding-format, task-type, etc.).
Testing
- The
ReviDotNet.Testsproject contains examples and helpers. You can substitute a fake or local provider during tests. - Consider using CI with analyzers enabled and
-warnaserror+to keep configuration drift from reaching production.
Roadmap / Contributions
Open issues or pull requests with:
- Additional analyzer rules (e.g., checking input label mismatches, guidance schema drift)
- New provider protocols
- Samples/tutorials
License
See LICENSE.txt at the repository root of this solution for licensing details pertaining to Revision Labs code.
| Product | Versions 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. |
-
net9.0
- Ben.Demystifier (>= 0.4.1)
- JsonSchema.Net.Generation (>= 4.5.1)
- Microsoft.DeepDev.TokenizerLib (>= 1.3.3)
- Microsoft.Extensions.Configuration (>= 9.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging (>= 9.0.0)
- MongoDB.Driver (>= 3.1.0)
- Newtonsoft.Json (>= 13.0.3)
- Newtonsoft.Json.Schema (>= 4.0.1)
- YamlDotNet (>= 16.1.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 126 | 4/29/2026 |