LMSupply.Generator
0.40.1
See the version list below for details.
dotnet add package LMSupply.Generator --version 0.40.1
NuGet\Install-Package LMSupply.Generator -Version 0.40.1
<PackageReference Include="LMSupply.Generator" Version="0.40.1" />
<PackageVersion Include="LMSupply.Generator" Version="0.40.1" />
<PackageReference Include="LMSupply.Generator" />
paket add LMSupply.Generator --version 0.40.1
#r "nuget: LMSupply.Generator, 0.40.1"
#:package LMSupply.Generator@0.40.1
#addin nuget:?package=LMSupply.Generator&version=0.40.1
#tool nuget:?package=LMSupply.Generator&version=0.40.1
LMSupply.Generator
Local text generation and chat with ONNX Runtime GenAI and GGUF (llama-server).
Features
- Zero-config: Models download automatically from HuggingFace
- GPU Acceleration: CUDA, Vulkan, DirectML, CoreML, Metal
- GGUF Support: Load any GGUF model via llama-server (auto-downloaded)
- Server Pooling: Reuses llama-server instances for fast model switching
- MIT Models: Phi-4 and Phi-3.5 models with no usage restrictions
- Chat Support: Built-in chat formatters for various models
Quick Start
using LMSupply.Generator;
// Using the builder pattern
var generator = await TextGeneratorBuilder.Create()
.WithDefaultModel()
.BuildAsync();
// Generate text
string response = await generator.GenerateCompleteAsync("What is AI?");
Console.WriteLine(response);
await generator.DisposeAsync();
Chat Completion
var messages = new[]
{
new ChatMessage(ChatRole.System, "You are a helpful assistant."),
new ChatMessage(ChatRole.User, "Explain quantum computing.")
};
string response = await generator.GenerateChatCompleteAsync(messages);
Available Models
| Model | Parameters | License | Description |
|---|---|---|---|
| Phi-4 Mini | 3.8B | MIT | Default, best balance |
| Phi-3.5 Mini | 3.8B | MIT | Fast, reliable |
| Phi-4 | 14B | MIT | Highest quality |
| Llama 3.2 1B | 1B | Conditional | Ultra-lightweight |
| Llama 3.2 3B | 3B | Conditional | Balanced |
GPU Acceleration
# NVIDIA GPU
dotnet add package Microsoft.ML.OnnxRuntime.Gpu
# Windows (AMD/Intel/NVIDIA)
dotnet add package Microsoft.ML.OnnxRuntime.DirectML
Advanced GGUF Tuning
Fine-grained llama-server control (GPU offload, batch size, RoPE/YaRN scaling, KV cache
quantization, speculative decoding, LoRA, and more) is available via LlamaOptions:
var generator = await TextGeneratorBuilder.Create()
.WithDefaultModel()
.WithLlamaOptions(new LlamaOptions
{
GpuLayerCount = -1,
AdditionalArgs = ["--verbose"], // raw llama-server CLI passthrough for flags not modeled above
})
.BuildAsync();
Pinning or pre-provisioning the llama-server binary
By default, the llama-server binary itself (not the model) is acquired from an unauthenticated,
unpinned GitHub Releases "latest" lookup on first use. For offline, air-gapped, or
security-reviewed deployments, ServerUpdateOptions lets a consumer take over that acquisition:
var generator = await TextGeneratorBuilder.Create()
.WithDefaultModel()
.WithServerUpdateOptions(new LlamaServerUpdateOptions
{
// Pin an exact release tag — a cache hit makes zero network calls; a cache miss downloads
// exactly this tagged asset instead of "latest". A pinned installation also never
// auto-checks for or applies a newer version.
PinnedVersion = "b7898",
// Or bypass acquisition entirely by pointing at an already-provisioned binary — takes
// precedence over PinnedVersion when both are set.
// ServerBinaryPath = "/opt/myapp/bin/llama-server",
})
.BuildAsync();
Reuse the same LlamaServerUpdateOptions instance across loads (rather than constructing a new one
each time) so they share one background-update timer and state file instead of each spawning its
own. EmbedderOptions.ServerUpdateOptions and RerankerOptions.ServerUpdateOptions follow the same
shape for the embedding and reranking GGUF paths.
| 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. |
-
net10.0
- LMSupply.Core (>= 0.40.1)
- LMSupply.Llama (>= 0.40.1)
- Microsoft.ML.OnnxRuntimeGenAI (>= 0.13.2)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on LMSupply.Generator:
| Package | Downloads |
|---|---|
|
FluxIndex.Providers.LMSupply
LMSupply local AI embedding, reranking, and text completion provider for FluxIndex |
|
|
IronProw.LMSupply
iron-prow local-provider safety adapter: model-ID preflight, readiness gate, and length-bounding for lm-supply local inference. |
|
|
IronHive.Cli.Core
IronHive CLI Core - Agent loop, tools, session management, and provider integrations for building AI-powered CLI tools |
|
|
IronHive.Host
IronHive Host - reusable AI agent host SDK (agent loop, tools, session, provider integrations) for CLI, server, and embedded surfaces |
|
|
IronHive.Host.Core
IronHive Host Core - Agent loop, tools, session management, and provider integrations for building reusable AI agent hosts (CLI, server, embedded) |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.42.0 | 80 | 8/18/2026 |
| 0.41.1 | 60 | 8/18/2026 |
| 0.41.0 | 84 | 8/18/2026 |
| 0.40.3 | 87 | 8/17/2026 |
| 0.40.1 | 98 | 8/16/2026 |
| 0.40.0 | 123 | 8/11/2026 |
| 0.39.0 | 119 | 8/9/2026 |
| 0.38.1 | 118 | 8/6/2026 |
| 0.38.0 | 100 | 8/6/2026 |
| 0.37.2 | 102 | 8/6/2026 |
| 0.37.1 | 313 | 7/19/2026 |
| 0.37.0 | 127 | 7/17/2026 |
| 0.36.0 | 109 | 7/17/2026 |
| 0.35.2 | 99 | 7/17/2026 |
| 0.35.1 | 211 | 6/29/2026 |
| 0.35.0 | 122 | 6/26/2026 |
| 0.34.31 | 117 | 6/21/2026 |
| 0.34.30 | 116 | 6/21/2026 |
| 0.34.29 | 114 | 6/21/2026 |
| 0.34.28 | 133 | 6/21/2026 |