Skip to content

About

.NET 10 decision SDK: Choose, Score, and Assess with Microsoft Foundry (Microsoft-Decision-1), native local Ollama System One models, and TypeSafe AI Jev. One API, probabilities instead of paragraphs.

Topics

Resources

Contributing

Stars

7 stars

Watchers

0 watching

Forks

Repository files navigation

ElBruno.AI.Decisions

ElBruno.AI.Decisions: Less chat. More decisions. Foundry, Ollama and Jev.

CI NuGet NuGet Downloads .NET 10 License: MIT GitHub stars Twitter Follow

One .NET API for classification, routing, rubric scoring, and proposition assessment, with probability distributions instead of generated text. Start with Microsoft-Decision-1 on Foundry, run models locally with Foundry Local, Llama App, or Ollama, or use the native Jev SDK.

Read the introduction and quickstarts.

Package NuGet Downloads Role
ElBruno.AI.Decisions NuGet Downloads IDecisionClient, Choice/Score/Assessment results, Microsoft.Extensions.AI routing
ElBruno.AI.Decisions.Foundry NuGet Downloads Microsoft-Decision-1/SystemOne and gpt-6-luna/Azure OpenAI Decisions
ElBruno.AI.Decisions.Foundry.Local NuGet Downloads Cached typed-decision models through the Foundry Local SDK
ElBruno.AI.Decisions.Ollama NuGet Downloads Local System One decision models through /v1/systemone
ElBruno.AI.Decisions.Llama NuGet Downloads Llama App text, image and audio decision models
ElBruno.AI.Decisions.Jev NuGet Downloads Native TypeSafe AI Jev SDK and an IDecisionClient adapter

Release: version 0.10.0 is available for all six packages, including Foundry Local and Llama. Live Jev compatibility remains unverified. See release status and instructions for limitations. The original ElBruno.AI.Jev package has not yet been deprecated. Ollama correction: native System One support requires 0.6.1 or later. The published 0.6.0 package used a chat-logprob approach; upgrade before using the Ollama example below. The published 0.6.2 package passed a live nimble smoke test on Ollama 0.35.1 on October 13, 2026. See validation scope and results.

1. Foundry: Microsoft-Decision-1

Reference package: ElBruno.AI.Decisions.Foundry. After az login, initialize the client directly from a Foundry project endpoint, deployment name, and explicit credential:

using Azure.Identity;
using ElBruno.AI.Decisions.Foundry;

using var client = new FoundryDecisionClient(
    new Uri("https://<resource>.services.ai.azure.com/api/projects/<project>"),
    "<deployment-name>",
    new AzureCliCredential());

var teams = new Dictionary<string, string?>
{
    ["billing"] = "Invoices and payments",
    ["support"] = "Technical problems"
};
var result = await client.ChooseAsync(
    "Please correct my invoice.",
    "Which team should handle this request?",
    teams);

Console.WriteLine($"{result.Choice}: {result.Confidence:P1}");

Illustrative response (values vary by model and input):

{
  "answers": {
    "decision": {
      "type": "choice",
      "choice": "billing",
      "probabilities": { "billing": 0.99, "support": 0.01 },
      "confidence": 0.95
    }
  }
}

Console output: billing: 95.0% (formatting follows your current culture). The SDK exposes Choice, Probabilities, and the provider's Confidence; confidence is not necessarily the selected label's probability.

Starting in 0.6.3, all three operations also expose optional result.Usage with nullable input, output, total, reasoning and cached token counters. Missing values stay null and reported zero stays zero. Totals are never inferred. Availability depends on the provider/model; cross-model token counts do not imply equivalent computation or cost. See usage semantics.

URL template: https://<resource>.services.ai.azure.com/providers/microsoft/v1/systemone. Both the resource root (https://<resource>.services.ai.azure.com/) and project endpoint (https://<resource>.services.ai.azure.com/api/projects/<project>) resolve to this resource-scoped route, with or without a trailing slash. Full invocation URLs and custom paths are used unchanged. Deployment name: use the name of your deployed model, for example msft-decision-1, not necessarily the catalog model name Microsoft-Decision-1. The endpoint-first constructor accepts any Azure.Core.TokenCredential, including AzureCliCredential for local development and ManagedIdentityCredential in a hosted app. It uses the credential you pass; it does not select or replace one.

