AiModelBuilder<T, TInput, TOutput>
Helpers & Utilities · AiDotNet
Build-pipeline orchestration partial of AiModelBuilder:
the streaming and standard supervised build/optimize paths. Split out of the main file
(audit-2026-05 finding #12) to keep AiModelBuilder.cs reviewable; no behaviour change.
Implements: IAiModelBuilder<T, TInput, TOutput>
For Beginners
Think of this class as a recipe builder for creating AI models. You add different ingredients (like data normalization, feature selection, etc.) and then “cook” (build) the final model. This approach makes it easy to customize your model without having to understand all the complex details at once.
How It Works
This class uses the builder pattern to configure various components of a machine learning model before building and using it for predictions.
Training Infrastructure Example: Complete example showing experiment tracking, checkpointing, model registry, and hyperparameter optimization working together:
Constructors
| Constructor | Summary |
|---|---|
AiModelBuilder(AiDotNetLicenseKey licenseKey) |
Creates a new AiModelBuilder with default (empty) configuration. |
AiModelBuilder(string configFilePath, AiDotNetLicenseKey licenseKey) |
Creates a new AiModelBuilder with configuration loaded from a YAML file. |
Properties
| Property | Summary |
|---|---|
bool IsOnnxExportableRequired { get; } |
True if the user opted into ONNX-export validation on this builder. |
Methods
| Method | Summary |
|---|---|
AiModelBuilder<T, TInput, TOutput> RequireOnnxExportable() |
Marks the builder as requiring an ONNX-exportable result. |
AiModelBuilder<T, TInput, TOutput> SetPostprocessingFitMaxRows(int? maxRows) |
Caps the number of training rows that the post-train pipeline-fit step feeds into bestSolution.Predict(...). |
AiModelResult<T, TInput, TOutput> Build(Matrix<T> covariates, Vector<int> treatment, Vector<T> outcome) |
Builds a survival model from covariates, observed times, and who was censored. |
AiModelResult<T, TInput, TOutput> Build(Matrix<T> features, Vector<T> times, Vector<int> events) |
Builds a survival model from covariates, observed times, and who was censored. |
AiModelResult<T, TInput, TOutput> Build(TInput features) |
Builds an unsupervised model from data alone. |
AiModelResult<T, TInput, TOutput> Build(TInput features, TOutput labels) |
Builds the model against data supplied directly, blocking until the build completes. |
AiModelResult<T, TInput, TOutput> BuildForInference() |
Wraps an already-trained model in a result, without training it. |
AiModelResult<T, TInput, TOutput> DeserializeModel(byte[] modelData) |
Converts a byte array back into a usable predictive model. |
AiModelResult<T, TInput, TOutput> LoadModel(string filePath) |
Loads a previously saved model from a file. |
IAiModelBuilder<T, TInput, TOutput> AllowNondeterminism() |
Opts out of the builder’s deterministic-by-default policy. |
IAiModelBuilder<T, TInput, TOutput> ConfigureABTesting(ABTestingConfig config) |
|
IAiModelBuilder<T, TInput, TOutput> ConfigureActiveLearning(IActiveLearningStrategy<T> strategy, Tensor<T> unlabeledPool, int batchSize, double diversityWeight) |
Configures an active learning strategy for intelligently selecting training samples. |
IAiModelBuilder<T, TInput, TOutput> ConfigureAdversarialAttack(IAdversarialAttack<T, TInput, TOutput> attack) |
Configures an adversarial attack method for evaluating model robustness. |
IAiModelBuilder<T, TInput, TOutput> ConfigureAdversarialDefense(IAdversarialDefense<T, TInput, TOutput> defense) |
Configures an adversarial defense method for improving model robustness. |
IAiModelBuilder<T, TInput, TOutput> ConfigureAdversarialRobustness(AdversarialRobustnessConfiguration<T, TInput, TOutput> configuration) |
Configures adversarial robustness and AI safety features for the model. |
IAiModelBuilder<T, TInput, TOutput> ConfigureAudioEffect(IAudioEffect<T> audioEffect) |
Configures an audio effect for audio signal processing pipelines. |
IAiModelBuilder<T, TInput, TOutput> ConfigureAudioEnhancer(IAudioEnhancer<T> enhancer) |
Configures an audio enhancer for improving audio quality. |
IAiModelBuilder<T, TInput, TOutput> ConfigureAugmentation(AugmentationConfig config) |
Strongly-typed overload of ConfigureAugmentation that accepts the generic AugmentationConfig (introduced in review #1368 to replace the object?-typed custom-augmenter slot). |
IAiModelBuilder<T, TInput, TOutput> ConfigureAugmentation(AugmentationConfig<T, TInput> config) |
Strongly-typed overload of ConfigureAugmentation that accepts the generic AugmentationConfig (introduced in review #1368 to replace the object?-typed custom-augmenter slot). |
IAiModelBuilder<T, TInput, TOutput> ConfigureAutoML(AutoMLOptions<T, TInput, TOutput> options) |
Configures AutoML with a custom IAutoMLModel search engine (advanced). |
IAiModelBuilder<T, TInput, TOutput> ConfigureAutoML(IAutoMLModel<T, TInput, TOutput> autoMLModel) |
Configures AutoML with a custom IAutoMLModel search engine (advanced). |
IAiModelBuilder<T, TInput, TOutput> ConfigureBenchmarking(BenchmarkingOptions options) |
Configures benchmarking to run standardized benchmark suites and attach a structured report to the built model. |
IAiModelBuilder<T, TInput, TOutput> ConfigureBiasDetector(IBiasDetector<T> detector) |
Configures the bias detector component for ethical AI evaluation. |
IAiModelBuilder<T, TInput, TOutput> ConfigureCaching(CacheConfig config) |
|
IAiModelBuilder<T, TInput, TOutput> ConfigureCausalDiscovery(Action<CausalDiscoveryOptions> configure) |
Configures causal structure discovery with a pre-built options object. |
IAiModelBuilder<T, TInput, TOutput> ConfigureCausalDiscovery(CausalDiscoveryOptions options) |
Configures causal structure discovery with a pre-built options object. |
IAiModelBuilder<T, TInput, TOutput> ConfigureCertifiedDefense(ICertifiedDefense<T, TInput, TOutput> defense) |
Configures a certified defense for providing formal robustness guarantees. |
IAiModelBuilder<T, TInput, TOutput> ConfigureChatClient(IChatClient<T> chatClient, ChatClientOptions options) |
Configures the language model that proposes program edits. |
IAiModelBuilder<T, TInput, TOutput> ConfigureChatClientEnsemble(IReadOnlyList<IChatClient<T>> clients, IReadOnlyList<double> weights, WeightedEnsembleChatClientOptions ensembleOptions, ChatClientOptions options) |
Configures several language models as one weighted ensemble. |
IAiModelBuilder<T, TInput, TOutput> ConfigureCheckpointManager(ICheckpointManager<T, TInput, TOutput> manager) |
Configures checkpoint management for saving and restoring training state. |
IAiModelBuilder<T, TInput, TOutput> ConfigureClassificationMetric(IClassificationMetric<T> metric) |
Configures a classification metric for evaluating classifier performance. |
IAiModelBuilder<T, TInput, TOutput> ConfigureClusterMetric(IClusterMetric<T> metric) |
Configures an internal cluster metric for evaluating clustering quality without ground truth labels. |
IAiModelBuilder<T, TInput, TOutput> ConfigureCompression(CompressionConfig config) |
|
IAiModelBuilder<T, TInput, TOutput> ConfigureContinualLearning(IContinualLearningStrategy<T, TInput, TOutput> strategy, IContinualLearnerConfig<T> config) |
Configures continual learning so the model learns this task without forgetting earlier ones. |
IAiModelBuilder<T, TInput, TOutput> ConfigureCreditRule(CreditRule rule, int? seed) |
Selects a custom ICreditRule implementation as the credit-assignment (learning) rule used during neural-network training. |
IAiModelBuilder<T, TInput, TOutput> ConfigureCreditRule(ICreditRule<T> rule, int? seed) |
Selects a custom ICreditRule implementation as the credit-assignment (learning) rule used during neural-network training. |
IAiModelBuilder<T, TInput, TOutput> ConfigureCrossValidation(ICrossValidator<T, TInput, TOutput> crossValidator) |
Configures the cross-validation strategy for model evaluation. |
IAiModelBuilder<T, TInput, TOutput> ConfigureCuriosity(IIntrinsicRewardModule<T> module, double weight) |
Configures curiosity (intrinsic-motivation) exploration for reinforcement learning: a novelty bonus is added to the environment reward each step so the agent seeks unfamiliar states, which is what makes sparse-reward tasks learnable. |
IAiModelBuilder<T, TInput, TOutput> ConfigureCurriculumLearning(CurriculumLearningOptions<T, TInput, TOutput> options) |
Configures curriculum learning for training with ordered sample difficulty. |
IAiModelBuilder<T, TInput, TOutput> ConfigureCurriculumScheduler(ICurriculumScheduler<T> scheduler) |
Configures a curriculum scheduler for ordering training samples by difficulty. |
IAiModelBuilder<T, TInput, TOutput> ConfigureDataLoader(IDataLoader<ImageView<T>, PixelBatch<T>> dataLoader) |
Configures an image-shaped data loader for photometric radiance-field training (#1834). |
IAiModelBuilder<T, TInput, TOutput> ConfigureDataLoader(IDataLoader<T> dataLoader) |
Configures an image-shaped data loader for photometric radiance-field training (#1834). |
IAiModelBuilder<T, TInput, TOutput> ConfigureDataPreparation(Action<DataPreparationPipeline<T>> pipelineBuilder) |
Configures data preparation operations that change row count (outlier removal, augmentation). |
IAiModelBuilder<T, TInput, TOutput> ConfigureDataSplitter(IDataSplitter<T> splitter) |
Configures a data splitting strategy for dividing datasets into train/test/validation sets. |
IAiModelBuilder<T, TInput, TOutput> ConfigureDataVersionControl(IDataVersionControl<T> dataVersionControl) |
Configures data version control for tracking dataset changes. |
IAiModelBuilder<T, TInput, TOutput> ConfigureDistanceMetric(IDistanceMetric<T> distanceMetric) |
Configures a distance metric for measuring similarity between data points. |
IAiModelBuilder<T, TInput, TOutput> ConfigureDistillationStrategy(IDistillationStrategy<T> strategy) |
Configures a knowledge distillation strategy for transferring knowledge between models. |
IAiModelBuilder<T, TInput, TOutput> ConfigureDistributedTraining(ICommunicationBackend<T> backend, DistributedStrategy strategy, IShardingConfiguration<T> configuration) |
Configures distributed training across multiple GPUs or machines. |
IAiModelBuilder<T, TInput, TOutput> ConfigureDriftDetection(IDriftDetector<T> driftDetector) |
Configures a drift detector for monitoring changes in data distribution over time. |
IAiModelBuilder<T, TInput, TOutput> ConfigureEmbeddingClient(IEmbeddingClient embeddingClient, int cacheCapacity) |
Configures the embedding model used to spot candidates that are near-duplicates of ones already tried. |
IAiModelBuilder<T, TInput, TOutput> ConfigureEmbeddingModel(IEmbeddingModel<T> embeddingModel) |
Configures an embedding model for learning dense vector representations. |
IAiModelBuilder<T, TInput, TOutput> ConfigureEnvironment(IEnvironment<T> environment) |
Configures a reinforcement learning environment for agent training. |
IAiModelBuilder<T, TInput, TOutput> ConfigureEvolution(EvolutionOptions options) |
Configures the settings an evolution run uses without yet naming what is being evolved. |
IAiModelBuilder<T, TInput, TOutput> ConfigureEvolution(IEvolutionTask<TGenome> task, IVariationOperator<TGenome> variation, EvolutionOptions options, ISelectionPolicy<TGenome> selection, ICandidateRefiner<TGenome> refiner, IMigrationPolicy<TGenome> migration, IEvolutionObserver<TGenome> observer, IGenomeDistance<TGenome> genomeDistance, Func<int, IEvolutionArchive<TGenome>> archiveFactory, Func<TGenome, IFullModel<T, TInput, TOutput>> winnerModelFactory) |
Configures evolution of a candidate type of your own, without checkpointing. |
IAiModelBuilder<T, TInput, TOutput> ConfigureEvolution(IEvolutionTask<TGenome> task, IVariationOperator<TGenome> variation, IEvolutionGenomeCodec<TGenome> genomeCodec, EvolutionOptions options, ISelectionPolicy<TGenome> selection, ICandidateRefiner<TGenome> refiner, IMigrationPolicy<TGenome> migration, IEvolutionObserver<TGenome> observer, IEvolutionCheckpointStore checkpointStore, IGenomeDistance<TGenome> genomeDistance, Func<int, IEvolutionArchive<TGenome>> archiveFactory, Func<TGenome, IFullModel<T, TInput, TOutput>> winnerModelFactory) |
Configures evolution of a candidate type of your own, with checkpointing and resume available. |
IAiModelBuilder<T, TInput, TOutput> ConfigureEvolutionSeeds(EvolutionSeedOptions options) |
Configures the candidates a typed evolution run starts from. |
IAiModelBuilder<T, TInput, TOutput> ConfigureEvolutionSeeds(IEnumerable<TGenome> seeds) |
Configures the candidates a typed evolution run starts from. |
IAiModelBuilder<T, TInput, TOutput> ConfigureExperimentTracker(IExperimentTracker<T> tracker) |
Configures experiment tracking for logging and organizing training runs. |
IAiModelBuilder<T, TInput, TOutput> ConfigureExplorationStrategy(IExplorationStrategy<T> strategy) |
Configures an exploration strategy for reinforcement learning agents. |
IAiModelBuilder<T, TInput, TOutput> ConfigureExport(ExportConfig config) |
|
IAiModelBuilder<T, TInput, TOutput> ConfigureExternalClusterMetric(IExternalClusterMetric<T> metric) |
Configures an external cluster metric for evaluating clustering quality against ground truth labels. |
IAiModelBuilder<T, TInput, TOutput> ConfigureFairnessEvaluator(IFairnessEvaluator<T> evaluator) |
Configures the fairness evaluator component for ethical AI evaluation. |
IAiModelBuilder<T, TInput, TOutput> ConfigureFederatedLearning(FederatedLearningOptions options, IAggregationStrategy<IFullModel<T, TInput, TOutput>> aggregationStrategy, IClientSelectionStrategy clientSelectionStrategy, IFederatedServerOptimizer<T> serverOptimizer, IFederatedHeterogeneityCorrection<T> heterogeneityCorrection, IHomomorphicEncryptionProvider<T> homomorphicEncryptionProvider, IPrivateSetIntersection privateSetIntersection, ISecureComputationProtocol<T> secureComputationProtocol, ITeeProvider<T> teeProvider, IZkProofSystem zkProofSystem, IFederatedUnlearner<T> federatedUnlearner, IFederatedDriftDetector<T> driftDetector, IClientContributionEvaluator<T> contributionEvaluator, IFairnessConstraint<T> fairnessConstraint) |
Enables federated learning training using the provided options. |
IAiModelBuilder<T, TInput, TOutput> ConfigureFinancialMetric(IFinancialMetric<T> metric) |
Configures an extra financial metric to score a forecasting/financial model on, on top of the default set (directional accuracy, strategy Sharpe/Sortino, max drawdown, profit factor, information coefficient). |
IAiModelBuilder<T, TInput, TOutput> ConfigureFineTuning(FineTuningConfiguration<T, TInput, TOutput> configuration) |
Configures fine-tuning for the model using preference learning, RLHF, or other alignment methods. |
IAiModelBuilder<T, TInput, TOutput> ConfigureFitDetector(IFitDetector<T, TInput, TOutput> detector) |
Configures how to detect if the model is overfitting or underfitting. |
IAiModelBuilder<T, TInput, TOutput> ConfigureFitnessCalculator(IFitnessCalculator<T, TInput, TOutput> calculator) |
Configures how to measure the model’s performance. |
IAiModelBuilder<T, TInput, TOutput> ConfigureGpuAcceleration(GpuAccelerationConfig config) |
Enables GPU acceleration for training and inference with optional configuration. |
IAiModelBuilder<T, TInput, TOutput> ConfigureGpuDiagnostics(GpuDiagnosticsOptions options) |
Controls whether GPU backend diagnostic output is written to Console or routed through a custom sink. |
IAiModelBuilder<T, TInput, TOutput> ConfigureHyperparameterOptimizer(IHyperparameterOptimizer<T, TInput, TOutput> optimizer, HyperparameterSearchSpace searchSpace, int nTrials) |
Configures hyperparameter optimization for automatic tuning of model settings. |
IAiModelBuilder<T, TInput, TOutput> ConfigureInferenceOptimizations(InferenceOptimizationConfig config) |
Configures inference-time optimizations for faster predictions. |
IAiModelBuilder<T, TInput, TOutput> ConfigureInterpretability(InterpretabilityOptions options) |
Configures model interpretability and explainability features. |
IAiModelBuilder<T, TInput, TOutput> ConfigureJitCompilation(JitCompilationConfig config) |
Configures JIT (Just-In-Time) compilation, which is on by default (Default); pass Disabled to opt out. |
IAiModelBuilder<T, TInput, TOutput> ConfigureKnowledgeDistillation(KnowledgeDistillationOptions<T, TInput, TOutput> options) |
Configures knowledge distillation to train a smaller, faster student model from a larger teacher model. |
IAiModelBuilder<T, TInput, TOutput> ConfigureKnowledgeGraph(Action<KnowledgeGraphOptions> configure) |
Configures advanced knowledge graph capabilities including embeddings, community detection, link prediction, temporal queries, and KG construction. |
IAiModelBuilder<T, TInput, TOutput> ConfigureLearningRateScheduler(ILearningRateScheduler scheduler) |
Configures a learning rate scheduler that adjusts the learning rate during training. |
IAiModelBuilder<T, TInput, TOutput> ConfigureLicenseKey(AiDotNetLicenseKey licenseKey) |
|
IAiModelBuilder<T, TInput, TOutput> ConfigureLoRA(ILoRAConfiguration<T> loraConfiguration) |
Configures LoRA (Low-Rank Adaptation) for parameter-efficient fine-tuning. |
IAiModelBuilder<T, TInput, TOutput> ConfigureLossFunction(ILossFunction<T> lossFunction) |
Configures the loss function used to measure prediction error during training. |
IAiModelBuilder<T, TInput, TOutput> ConfigureMemoryManagement(TrainingMemoryConfig configuration) |
Configures memory management for training including gradient checkpointing, activation pooling, and model sharding. |
IAiModelBuilder<T, TInput, TOutput> ConfigureMetaLearning(IMetaLearner<T, TInput, TOutput> metaLearner) |
Configures a meta-learning algorithm for training models that can quickly adapt to new tasks. |
IAiModelBuilder<T, TInput, TOutput> ConfigureMixedPrecision(MixedPrecisionConfig config) |
Enables mixed-precision training with optional configuration. |
IAiModelBuilder<T, TInput, TOutput> ConfigureModel(IFullModel<T, TInput, TOutput> model) |
|
IAiModelBuilder<T, TInput, TOutput> ConfigureModel(PretrainedSource source) |
|
IAiModelBuilder<T, TInput, TOutput> ConfigureModel(PretrainedSource source, DeviceInfo device) |
|
IAiModelBuilder<T, TInput, TOutput> ConfigureModelCompressionStrategy(IModelCompressionStrategy<T> strategy) |
Configures a model compression strategy for reducing model size and inference cost. |
IAiModelBuilder<T, TInput, TOutput> ConfigureModelExplainer(IModelExplainer<T> explainer) |
Configures a model explainer for understanding model predictions. |
IAiModelBuilder<T, TInput, TOutput> ConfigureModelRegistry(IModelRegistry<T, TInput, TOutput> registry) |
Configures model registry for centralized model storage and versioning. |
IAiModelBuilder<T, TInput, TOutput> ConfigureNativeAnnIndex(AnnVectorIndexType indexType, int vectorDimension, AnnVectorMetric metric, int nlist, int nprobe, int m, int ksub, bool useGpu, int defaultTopK) |
Configures a dependency-free native ANN index (Flat / IVF / PQ / IVFPQ) implemented on the AiDotNet Tensors fused-kernel stack, adapts it into a document store, and builds a dense retriever over it. |
IAiModelBuilder<T, TInput, TOutput> ConfigureOptimizer(IOptimizer<T, TInput, TOutput> optimizationAlgorithm) |
Configures the optimization algorithm to find the best model parameters. |
IAiModelBuilder<T, TInput, TOutput> ConfigurePipelineParallelism(IPipelineSchedule<T> schedule, IPipelinePartitionStrategy<T> partitionStrategy, ActivationCheckpointConfig checkpointConfig, int microBatchCount) |
Configures pipeline-specific options for pipeline parallel training. |
IAiModelBuilder<T, TInput, TOutput> ConfigurePlanCaching(string directory) |
Enables disk-backed caching of compiled inference plans. |
IAiModelBuilder<T, TInput, TOutput> ConfigurePostprocessing(Action<PostprocessingPipeline<T, TOutput, TOutput>> pipelineBuilder) |
Configures the output postprocessing using an existing pipeline. |
IAiModelBuilder<T, TInput, TOutput> ConfigurePostprocessing(IDataTransformer<T, TOutput, TOutput> transformer) |
Configures the output postprocessing using an existing pipeline. |
IAiModelBuilder<T, TInput, TOutput> ConfigurePostprocessing(PostprocessingPipeline<T, TOutput, TOutput> pipeline) |
Configures the output postprocessing using an existing pipeline. |
IAiModelBuilder<T, TInput, TOutput> ConfigurePreprocessing(Action<PreprocessingPipeline<T, TInput, TInput>> pipelineBuilder) |
Configures a pre-built preprocessing pipeline. |
IAiModelBuilder<T, TInput, TOutput> ConfigurePreprocessing(IDataTransformer<T, TInput, TInput> transformer) |
Configures a pre-built preprocessing pipeline. |
IAiModelBuilder<T, TInput, TOutput> ConfigurePreprocessing(PreprocessingPipeline<T, TInput, TInput> pipeline) |
Configures a pre-built preprocessing pipeline. |
IAiModelBuilder<T, TInput, TOutput> ConfigureProfiling(ProfilingConfig config) |
Configures performance profiling for training and inference operations. |
IAiModelBuilder<T, TInput, TOutput> ConfigureProgramEvolution(ProgramEvolutionOptions options) |
Configures evolution of source code: the OpenEvolve-equivalent entry point. |
IAiModelBuilder<T, TInput, TOutput> ConfigureProgramExecutionEngine(IProgramExecutionEngine engine) |
Configures the engine that runs generated programs, replacing the built-in sandbox. |
IAiModelBuilder<T, TInput, TOutput> ConfigureProgramSandbox(ProgramSandboxOptions options) |
Configures the execution boundary and resource limits applied to generated programs. |
IAiModelBuilder<T, TInput, TOutput> ConfigureProgramSynthesis(ProgramSynthesisOptions options) |
Configures program synthesis (code generation / repair) settings with sensible defaults. |
IAiModelBuilder<T, TInput, TOutput> ConfigureProgramSynthesisServing(ProgramSynthesisServingClientOptions options, IProgramSynthesisServingClient client) |
Configures program synthesis to use AiDotNet.Serving for program execution and evaluation (optional). |
IAiModelBuilder<T, TInput, TOutput> ConfigureQuantization(QuantizationConfig config) |
|
IAiModelBuilder<T, TInput, TOutput> ConfigureQueryStrategy(IQueryStrategy<T, TInput, TOutput> strategy, IReadOnlyList<TInput> unlabeledPool, int batchSize, double diversityWeight) |
Configures a query strategy for active learning sample selection. |
IAiModelBuilder<T, TInput, TOutput> ConfigureRAG(RAGConfiguration<T> config) |
Materializes a declarative RAGConfiguration (typically produced by RAGConfigurationBuilder) into the builder’s RAG fields: chunking strategy, embedding model, document store + retriever, reranker, and context compressor. |
IAiModelBuilder<T, TInput, TOutput> ConfigureReasoning(ReasoningConfig config) |
Configures advanced reasoning capabilities for the model using Chain-of-Thought, Tree-of-Thoughts, and Self-Consistency strategies. |
IAiModelBuilder<T, TInput, TOutput> ConfigureRegressionMetric(IRegressionMetric<T> metric) |
Configures a regression metric for evaluating regression model performance. |
IAiModelBuilder<T, TInput, TOutput> ConfigureRegularization(IRegularization<T, TInput, TOutput> regularization) |
Configures regularization to prevent overfitting in the model. |
IAiModelBuilder<T, TInput, TOutput> ConfigureReinforcementLearning(RLTrainingOptions<T> options) |
Configures reinforcement learning options for training an RL agent. |
IAiModelBuilder<T, TInput, TOutput> ConfigureRetrievalAugmentedGeneration(IRetriever<T> retriever, IReranker<T> reranker, IGenerator<T> generator, IEnumerable<IQueryProcessor> queryProcessors, IGraphStore<T> graphStore, KnowledgeGraph<T> knowledgeGraph, IDocumentStore<T> documentStore, IChunkingStrategy chunkingStrategy, IContextCompressor<T> contextCompressor) |
Configures the retrieval-augmented generation (RAG) components for use during model inference. |
IAiModelBuilder<T, TInput, TOutput> ConfigureSafety(Action<SafetyConfig> configure) |
Configures the comprehensive safety pipeline for input validation and output filtering. |
IAiModelBuilder<T, TInput, TOutput> ConfigureSegmentationVisualization(SegmentationVisualizationConfig config) |
Configures visualization settings for segmentation overlays. |
IAiModelBuilder<T, TInput, TOutput> ConfigureSelfSupervisedLearning(Action<SelfSupervisedLearningConfig<T>> configure) |
Configures self-supervised learning for unsupervised representation learning. |
IAiModelBuilder<T, TInput, TOutput> ConfigureSelfSupervisedLearning(Action<SelfSupervisedLearningConfig<T>> configure, Func<IFullModel<T, TInput, TOutput>, SelfSupervisedLearningConfig<T>, CancellationToken, Task<IFullModel<T, TInput, TOutput>>> pretrainAction) |
Configures self-supervised learning with a typed pretraining hook (AiDotNet#1361). |
IAiModelBuilder<T, TInput, TOutput> ConfigureSelfSupervisedLearningMethod(ISelfSupervisedLearningMethod<T> method) |
Configures a self-supervised learning method for learning representations without labeled data. |
IAiModelBuilder<T, TInput, TOutput> ConfigureSimilarityMetric(ISimilarityMetric<T> metric) |
Configures a similarity metric for vector similarity search operations. |
IAiModelBuilder<T, TInput, TOutput> ConfigureSpeculativeDecoding(IDraftModel<T> draftModel, SpeculativeDecodingOptions options) |
Enables and configures speculative decoding using one of your own models as the draft “guesser”. |
IAiModelBuilder<T, TInput, TOutput> ConfigureSpeculativeDecoding(IFullModel<T, TInput, TOutput> draftModel, SpeculativeDecodingOptions options) |
Enables and configures speculative decoding using one of your own models as the draft “guesser”. |
IAiModelBuilder<T, TInput, TOutput> ConfigureSpeculativeDecoding(SpeculativeDecodingOptions options) |
Enables and tunes speculative decoding using the built-in, zero-cost N-gram / prompt-lookup draft (no extra model required). |
IAiModelBuilder<T, TInput, TOutput> ConfigureStoppingCriterion(IStoppingCriterion<T> criterion) |
Configures a stopping criterion for active learning loops. |
IAiModelBuilder<T, TInput, TOutput> ConfigureStreamingTraining(StreamingTrainingOptions<T, TInput, TOutput> options) |
Configures step-level streaming training: a seeded data order, a global step budget, periodic held-out validation, and resuming from the checkpoint manager’s latest checkpoint. |
IAiModelBuilder<T, TInput, TOutput> ConfigureTargetScaling(PreprocessingPipeline<T, TOutput, TOutput> pipeline) |
Configures TARGET (label) scaling for regression: the targets are scaled (default: z-score via TargetStandardScaler) before training — fit on the TRAINING split only — and Predict automatically inverse-transforms model outputs back to t… |
IAiModelBuilder<T, TInput, TOutput> ConfigureTelemetry(TelemetryConfig config) |
|
IAiModelBuilder<T, TInput, TOutput> ConfigureTextVectorizer(ITextVectorizer<T> vectorizer) |
Configures a text vectorizer for converting text data into numeric feature vectors. |
IAiModelBuilder<T, TInput, TOutput> ConfigureTimeSeriesDecomposition(ITimeSeriesDecomposition<T> decomposition) |
Configures a time series decomposition method for separating time series into components. |
IAiModelBuilder<T, TInput, TOutput> ConfigureTokenizer() |
Configures tokenization with industry-standard default options. |
IAiModelBuilder<T, TInput, TOutput> ConfigureTokenizer(ITokenizer tokenizer, TokenizationConfig config) |
Configures an explicit ITokenizer and optional TokenizationConfig for text tokenization, detokenization, causal text generation, and language-model benchmarks. |
IAiModelBuilder<T, TInput, TOutput> ConfigureTokenizer(TokenizationConfig config) |
Configures tokenization options and optionally loads a pretrained Hugging Face or local tokenizer via PretrainedModelOrPath. |
IAiModelBuilder<T, TInput, TOutput> ConfigureTool(IAgentTool tool) |
Configures a tool for agent-based systems and function calling. |
IAiModelBuilder<T, TInput, TOutput> ConfigureTrainingCallback(Func<TrainingProgress<T>, bool> onEpochEnd) |
Registers a full ITrainingCallback that observes training and can abort it. |
IAiModelBuilder<T, TInput, TOutput> ConfigureTrainingCallback(ITrainingCallback<T> callback) |
Registers a full ITrainingCallback that observes training and can abort it. |
IAiModelBuilder<T, TInput, TOutput> ConfigureTrainingGroups(IReadOnlyList<IReadOnlyList<int>> groups) |
Configures GROUPED training for ranking-style objectives: each inner list is a set of TRAINING row indices forming one coherent query group (e.g. |
IAiModelBuilder<T, TInput, TOutput> ConfigureTrainingMonitor(ITrainingMonitor<T> monitor) |
Configures training monitoring for real-time visibility into training progress. |
IAiModelBuilder<T, TInput, TOutput> ConfigureTrainingPipeline(TrainingPipelineConfiguration<T, TInput, TOutput> configuration) |
Configures a multi-stage training pipeline for advanced training workflows. |
IAiModelBuilder<T, TInput, TOutput> ConfigureUncertaintyQuantification(UncertaintyQuantificationOptions options, UncertaintyCalibrationData<TInput, TOutput> calibrationData) |
Configures uncertainty quantification (UQ) for inference-time uncertainty estimates. |
IAiModelBuilder<T, TInput, TOutput> ConfigureVectorIndex(VectorIndexKind indexKind, int vectorDimension, ISimilarityMetric<T> metric, int defaultTopK) |
Configures an in-memory vector search index (Flat / HNSW / IVF / LSH) with a chosen similarity metric, adapts it into a document store, and builds a dense retriever over it. |
IAiModelBuilder<T, TInput, TOutput> ConfigureVectorStore(IDocumentStore<T> store, int defaultTopK) |
Configures a vector document store as the RAG backend in a single call, building a default dense vector retriever over it so every IDocumentStore implementation is reachable through the facade. |
IAiModelBuilder<T, TInput, TOutput> ConfigureVersioning(VersioningConfig config) |
|
IAiModelBuilder<T, TInput, TOutput> ConfigureWeightStreaming(WeightStreamingConfig config) |
|
IAiModelBuilder<T, TInput, TOutput> EnableTensorsOpProfiling() |
Enables low-level per-tensor-op profiling via Tensors’ PerformanceProfiler.Instance. |
IAiModelBuilder<T, TInput, TOutput> ReportAccelerationStatus(Action<string> logger) |
Captures a snapshot of the active acceleration environment (SIMD, GPU, native BLAS) at build time, logs it through logger if supplied, and surfaces the structured snapshot on PredictionModelResult.AccelerationSnapshot. |
TOutput Predict(TInput newData, AiModelResult<T, TInput, TOutput> modelResult) |
Uses a trained model to make predictions on new data. |
Task<AiModelResult<T, TInput, TOutput>> BuildAsync() |
Builds a predictive model using data from ConfigureDataLoader() or meta-learning from ConfigureMetaLearning(). |
Task<AiModelResult<T, TInput, TOutput>> BuildAsync(CancellationToken cancellationToken) |
Builds the configured model, observing a cancellation token. |
Task<AiModelResult<T, TInput, TOutput>> BuildAsync(TInput features, TOutput labels, CancellationToken cancellationToken) |
Builds the model against data supplied directly, instead of through ConfigureDataLoader. |
byte[] SerializeModel(AiModelResult<T, TInput, TOutput> modelResult) |
Converts a trained model into a byte array for storage or transmission. |
void SaveModel(AiModelResult<T, TInput, TOutput> modelResult, string filePath) |
Saves a trained model to a file so it can be used later without retraining. |
void ValidateOnnxExportableIfRequired(AiModelResult<T, TInput, TOutput> result) |
If the builder was marked with RequireOnnxExportable, throws OnnxExportUnsupportedException when the supplied trained model contains a non-exportable layer. |