smollm2 library

SmolLM2 Library.

Classes

BF16Decoder
ChatMessage
Represents a single message in a chat session.
ChatSession
Maintains a sequence of chat messages and can convert them into a prompt format compatible with chat-based language models.
F16Decoder
F32Decoder
HFConfig
HFNames
HFTokenizer
Q16Decoder
Q16Quantized
Q16QuantizedPerBlock
Q16Quantizer
Q8Quantized
Q8QuantizedPerBlock
Q8Quantizer
Quantized
QuantizedPerBlock<B extends Quantized>
SafeTensorFileRepository
SafeTensorInfo
SafeTensorShardRepository
SmolLM2
SmolLM2 model loader and runtime interface.
SmolLM2Exporter
TensorBinaryWriter
TensorDecoderFactory
TensorDTypeDecoder
TensorRepository
TensorRepositoryLoader
TokenGenerationResult
Immutable result object returned after a token generation session.
TokenGenerator
Base contract for language model token generators.
Tokenizer
TokenizerEngine

Enums

ChatRole
Defines the role of a message inside a chat conversation.
QuantType
TokenGenerationStopReason
Describes why token generation finished.
TokenOrigin
Identifies the origin or termination state of an emitted token.

Functions

exportSmolLM2({required String configPath, required String tokenizerPath, required String modelPath, required String outputPath, QuantType quantType = QuantType.q16}) Future<void>

Typedefs

OnTokenEmitted = void Function(int tokenId, String tokenText, TokenOrigin origin)
Callback invoked whenever a token is emitted by the inference engine.