Advanced configuration and custom transports

Use FoundryDecisionOptions when configuring API keys, timeouts, or the Azure OpenAI Decisions API. AddFoundryDecisions uses the same endpoint resolution:

builder.Services.AddFoundryDecisions(options =>
{
    options.Endpoint = new Uri("https://<resource>.services.ai.azure.com/api/projects/<project>");
    options.Model = "<deployment-name>";
    options.Credential = new AzureCliCredential();
});

For custom HTTP handlers or transport settings, use the caller-managed HttpClient overload. The client borrows the HttpClient and does not dispose it; the caller must keep it alive while requests run and dispose it afterward. The client sets HttpClient.Timeout to infinite and enforces FoundryDecisionOptions.Timeout per request.

Choice, Score and Assess passed a live API-key smoke test on October 9, 2026, and Azure CLI/Entra checks on October 26, 2026. That does not prove calibration or production readiness. See the complete Foundry sample, configuration and user secrets, and Microsoft's endpoint example.

Azure OpenAI Decisions API: gpt-6-luna

Select the separate Azure OpenAI Decisions contract explicitly. Use your deployment name for Model; the provider appends /openai/v1/decisions to a resource root.

using ElBruno.AI.Decisions.Foundry;

using var client = new FoundryDecisionClient(new FoundryDecisionOptions
{
    Api = FoundryDecisionApi.OpenAIDecisions,
    Endpoint = new Uri("https://<resource>.openai.azure.com"),
    Model = "<gpt-6-luna-deployment>"
});

var result = await client.ChooseAsync(
    "Please correct my invoice.",
    "Which team should handle this request?",
    new Dictionary<string, string?> { ["billing"] = "Invoices and payments", ["support"] = "Technical problems" });

OpenAIDecisions maps AssessAsync to a predicate question, ChooseAsync to choice, and ScoreAsync to score. The existing default remains SystemOne for Microsoft-Decision-1 deployments. See the Azure OpenAI Decisions documentation.

For image input or multiple questions per request, use the Foundry-specific DecideAsync API. It accepts text or user messages containing input_text and input_image parts, and returns typed answers correlated by question name, including per-question refusals and token usage. See the Foundry sample for configuration and an offline-capable multi-question example. The step-by-step walkthrough configures both deployments independently, runs batch/image examples, and enables the live tests. The gpt-6-luna batch, token usage, and a synthetic image request passed live Azure CLI/Entra checks on October 26, 2026. This does not establish model accuracy or calibration.

Foundry Local: local typed decisions

The separate ElBruno.AI.Decisions.Foundry.Local package adapts cached Foundry Local models that advertise noul, choice, and score capabilities to the shared IDecisionClient. When needed, it registers the existing cache directory as a typed-decision model under a distinct local alias, without copying or downloading model assets or shadowing the public CLI alias. Initialize FoundryLocalManager with AppName = "foundry" to use the CLI's default cache, then resolve a model with FoundryLocalDecisionModelResolver. kev-0.8b was verified with real CPU inference; kev-4b is capability-supported but not inference-verified. CLM exposes candidate-ranking capabilities and is not treated as a decision model. See the package guide and local inference test.

Llama App: local multimodal decisions

The separate ElBruno.AI.Decisions.Llama provider supports shared text decisions and native named batches with image and audio input. Start Llama App with a locally installed decision model; no model is downloaded by the SDK. Run dotnet run --project samples/13-LlamaDecision and optionally pass --model <id>, --endpoint <url>, --image <path> or --audio <path>. --offline uses synthetic responses. Install the Llama package. See the package guide for privacy, limits and score semantics. Audio input reached the tested model, but reliable speech classification remains unverified. Model confidence does not establish accuracy; see the sample's audio findings.

2. Ollama: local decisions

Reference package: ElBruno.AI.Decisions.Ollama. Start Ollama v0.35.0 or later and pull a decision model: ollama pull nimble. The same task runs locally:

using ElBruno.AI.Decisions.Ollama;

using var client = new OllamaDecisionClient(new OllamaDecisionOptions
{
    Endpoint = new Uri("http://localhost:11434/"),
    Model = "nimble"
});

var teams = new Dictionary<string, string?>
{
    ["billing"] = "Invoices and payments",
    ["support"] = "Technical problems"
};
var result = await client.ChooseAsync(
    "Please correct my invoice.",
    "Which team should handle this request?",
    teams);

