Class Model

java.lang.Object
eu.svjatoslav.alyverkko_cli.model.Model

public class Model extends Object

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

    Fields
    Modifier and Type
    Field
    Description
    final String
    A user-friendly alias for the model, e.g.
    final int
    The size of the context (in tokens) that this model is able to handle.
    final String
    An optional marker indicating end of the AI-generated text (e.g., "###").
    final File
    The 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
    Constructor
    Description
    Model(File filesystemPath, int contextSizeTokens, String modelAlias, String endOfTextMarker, Float temperature, Float topP, Float repeatPenalty, Float topK, Float minP)
    Constructs a Model instance with all hyperparameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Prints the model's metadata to standard output in a consistent format.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • filesystemPath

      public final File filesystemPath
      The path to the model file on the filesystem.
    • contextSizeTokens

      public final int contextSizeTokens
      The size of the context (in tokens) that this model is able to handle.
    • alias

      public final String alias
      A user-friendly alias for the model, e.g. "default" or "mistral".
    • endOfTextMarker

      public final String 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

      public Float temperature
      Model-specific temperature value (null if not configured).
    • topP

      public Float topP
      Model-specific top-p value (null if not configured).
    • topK

      public Float topK
      Model-specific Top-K parameter controlling token selection (null if not configured).
    • minP

      public Float minP
      Minimum probability threshold for candidate tokens (null if not configured).
    • repeatPenalty

      public Float 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 a Model instance 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