Mythosia.AI.Serving.Vllm
1.0.0-preview
dotnet add package Mythosia.AI.Serving.Vllm --version 1.0.0-preview
NuGet\Install-Package Mythosia.AI.Serving.Vllm -Version 1.0.0-preview
<PackageReference Include="Mythosia.AI.Serving.Vllm" Version="1.0.0-preview" />
<PackageVersion Include="Mythosia.AI.Serving.Vllm" Version="1.0.0-preview" />
<PackageReference Include="Mythosia.AI.Serving.Vllm" />
paket add Mythosia.AI.Serving.Vllm --version 1.0.0-preview
#r "nuget: Mythosia.AI.Serving.Vllm, 1.0.0-preview"
#:package Mythosia.AI.Serving.Vllm@1.0.0-preview
#addin nuget:?package=Mythosia.AI.Serving.Vllm&version=1.0.0-preview&prerelease
#tool nuget:?package=Mythosia.AI.Serving.Vllm&version=1.0.0-preview&prerelease
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 taxonomy —
Mythosia.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.QwenServicewithEndpointPlatform.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.Rootis nullable; displayDisplayModel(=Root ?? Id) instead of assuming it.rootis the raw--modelCLI 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.Createdis 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_perc → kv_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 | Versions 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. |
-
.NETStandard 2.1
- Newtonsoft.Json (>= 13.0.4)
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.