Console.WriteLine($"{result.Choice}: {result.Confidence:P1}");

Illustrative response (not a live test result):

{
  "model": "nimble",
  "answers": {
    "decision": {
      "type": "choice",
      "choice": "billing",
      "probabilities": { "billing": 0.9, "support": 0.1 },
      "confidence": 0.531
    }
  },
  "usage": { "input_tokens": 174, "output_tokens": 1 }
}

Console output: billing: 53.1% (formatting follows your current culture).

URL template: http://<ollama-host>:11434/v1/systemone. Resource roots append /v1/systemone; full invocation URLs are preserved. Model: a locally installed System One decision model such as nimble, Tev1, clef, or clef-flash, not a general-purpose chat or cloud model. No API key is required locally. Choice limits depend on the model (typically 2-26 options; the API permits up to 255). The shared Score API supports 2-10 ordered levels. Text requests are limited to 64 KiB and are never truncated.

The client sends native state and named questions for Choice, Score, and Noul, without chat prompting, letter mapping, or token-logprob normalization. Ollama confidence measures distribution concentration, 1 - H(p) / ln(N), not calibrated correctness. Ollama also supports batched questions and image judgments with Clef models (v0.35.1+), but this shared text-only API does not expose those features.

See the complete Ollama sample and provider configuration, official decision guide, and System One API reference.

3. Jev: native decisions and advanced composition

Reference package: ElBruno.AI.Decisions.Jev. The native SDK preserves typed question handles, structured JSON state, multiple questions per request, model discovery, metadata, and Choice/Score/Noul results. JevDecisionClientAdapter exposes the shared IDecisionClient API; AddJev registers it for DI.

Official TypeSafe endpoint: https://api.typesafe.ai. Configure Jev:ApiKey using user secrets. This community SDK is not an official TypeSafe SDK; the independent jevtypesafeai.com proxy is not supported. Live TypeSafe compatibility remains unverified. Loopback-only local Laya inference is also supported by the Jev SDK.

Start with Hello Choice, then Score and Noul and dependency injection.

Use cases and runnable examples

The shared API provides ChooseAsync, ScoreAsync, and AssessAsync. Read the use-case guide for examples in Foundry, Ollama, and Jev order, and decision semantics for native Jev details.

Use case Examples and documentation
Support classification and routing Foundry, Ollama, Jev Choice
Quality grading and proposition assessment Shared API guide, Jev Score/Noul
Multiple questions against shared evidence Parallel decisions
Structured JSON input Structured state
Model discovery and pinning Jev models
Dependency injection and HTTP ownership DI sample, configuration
Decision tools for chat agents MEAI tools, integration guide
Route to separately configured chat models MEAI routing, shared DecisionRoutingChatClient
Review chat inputs or buffered outputs MEAI assessments
RAG relevance and reranking RAG sample

Samples 01-10 use the native Jev SDK. Samples 11-12 use the shared API; sample 13 demonstrates the Llama shared and multimodal APIs. Do not assume native Jev features such as model discovery exist in every provider.

Run without credentials

dotnet run --project samples\12-FoundryDecision -- --offline
dotnet run --project samples\11-OllamaLocal -- --offline
dotnet run --project samples\01-HelloChoice -- --offline

--offline uses explicitly labeled synthetic HTTP fixtures, not a model. Missing credentials never silently select offline mode. See live and offline testing.

Limits and development

Confidence is not correctness. Assessments are not guaranteed prompt-injection protection. Calibrate automation thresholds on representative data and retain human review for consequential decisions. The providers do not generate chat; Microsoft.Extensions.AI routing wraps separately supplied chat clients. Jev retry/transport policies are described in errors and retries and do not imply identical behavior in Foundry or Ollama.

Use the .NET 10 SDK pinned by global.json:

dotnet build ElBruno.AI.Decisions.slnx -c Release
dotnet test ElBruno.AI.Decisions.slnx -c Release --no-build

See contributing, release preparation, and image provenance. Licensed under MIT.

About

.NET 10 decision SDK: Choose, Score, and Assess with Microsoft Foundry (Microsoft-Decision-1), native local Ollama System One models, and TypeSafe AI Jev. One API, probabilities instead of paragraphs.

Topics

Resources

Contributing

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages