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
TThe numeric type for input/output tensors
- Inheritance
-
DeploymentRuntime<T>
- Inherited Members
Constructors
DeploymentRuntime(RuntimeConfiguration)
public DeploymentRuntime(RuntimeConfiguration config)
Parameters
configRuntimeConfiguration
Methods
GetModelStatistics(string, string?)
Gets telemetry statistics for a model.
public ModelStatistics GetModelStatistics(string modelName, string? version = null)
Parameters
Returns
GetRegisteredModels()
Gets all registered model versions.
public List<ModelVersionInfo> GetRegisteredModels()
Returns
InferAsync(string, string, T[])
Performs inference with the specified model version.
public Task<T[]> InferAsync(string modelName, string version, T[] input)
Parameters
modelNamestringName of the model
versionstringVersion identifier (use "latest" for latest version)
inputT[]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
testNamestringName of the A/B test
inputT[]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
modelNamestringName of the model
versionstringVersion identifier
modelPathstringPath to the model file
metadataDictionary<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
testNamestringName of the A/B test
modelNamestringName of the model
versionAstringVersion A identifier
versionBstringVersion B identifier
trafficSplitdoublePercentage 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
modelNamestringName of the model
versionstringVersion identifier
numIterationsintNumber of warm-up iterations (default: 10)