Plugin.Maui.Spine.Server.AI
0.1.26
dotnet add package Plugin.Maui.Spine.Server.AI --version 0.1.26
NuGet\Install-Package Plugin.Maui.Spine.Server.AI -Version 0.1.26
<PackageReference Include="Plugin.Maui.Spine.Server.AI" Version="0.1.26" />
<PackageVersion Include="Plugin.Maui.Spine.Server.AI" Version="0.1.26" />
<PackageReference Include="Plugin.Maui.Spine.Server.AI" />
paket add Plugin.Maui.Spine.Server.AI --version 0.1.26
#r "nuget: Plugin.Maui.Spine.Server.AI, 0.1.26"
#:package Plugin.Maui.Spine.Server.AI@0.1.26
#addin nuget:?package=Plugin.Maui.Spine.Server.AI&version=0.1.26
#tool nuget:?package=Plugin.Maui.Spine.Server.AI&version=0.1.26
Plugin.Maui.Spine.Server.AI
AI on the server for Spine apps. Features are named in configuration, and each one names its provider and model. Every token and image is metered and priced. Budgets and per-user limits stop runaway cost. The endpoints run on ASP.NET Core and in an Azure Functions isolated worker. It is built on Microsoft.Extensions.AI: a provider is the vendor's own adapter, registered in one line, so this package references no vendor SDK.
dotnet add package Plugin.Maui.Spine.Server.AI
builder.Services.AddSpineAI(builder.Configuration.GetSection("Ai"), ai =>
{
ai.Chat("anthropic", (p, model) => new AnthropicClient { ApiKey = p["ApiKey"] }.AsIChatClient(model));
ai.Chat("openai", (p, model) => new OpenAIClient(p["ApiKey"]).GetChatClient(model).AsIChatClient());
ai.UseAzureTableUsageStore(cfg["Storage"]); // or UseInMemoryUsageStore()
});
app.MapSpineAI(); // POST /ai/features/{name} for exposed features, GET /ai/usage
"Ai": {
"Providers": { "anthropic": { "ApiKey": "" } },
"Features": {
"RaceStory": { "Provider": "anthropic", "Model": "<model id>", "MaxOutputTokens": 800,
"Budget": { "DaySoft": 2, "DayHard": 5 } }
},
"Prices": { "anthropic": { "<model id>": { "InputPerMillion": 3, "OutputPerMillion": 15 } } },
"Currency": "USD"
}
var caller = await ai.IdentifyAsync(request);
if (ai.Chat("RaceStory", caller) is not { } story) return Results.NotFound(); // off: no key, disabled or budget spent
A feature with "Kind": "Realtime" hands the app a short-lived token for a live voice session at POST /ai/realtime/{name} (ai.Realtime("openai", AIRealtimeProviders.OpenAI) and app.MapSpineRealtimeSessions()). The provider's key stays on the server, and each session reserves its minutes from the budgets; the app may ask for a shorter limit. GPT-Live ("Protocol": "Live"), which has no client token, goes through a relay on the server instead, which ends the session at its limit and settles the reservation with what it used (ASP.NET Core, with app.UseWebSockets()).
A feature with "Kind": "Speech" reads text aloud at POST /ai/speech/{name}: PCM16 with the mouth shapes and their times from Azure Speech (ai.Speech("azure", AISpeechProviders.AzureSpeech), over the service's WebSocket, no native SDK), or audio alone from OpenAI (AISpeechProviders.OpenAI). Metered by characters (PerMillionCharacters).
Swapping provider is a change to Provider and Model in configuration, and takes effect without a deploy.
Documentation
| 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
- Azure.Data.Tables (>= 12.12.0)
- Microsoft.Extensions.AI (>= 10.10.0)
- Plugin.Maui.Spine.AI.Functions (>= 0.1.26)
- Plugin.Maui.Spine.Common (>= 0.1.26)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Plugin.Maui.Spine.Server.AI:
| Package | Downloads |
|---|---|
|
Plugin.Maui.Spine.Server.AI.Assets
Generated images for Spine's server, made once and served from blob storage: a lookup answers with the image's URL or orders it, a Spine messaging handler generates it through a metered, budgeted Server.AI feature, checks it and archives it under a versioned path. A version bump remakes images lazily, and failures are visible to the app. |
GitHub repositories
This package is not used by any popular GitHub repositories.