Inference models

Forward-only inference models with zero gradient or optimizer memory overhead and O(1)-step KV-cache decoding: InferenceDecoderOnlyModel, InferenceEncoderDecoderModel, InferenceModel, InferenceRnnModel.

class InferenceDecoderOnlyModel JBit · Model/Inference/InferenceDecoderOnlyModel.hpp · 3 members

Flat contiguous weight storage with zero gradient/Adam buffers and per-layer KV-cache for fast autoregressive token generation.

inherits Model
explicit InferenceDecoderOnlyModel(const TrainingDecoderOnlyModel &trainedModel);
static InferenceDecoderOnlyModel fromCheckpoint(const std::string &filePath) / fromGGUF(...) / fromONNX(...);
int predictNextToken(PayloadTensor1D &batch) / std::vector<int> inference(PayloadTensor1D &batch, size_t max_len, std::ostream *outputStream = nullptr, size_t tokensPerWrite = 1);
class InferenceModel JBit · Model/Inference/InferenceModel.hpp · 2 members

Compact forward-only sequential/CNN/RNN inference model.

inherits Model
explicit InferenceModel(const TrainingModel &trainedModel);
Tensor1D predict(const Tensor1D &input) / Tensor1D predict(const std::vector<real_t> &input) / Tensor2D predictBatch(const Tensor2D &inputs);