Mythosia.AI.Serving.Vllm 1.0.0-preview

This is a prerelease version of Mythosia.AI.Serving.Vllm.
dotnet add package Mythosia.AI.Serving.Vllm --version 1.0.0-preview
                    
NuGet\Install-Package Mythosia.AI.Serving.Vllm -Version 1.0.0-preview
                    
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="Mythosia.AI.Serving.Vllm" Version="1.0.0-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mythosia.AI.Serving.Vllm" Version="1.0.0-preview" />
                    
Directory.Packages.props
<PackageReference Include="Mythosia.AI.Serving.Vllm" />
                    
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 Mythosia.AI.Serving.Vllm --version 1.0.0-preview
                    
#r "nuget: Mythosia.AI.Serving.Vllm, 1.0.0-preview"
                    
#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 Mythosia.AI.Serving.Vllm@1.0.0-preview
                    
#: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=Mythosia.AI.Serving.Vllm&version=1.0.0-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Mythosia.AI.Serving.Vllm&version=1.0.0-preview&prerelease
                    
Install as a Cake Tool

Mythosia.AI.Serving.Vllm

Control-plane (management/introspection) client for a running vLLM server — model cards, health, server version, and Prometheus metrics. It talks to a server; it does not start or host one, and it does not chat.

Family taxonomyMythosia.AI.Providers.* = chat data plane (concrete AI services); Mythosia.AI.Serving.* = model-server control plane. Chat/completions against vLLM stay on Mythosia.AI (e.g. QwenService with EndpointPlatform.Vllm).

Installation

dotnet add package Mythosia.AI.Serving.Vllm

Depends only on Newtonsoft.Json — referencing this package pulls in no chat/AI dependencies.

Quick Start

using Mythosia.AI.Serving.Vllm;

// Accepts the server root OR the /v1-suffixed URL you already store for chat clients.
var server = new VllmServer("http://localhost:8000/v1", httpClient);

// What model is ACTUALLY running behind the served alias?
var card = await server.GetModelAsync("my-served-alias");
Console.WriteLine(card?.DisplayModel);   // e.g. "Lorbus/Qwen3.6-27B-int4-AutoRound"
Console.WriteLine(card?.MaxModelLen);    // engine-effective context window, e.g. 50000

// Diagnostics
var version = await server.GetVersionAsync();        // e.g. "0.25.0"
var health  = await server.GetHealthAsync();         // Healthy / EngineDead / Unauthorized / Unreachable / Unexpected
var metrics = await server.GetMetricsAsync();
Console.WriteLine(metrics.KvCacheUsage);             // 0..1
Console.WriteLine(metrics.WaitingRequests);

API

Member Endpoint Notes
GetModelsAsync() GET /v1/models One card per --served-model-name alias (identical Root) + one per loaded LoRA adapter. data[0].Id is the canonical served name.
GetModelAsync(servedName) GET /v1/models Convenience filter by alias; card.DisplayModel = Root ?? Id.
GetVersionAsync() GET /version e.g. "0.25.0"; null when the response has no version field.
IsHealthyAsync() GET /health bool, never throws on server/network failures.
GetHealthAsync() GET /health Classified: Healthy / EngineDead (503) / Unauthorized (401·403) / Unreachable / Unexpected — tells a dead engine from a wrong API key from a network problem.
GetMetricsAsync() GET /metrics Label-preserving Prometheus families + typed getters (RunningRequests, WaitingRequests, KvCacheUsage, token counters) + RawText.

Server errors carry vLLM's OpenAI-style error body as a typed VllmException (StatusCode, ErrorType, ErrorCode, ResponseBody).

Endpoint normalization

Management routes (/health, /version, /metrics) live at the server root while /v1/models lives under /v1. The constructor therefore accepts either form — http://host:8000 or http://host:8000/v1 — and normalizes to the root, so you can pass the same endpoint string your chat client uses.

The root field caveat

The headline feature — resolving a served alias to the actually loaded model — reads vLLM's root field, which is stable since 2023 but undocumented (absent from vLLM's docs and its own OpenAPI schema; it mirrors fields OpenAI removed from its API in 2023). Accordingly:

  • VllmModelCard.Root is nullable; display DisplayModel (= Root ?? Id) instead of assuming it.
  • root is the raw --model CLI value, verbatim. When a model is served from local disk this is a host filesystem path — consider masking path-like values in end-user-visible UI.
  • Created is regenerated per request — it is not a load timestamp.

Metrics stability

Typed metric getters are bound to today's stable v1 names. vLLM has renamed metrics across versions before (gpu_cache_usage_perckv_cache_usage_perc); after such a rename a typed getter returns null while Families / RawText still carry everything the server exposed.

Scope (deliberate)

In: read-only control-plane — models, version, health, metrics. Out: chat/embeddings/rerank (stay on Mythosia.AI / Mythosia.AI.Rag), tokenize/detokenize, LoRA load/unload (env-gated), all VLLM_SERVER_DEV_MODE endpoints (sleep/wake etc.).

A serving-runtime abstraction (Mythosia.AI.Serving.Abstractions) is planned to be extracted, not invented — once a second runtime implementation (Ollama) exists. Method names and DTO prefixes here are already chosen to make that extraction additive and non-breaking.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.0-preview 65 7/12/2026

v1.0.0-preview: Initial preview — VllmServer control-plane client: GetModelsAsync/GetModelAsync (model cards incl. the stable-but-undocumented root/parent/max_model_len fields, DisplayModel fallback, LoRA detection), GetVersionAsync, IsHealthyAsync/GetHealthAsync (Healthy/EngineDead/Unauthorized/Unreachable/Unexpected), GetMetricsAsync (label-preserving Prometheus families + typed convenience getters), VllmException with OpenAI-style error-body parsing. Depends only on Newtonsoft.Json.