Themis.Inference.Foundry 1.7.1

dotnet add package Themis.Inference.Foundry --version 1.7.1
                    
NuGet\Install-Package Themis.Inference.Foundry -Version 1.7.1
                    
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="Themis.Inference.Foundry" Version="1.7.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Themis.Inference.Foundry" Version="1.7.1" />
                    
Directory.Packages.props
<PackageReference Include="Themis.Inference.Foundry" />
                    
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 Themis.Inference.Foundry --version 1.7.1
                    
#r "nuget: Themis.Inference.Foundry, 1.7.1"
                    
#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 Themis.Inference.Foundry@1.7.1
                    
#: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=Themis.Inference.Foundry&version=1.7.1
                    
Install as a Cake Addin
#tool nuget:?package=Themis.Inference.Foundry&version=1.7.1
                    
Install as a Cake Tool

Themis.Inference.Foundry

Use this optional package to request typed Themis decisions from a remote model exposed through a Microsoft Foundry project endpoint. It implements IDecisionInferenceProvider; it does not create Foundry agents, run local models, or provide Laya/GGUF inference.

Requirements and limits

  • A Foundry project endpoint, in the form https://<resource>.services.ai.azure.com/api/projects/<project>.
  • A deployed model name supplied by the Themis router.
  • A model deployment that supports the Foundry Responses API and strict structured JSON Schema output. Not every model or connection supports these features; verify the exact deployment before using it.
  • An identity with permission to invoke the model. The default registration uses DefaultAzureCredential; register a different TokenCredential before calling the registration method when the host requires another identity.

The adapter asks the model to return Choice, Score, and Noul probability data. It rejects incomplete, mismatched, non-finite, out-of-range, or non-normalized probability output. It derives answer confidence and the expected score from the returned probabilities; it does not claim that those model-generated probabilities are calibrated. Remote inference failures and cancellation are propagated.

The model receives the complete request context, including extras. In particular, extras.maf.systemMessages, when present, must be an array of strings and is treated as caller-provided instructions; other extras remain contextual data. These instructions cannot override the typed answer contract. The model response must contain exactly one typed answer for every requested question and no unknown fields. Choice answers include a selected allowed label and probabilities for every label; Score answers include probabilities for every score label; Noul answers include one probability in [0,1]. Choice/Score distributions must sum to one within 0.001. The provider returns the normal DecisionResponse; it does not require the model to echo request fields. Violations of the request/output contract fail with InvalidDataException; no fallback answer is generated.

The response types used by the Foundry Responses API are marked experimental by the underlying OpenAI .NET SDK (OPENAI001) and may change. The adapter is limited to Foundry deployments that accept the strict schema generated for the supplied decision request. This package has no live deployment compatibility claim without a successful check against that exact model.

The request state, questions, and extras are sent to Foundry. Confirm that the selected endpoint and model meet your application's data handling and residency requirements. The adapter does not override Foundry's response storage or abuse-monitoring policy; review the service's current data controls for the selected project and deployment.

Registration

Add Themis and Themis.Inference.Foundry to the host. Azure.Identity is included transitively; register a different TokenCredential before registration when the host requires another identity. The provider uses DefaultAzureCredential by default. Register it through AddThemis so it is selected instead of the default ONNX decision provider:

using Azure.Core;
using Azure.Identity;
using Themis;
using Themis.Inference.Foundry;

services.AddSingleton<TokenCredential>(_ => new DefaultAzureCredential());
services.AddThemis(
    options =>
    {
        options.DefaultModel = "your-deployment-name";
        options.RouteUnspecifiedRequestsToDefaultModel = true;
    },
    configureServices: registrations =>
        registrations.AddThemisFoundryDecisionInference(options =>
            options.ProjectEndpoint = new Uri(
                "https://your-resource.services.ai.azure.com/api/projects/your-project")));

MAF integration

Maf can call this provider through its existing typed decision client; the Foundry provider remains responsible for remote inference and response validation:

using Themis.Maf.Extensions;

services.AddThemisDecisionMaf(
    "foundry-decision",
    configureThemis: options =>
    {
        options.DefaultModel = "your-deployment-name";
        options.RouteUnspecifiedRequestsToDefaultModel = true;
    },
    configureServices: registrations =>
        registrations.AddThemisFoundryDecisionInference(options =>
            options.ProjectEndpoint = new Uri(
                "https://your-resource.services.ai.azure.com/api/projects/your-project")));

Alternatively, Maf's AddThemisDecisionMafProxy can constrain a host-registered IChatClient. This Foundry package does not convert its registered ProjectResponsesClient into an IChatClient; use the typed provider path above unless the host supplies a separately verified IChatClient adapter.

Product 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. 
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.7.1 39 10/22/2026
1.7.0 198 10/22/2026