Table of Contents

Class DeploymentRuntime<T>

Namespace
AiDotNet.Deployment.Runtime
Assembly
AiDotNet.dll

Runtime environment for deployed models with warm-up, versioning, A/B testing, and telemetry.

public class DeploymentRuntime<T>

Type Parameters

T

The numeric type for input/output tensors

Inheritance
DeploymentRuntime<T>
Inherited Members

Constructors

DeploymentRuntime(RuntimeConfiguration)

public DeploymentRuntime(RuntimeConfiguration config)

Parameters

config RuntimeConfiguration

Methods

GetModelStatistics(string, string?)

Gets telemetry statistics for a model.

public ModelStatistics GetModelStatistics(string modelName, string? version = null)

Parameters

modelName string
version string

Returns

ModelStatistics

GetRegisteredModels()

Gets all registered model versions.

public List<ModelVersionInfo> GetRegisteredModels()

Returns

List<ModelVersionInfo>

InferAsync(string, string, T[])

Performs inference with the specified model version.

public Task<T[]> InferAsync(string modelName, string version, T[] input)

Parameters

modelName string

Name of the model

version string

Version identifier (use "latest" for latest version)

input T[]

Input tensor data

Returns

Task<T[]>

Output tensor data

InferWithABTestAsync(string, T[])

Performs inference with A/B testing (automatically selects version based on traffic split).

public Task<(T[] output, string selectedVersion)> InferWithABTestAsync(string testName, T[] input)

Parameters

testName string

Name of the A/B test

input T[]

Input tensor data

Returns

Task<(T[] output, string selectedVersion)>

Output tensor data and selected version

RegisterModel(string, string, string, Dictionary<string, object>?)

Registers a model version with the runtime.

public void RegisterModel(string modelName, string version, string modelPath, Dictionary<string, object>? metadata = null)

Parameters

modelName string

Name of the model

version string

Version identifier

modelPath string

Path to the model file

metadata Dictionary<string, object>

Optional metadata

SetupABTest(string, string, string, string, double)

Sets up A/B testing between two model versions.

public void SetupABTest(string testName, string modelName, string versionA, string versionB, double trafficSplit = 0.5)

Parameters

testName string

Name of the A/B test

modelName string

Name of the model

versionA string

Version A identifier

versionB string

Version B identifier

trafficSplit double

Percentage of traffic for version A (0.0 to 1.0, default: 0.5)

WarmUpModelAsync(string, string, int)

Warms up a model by running inference on dummy data.

public Task WarmUpModelAsync(string modelName, string version, int numIterations = 10)

Parameters

modelName string

Name of the model

version string

Version identifier

numIterations int

Number of warm-up iterations (default: 10)

Returns

Task