Class Model
java.lang.Object
eu.svjatoslav.alyverkko_cli.model.Model
Represents an AI model stored on the filesystem with metadata about its capabilities and identification. This class serves as a lightweight container for model information, enabling quick lookup and validation.
Models are typically discovered through configuration files and stored in the ModelLibrary for easy access.
Key fields include:
- filesystemPath - Location of the model file
- contextSizeTokens - Maximum token capacity for this model
- alias - User-friendly identifier for the model
- endOfTextMarker - Optional response completion marker
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringA user-friendly alias for the model, e.g.final intThe size of the context (in tokens) that this model is able to handle.final StringAn optional marker indicating end of the AI-generated text (e.g., "###").final FileThe path to the model file on the filesystem.Minimum probability threshold for candidate tokens (null if not configured).Model-specific repeat penalty value (null if not configured).Model-specific temperature value (null if not configured).Model-specific Top-K parameter controlling token selection (null if not configured).Model-specific top-p value (null if not configured). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidPrints the model's metadata to standard output in a consistent format.
-
Field Details
-
filesystemPath
The path to the model file on the filesystem. -
contextSizeTokens
public final int contextSizeTokensThe size of the context (in tokens) that this model is able to handle. -
alias
A user-friendly alias for the model, e.g. "default" or "mistral". -
endOfTextMarker
An optional marker indicating end of the AI-generated text (e.g., "###"). If non-null, it can be used to detect where the model has finished answering. -
temperature
Model-specific temperature value (null if not configured). -
topP
Model-specific top-p value (null if not configured). -
topK
Model-specific Top-K parameter controlling token selection (null if not configured). -
minP
Minimum probability threshold for candidate tokens (null if not configured). -
repeatPenalty
Model-specific repeat penalty value (null if not configured).
-
-
Constructor Details
-
Model
public Model(File filesystemPath, int contextSizeTokens, String modelAlias, String endOfTextMarker, Float temperature, Float topP, Float repeatPenalty, Float topK, Float minP) Constructs aModelinstance with all hyperparameters.- Parameters:
filesystemPath- The path to the model file on the filesystem.contextSizeTokens- Maximum token capacity of this model.modelAlias- User-friendly identifier for the model.endOfTextMarker- Optional response completion marker.temperature- Sampling temperature (higher = more creative)topP- Nucleus sampling threshold (0.0-1.0)repeatPenalty- Penalty for token repetition (>0.0)topK- Token selection cutoff for Top-K sampling (>=1)minP- Minimum relative probability threshold (0.0-1.0)
-
-
Method Details
-
printModelDetails
public void printModelDetails()Prints the model's metadata to standard output in a consistent format. This includes the model's alias, filesystem path, and context token capacity. The output format is designed to be both human-readable and machine-parsable when needed.
Typical output:
Model: default Path: /path/to/model.gguf Context size: 32768
-