PromptVit 1.1.1
dotnet add package PromptVit --version 1.1.1
NuGet\Install-Package PromptVit -Version 1.1.1
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="PromptVit" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PromptVit" Version="1.1.1" />
<PackageReference Include="PromptVit" />
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 PromptVit --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PromptVit, 1.1.1"
#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 PromptVit@1.1.1
#: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=PromptVit&version=1.1.1
#tool nuget:?package=PromptVit&version=1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
PromptVit
Lightweight multi-provider LLM client for .NET
PromptVit is a modern, lightweight C# library that simplifies calls to major generative AI inference providers (OpenAI, Google Gemini, HuggingFace, Groq, etc.) from your .NET applications. It offers a unified, intuitive, and high-performance API to:
- Send simple or complex prompts
- Handle streaming responses (Server-Sent Events)
- Use tool/function calling in a standardized way
- Easily switch between different providers without changing your business logic
✨ Why PromptVit ?
- Ultra-lightweight: no unnecessary dependencies, no heavy SDKs
- Unified API: same code for OpenAI, Gemini, Claude, Groq…
- Native streaming: full support for real-time responses
- Standardized tool calls: JSON Schema format compatible with most providers
- Easy switching: switch providers in one line of configuration
- History persistence: save and reload chat history across sessions with a single call
- Strongly typed: well-typed messages, tools, responses, and errors
- High-performance: designed for production use (retry, timeout, logging)
Installation
dotnet add package PromptVit
Example
Simple chat
var aiClient = PromptVitFactory.CreateGoogleAIStudioClient("your_token", "gemini-3.1-flash-lite-preview");
aiClient.SetSystemPrompt("You are an AI assistant expert in cooking. You can answer to every questions related to cooking but cannot answer to anything else.");
var userInput = "How to make a Tiramisu ?";
var response = await aiClient.Invoke(userInput);
Chat with stream
var aiClient = PromptVitFactory.CreateGoogleAIStudioClient("your_token", "gemini-3.1-flash-lite-preview");
aiClient.OnStreamChunkReceived += async (s, chunk) =>
{
Console.Write(chunk);
};
aiClient.SetSystemPrompt("You are an AI assistant expert in cooking. You can answer to every questions related to cooking but cannot answer to anything else.");
var userInput = "How to make a Tiramisu ?";
var response = await aiClient.Invoke(userInput, true);
Tool calling
var aiClient = PromptVitFactory.CreateGoogleAIStudioClient("your_token", "gemini-3.1-flash-lite-preview");
aiClient.SetSystemPrompt("You are an AI assistant that can give live weather information. You always use available tools to answer to user request.");
aiClient.SetTools([
new AITool<string, WeatherArgs>("getWeather", "Retrieves weather for a given location",
[
new AIToolParameter("location", "a city location (example: Paris, France)", "string")
],
async (arg) => await GetWeather(arg.Location))
]);
var userInput = "What is the weather in Madrid ?";
var response = await aiClient.Invoke(userInput);
static async Task<string> GetWeather(string location)
{
return "the temperature is 15°C with a clear sky for the whole day";
}
class WeatherArgs
{
public string Location { get; set; }
}
Save / load chat history
var aiClient = PromptVitFactory.CreateGoogleAIStudioClient("your_token", "gemini-3.1-flash-lite-preview");
aiClient.SetSystemPrompt("You are an AI assistant expert in cooking.");
await aiClient.Invoke("How to make a Tiramisu ?");
await aiClient.SaveHistoryAsync("history.txt");
// Later, reload the conversation context
await aiClient.LoadHistoryAsync("history.txt");
await aiClient.Invoke("What was the first dessert I asked about?");
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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.
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.