Class ModelCard
Represents metadata and attributes for a language model in the LM-Kit library.
public class ModelCard
- Inheritance
-
ModelCard
- Inherited Members
Constructors
- ModelCard(Uri)
Initializes a new instance of the ModelCard class with the specified model URI.
Properties
- Architecture
Gets or sets the architecture type of the model. Ie: 'llama', 'bert', 'phi3'...
- Capabilities
Gets or sets the capabilities of the model, indicating the tasks it is designed to perform. Examples: Chat, Embeddings, TextGeneration, CodeCompletion.
- ContextLength
Gets or sets the maximum context length (in tokens) supported by the model.
- Description
Gets or sets a brief description of the model, explaining its purpose or capabilities.
- FileName
Gets the name of the file associated with the model's URI. If the URI points to a local file, the file name is extracted from the path. If the URI represents a remote model, the name is derived.
- FileSize
Gets or sets the size of the model file in bytes.
- Format
Gets or sets the format of the model (e.g., GGUF, LMK, ONNX, etc.).
- IsLocallyAvailable
Gets a value indicating whether the model file is locally available.
- IsPredefined
Indicates whether the model is part of the predefined collection of commonly used models.
- License
Gets or sets the license associated with the model. This defines how the model can be used or distributed. Example: "apache-2.0", "mit", or "proprietary".
- LocalPath
Gets the local file system path of the model.
- ModelID
Gets or sets the unique identifier for the model. This identifier is used to uniquely reference a model within the LM-Kit library and should conform to industry naming conventions. For predefined models, this value is automatically set and should not be changed. For user-defined models, it can be manually assigned.
- ModelName
Gets or sets the name of the model.
- ModelUri
Gets or sets the URI where the model can be downloaded or accessed.
- ParameterCount
Gets or sets the number of parameters in the model, represented as an unsigned long.
- Publisher
Gets or sets the publisher of the model. If not set explicitly, this information is derived from the model metadata.
- QuantizationPrecision
Gets or sets the quantization precision of the model, represented in bits (e.g., 4-bit, 8-bit).
- ReplacementModel
Gets the replacement model to use when the current model is considered legacy.
- Repository
Gets or sets the repository associated with the model. If not set explicitly, this information is derived from the model metadata.
- SHA256
Gets or sets the SHA-256 checksum of the model file for verification purposes.
- ShortModelName
Gets a shortened version of the model name, typically with certain details like size or other specific information removed.
Methods
- CreateFromFile(string)
Creates a ModelCard instance by loading metadata from the specified file path.
- Download(ModelDownloadingProgressCallback)
Downloads the model file from its specified URI and saves it locally.
- DownloadAsync(ModelDownloadingProgressCallback)
Asynchronously downloads the model file from its specified URI and saves it locally.
- GetPredefinedModelCardByModelID(string)
Retrieves a predefined ModelCard instance by its unique model identifier.
- GetPredefinedModelCards(bool)
Retrieves a predefined list of commonly used ModelCard instances.
- ValidateFileChecksum()
Validates the integrity of the model file by comparing its SHA-256 checksum with the expected checksum.