IAiModelBuilder<T, TInput, TOutput>

Interfaces · AiDotNet.Interfaces

Defines a builder pattern interface for creating and configuring predictive models.

Known implementations: AiModelBuilder<T, TInput, TOutput>

How It Works

This interface provides a fluent API for setting up all components of a machine learning model.

For Beginners: Think of this as a step-by-step recipe builder for creating AI models. Just like building a custom sandwich where you choose the bread, fillings, and condiments, this builder lets you choose different components for your AI model.

The builder pattern makes it easy to:

  • Configure your model piece by piece
  • Change only the parts you want while keeping default settings for the rest
  • Create different variations of models without writing repetitive code

Methods

Method Summary
AiModelResult<T, TInput, TOutput> Build(Matrix<T> covariates, Vector<int> treatment, Vector<T> outcome) Builds a causal model from covariates, who was treated, and what happened to them.
AiModelResult<T, TInput, TOutput> Build(Matrix<T> features, Vector<T> times, Vector<int> events) Builds a causal model from covariates, who was treated, and what happened to them.
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) Reconstructs a model from a previously serialized byte array.
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) Configures A/B testing to compare multiple model versions by splitting traffic.
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) Configures data augmentation for training and inference.
IAiModelBuilder<T, TInput, TOutput> ConfigureAugmentation(AugmentationConfig<T, TInput> config) Configures data augmentation for training and inference.
IAiModelBuilder<T, TInput, TOutput> ConfigureAutoML(AutoMLOptions<T, TInput, TOutput> options) Configures AutoML with a caller-supplied AutoML model implementation (the advanced overload; the ConfigureAutoML overload takes a budget preset instead).
IAiModelBuilder<T, TInput, TOutput> ConfigureAutoML(IAutoMLModel<T, TInput, TOutput> autoMLModel) Configures AutoML with a caller-supplied AutoML model implementation (the advanced overload; the ConfigureAutoML overload takes a budget preset instead).
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) Configures model caching to avoid reloading models from disk repeatedly.
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) Configures model compression for reducing model size during serialization.
IAiModelBuilder<T, TInput, TOutput> ConfigureContinualLearning(IContinualLearningStrategy<T, TInput, TOutput> strategy, IContinualLearnerConfig<T> config) Configures a continual learning trainer that can learn new tasks without forgetting old ones.
IAiModelBuilder<T, TInput, TOutput> ConfigureCreditRule(CreditRule rule, int? seed) Selects a custom ICreditRule 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 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; null uses a Random Network Distillation default.
IAiModelBuilder<T, TInput, TOutput> ConfigureCurriculumLearning(CurriculumLearningOptions<T, TInput, TOutput> options) Configures curriculum learning for training models with progressively harder samples.
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 the data loader for providing training data.
IAiModelBuilder<T, TInput, TOutput> ConfigureDataLoader(IDataLoader<T> dataLoader) Configures the data loader for providing training data.
IAiModelBuilder<T, TInput, TOutput> ConfigureDataPreparation(Action<DataPreparationPipeline<T>> pipelineBuilder) Configures the data preparation pipeline for row-changing operations.
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: budgets, islands, the archive grid, persistence, and tracing.
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 organizing and logging ML experiments.
IAiModelBuilder<T, TInput, TOutput> ConfigureExplorationStrategy(IExplorationStrategy<T> strategy) Configures an exploration strategy for reinforcement learning agents.
IAiModelBuilder<T, TInput, TOutput> ConfigureExport(ExportConfig config) Configures export settings for deploying the model to different platforms.
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 (money-side analogue of ConfigureClusterMetric), added on top of the default financial-metric set that runs automatically for any financial or time-series fore…
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 the fit detector component for the model.
IAiModelBuilder<T, TInput, TOutput> ConfigureFitnessCalculator(IFitnessCalculator<T, TInput, TOutput> calculator) Configures the fitness calculator component for the model.
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 GPU backend diagnostic output visibility and routing.
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 — feature attribution and explanations — on the built result.
IAiModelBuilder<T, TInput, TOutput> ConfigureJitCompilation(JitCompilationConfig config) Configures JIT (Just-In-Time) compilation for the built model’s forward-pass replay.
IAiModelBuilder<T, TInput, TOutput> ConfigureKnowledgeDistillation(KnowledgeDistillationOptions<T, TInput, TOutput> options) Configures knowledge distillation for training a smaller 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) Configures a license key for encrypted model loading and saving with optional online validation.
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 training memory management — gradient checkpointing and activation pooling — so large models (e.g.
IAiModelBuilder<T, TInput, TOutput> ConfigureMetaLearning(IMetaLearner<T, TInput, TOutput> metaLearner) Configures a meta-learning algorithm (MAML, Reptile, SEAL) for training models that can quickly adapt to new tasks.
IAiModelBuilder<T, TInput, TOutput> ConfigureMixedPrecision(MixedPrecisionConfig config) Configures mixed-precision training for faster neural network training with reduced memory usage.
IAiModelBuilder<T, TInput, TOutput> ConfigureModel(IFullModel<T, TInput, TOutput> model) Configures the model from a pretrained checkpoint (Hugging Face hub id or local safetensors directory), reconstructing the architecture and loading its weights automatically.
IAiModelBuilder<T, TInput, TOutput> ConfigureModel(PretrainedSource source) Configures the model from a pretrained checkpoint (Hugging Face hub id or local safetensors directory), reconstructing the architecture and loading its weights automatically.
IAiModelBuilder<T, TInput, TOutput> ConfigureModel(PretrainedSource source, DeviceInfo device) Configures the model from a pretrained checkpoint and places it on the given device — the common “load this model straight onto my GPU” case.
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 for the model.
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 in the supplied directory.
IAiModelBuilder<T, TInput, TOutput> ConfigurePostprocessing(Action<PostprocessingPipeline<T, TOutput, TOutput>> configure) Configures the output postprocessing pipeline for the model using an existing pipeline.
IAiModelBuilder<T, TInput, TOutput> ConfigurePostprocessing(IDataTransformer<T, TOutput, TOutput> transformer) Configures the output postprocessing pipeline for the model using an existing pipeline.
IAiModelBuilder<T, TInput, TOutput> ConfigurePostprocessing(PostprocessingPipeline<T, TOutput, TOutput> pipeline) Configures the output postprocessing pipeline for the model using an existing pipeline.
IAiModelBuilder<T, TInput, TOutput> ConfigurePreprocessing(Action<PreprocessingPipeline<T, TInput, TInput>> configure) Configures the preprocessing stage directly from a prebuilt PreprocessingPipeline (the overload for callers that already assembled one).
IAiModelBuilder<T, TInput, TOutput> ConfigurePreprocessing(IDataTransformer<T, TInput, TInput> transformer) Configures the preprocessing stage directly from a prebuilt PreprocessingPipeline (the overload for callers that already assembled one).
IAiModelBuilder<T, TInput, TOutput> ConfigurePreprocessing(PreprocessingPipeline<T, TInput, TInput> pipeline) Configures the preprocessing stage directly from a prebuilt PreprocessingPipeline (the overload for callers that already assembled one).
IAiModelBuilder<T, TInput, TOutput> ConfigureProfiling(ProfilingConfig config) Configures a runtime profiling pass over the build/inference path to capture timing and resource usage.
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 built-in Program Synthesis defaults for code tasks.
IAiModelBuilder<T, TInput, TOutput> ConfigureProgramSynthesisServing(ProgramSynthesisServingClientOptions options, IProgramSynthesisServingClient client) Configures Program Synthesis to prefer calling AiDotNet.Serving for sandboxed execution and evaluation.
IAiModelBuilder<T, TInput, TOutput> ConfigureQuantization(QuantizationConfig config) Configures model quantization for reducing model size and improving inference speed.
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 RAG configuration into the builder’s RAG components (chunking, embedding, document store + retriever, reranking, context compression).
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 the regularization component for 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 how segmentation results are drawn as an overlay on the source image.
IAiModelBuilder<T, TInput, TOutput> ConfigureSelfSupervisedLearning(Action<SelfSupervisedLearningConfig<T>> configure) Configures self-supervised pretraining (configuration-only — SSL settings are stored but no pretraining stage runs).
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 pretraining with a user-supplied typed hook (AiDotNet#1361 wire-up).
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 token-generation models as the draft “guesser” (built via ConfigureModel or loaded, e.g.
IAiModelBuilder<T, TInput, TOutput> ConfigureSpeculativeDecoding(IFullModel<T, TInput, TOutput> draftModel, SpeculativeDecodingOptions options) Enables and configures speculative decoding using one of your own token-generation models as the draft “guesser” (built via ConfigureModel or loaded, e.g.
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: targets are scaled before training (fit on the TRAINING split only; default z-score via TargetStandardScaler) and Predict automatically inverse-transforms outputs back to the ORIGINAL ta…
IAiModelBuilder<T, TInput, TOutput> ConfigureTelemetry(TelemetryConfig config) Configures telemetry for tracking and monitoring model inference metrics.
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 (one fit per query group per epoch) for ranking-style objectives — see the builder method for semantics.
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 index (Flat / HNSW / IVF / LSH) with a similarity metric 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, building a default dense retriever over it.
IAiModelBuilder<T, TInput, TOutput> ConfigureVersioning(VersioningConfig config) Configures model versioning for managing multiple versions of the same model.
IAiModelBuilder<T, TInput, TOutput> ConfigureWeightStreaming(WeightStreamingConfig config) Configures Float16/Int8 weight streaming so very large models can run without holding all weights in memory at once.
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 SIMD/GPU/native-BLAS acceleration status at build time, logs it, and surfaces a structured snapshot on PredictionModelResult.AccelerationSnapshot.
TOutput Predict(TInput newData, AiModelResult<T, TInput, TOutput> model) Uses a trained model to make predictions on new data.
Task<AiModelResult<T, TInput, TOutput>> BuildAsync() Asynchronously builds a meta-trained model that can quickly adapt to new tasks.
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 rather than through a data loader.
byte[] SerializeModel(AiModelResult<T, TInput, TOutput> model) Converts a trained model into a byte array for storage or transmission.
void SaveModel(AiModelResult<T, TInput, TOutput> model, string filePath) Saves a trained model to a file.