Themis 1.5.1

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

Themis

Themis is the usual starting point for a .NET application that needs structured model decisions. Register it with dependency injection, provide a compatible prepared ONNX bundle, and use typed answers in application code instead of parsing free-form model text.

The package targets .NET 10. Its dependencies include the default inference and routing components. Conversational inference is separate; add a provider such as Ollama or the Themis.Maf adapter when you need chat.

For the simplest local client, point Themis at a prepared ONNX bundle:

services.AddThemis(options =>
{
    options.ModelBundleDirectory = @"E:\models\mattepiu-laya-onnx";
});

ModelBundleDirectory must be an absolute path to a prepared directory with a valid manifest.json, ONNX graph, tokenizer, and declared artifacts. Themis validates the bundle when the decision provider is resolved and uses its manifest modelId as the default route. Requests without an explicit model are sent to that single bundle instead of language aliases such as english. An explicit DefaultModel or request model must match the manifest ID. THEMIS_MODEL_PATH is not needed for this direct-bundle setup.

Themis does not train or include models. Prepare or obtain the model bundle separately; see the root README's model setup guide.

To resolve a bundle by local name instead, configure Model and set THEMIS_MODEL_PATH to the absolute directory containing bundles and downloaded model/cache data:

services.AddThemis(options => options.Model = "mattepiu-laya-onnx");

Provider resolution fails explicitly if THEMIS_MODEL_PATH is missing or relative; there is no machine-local or application-base fallback. If ThemisOptions.ModelStorageDirectory is set, it must match the environment value.

Or configure a prepared Hugging Face bundle URL:

services.AddThemis(options =>
{
    options.Model =
        "https://huggingface.co/my-org/laya-receptron/tree/<commit-sha>";
    options.HuggingFaceCacheDirectory = "cache";
});

The optional cache path must stay beneath THEMIS_MODEL_PATH. Private Hugging Face credentials are read only from HF_TOKEN; supply the secret through the host environment or a secret manager, not source code.

Configure either ModelBundleDirectory or Model for built-in ONNX inference. A local name must resolve to a directory containing manifest.json, an ONNX graph, tokenizer data, and any declared external data files. A Hugging Face repository must already contain the same prepared bundle. Raw ONNX repositories without manifest.json are rejected explicitly.

For tests, development without a model, or a model contract Themis does not support, register a custom IDecisionInferenceProvider or IInferenceProvider. For a custom provider bound to one model, set DefaultModel and RouteUnspecifiedRequestsToDefaultModel = true to route requests without an explicit model to that ID rather than language aliases. Custom decision providers should use DecisionRequestStateProjection.ToModelInputJson(request) when building model context so extras, including attribute-driven prior results, are preserved.

Use local Ollama models

Ollama is an optional conversational provider for applications that need chat or a backend for Themis.Maf; it is separate from the built-in typed-decision path. Applications that use only themis do not need to register Ollama. Its selected chat model is served by Ollama and is not an Themis decision model.

Register Ollama as the conversational provider without changing the existing ONNX decision-inference path:

services.AddThemis();
services.AddThemisOllama(options =>
{
    options.DefaultModel = "qwen2.5:latest";
    options.Endpoint = new Uri("http://localhost:11434/");
});

OllamaOptions.DefaultModel is used when an InferenceRequest has no model name; a model name on the request takes precedence. Resolve IOllamaModelCatalog to list models available from the configured Ollama server. Ollama must be running and the selected model must already be available locally; Themis does not download Ollama models. Ollama settings are typed configuration and do not require environment variables.

Use Ollama System One models for decisions

For a local Ollama model trained for typed System One decisions, register the separate decision provider through AddThemis:

services.AddThemis(
    options =>
    {
        options.DefaultModel = "nimble";
        options.RouteUnspecifiedRequestsToDefaultModel = true;
    },
    configureServices: registrations =>
        registrations.AddThemisOllamaSystemOneDecisionInference(options =>
            options.Endpoint = new Uri("http://localhost:11434/")));

This uses Ollama's /v1/systemone API (Ollama 0.35.0 or later) and supports choice, score, and noul decisions. The model must be locally available and trained for System One; arbitrary GGUF models are not compatible merely because Ollama can serve GGUF. System One does not support chat tools or streaming. This registration replaces the default ONNX decision provider for that AddThemis service collection; it does not replace or modify the optional Ollama chat provider.

DecisionRequest follows the shared model/state/questions decision contract and accepts optional JSON-object extras. [IncludePreviousResults] adds prior answers under extras.rldc.currentResults without replacing the original state. Application-defined extras can use their own top-level namespace; rldc is reserved for framework-owned values. Task and Language remain optional routing hints and are not sent as model context. The Ollama adapter maps state plus extras into System One's state payload; ONNX and RLCD GGUF retain their existing input format through a compatibility projection.

License

The Themis package code is licensed under MIT, and its NuGet package includes the license text. Dependencies and any model assets keep their own license terms; review those terms separately before redistribution.

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 (1)

Showing the top 1 NuGet packages that depend on Themis:

Package Downloads
Themis.Maf

Expose Themis conversational inference through Microsoft.Extensions.AI and Microsoft Agent Framework.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.1 46 10/19/2026
1.3.0 57 10/17/2026
1.2.0 58 10/17/2026
1.0.0 72 10/15/2026