Class QuantFormatDetector

java.lang.Object
smile.llm.quant.QuantFormatDetector

public final class QuantFormatDetector extends Object
Detects HuggingFace quantization format from config.json.
  • Method Details

    • detect

      public static QuantFormat detect(Path checkpointDir) throws IOException
      Detects the quantization format for a checkpoint directory.
      Parameters:
      checkpointDir - model directory containing config.json.
      Returns:
      detected format (QuantFormat.DENSE when absent).
      Throws:
      IOException - if config.json exists but cannot be parsed.
    • fromConfig

      public static QuantFormat fromConfig(tools.jackson.databind.JsonNode root)
      Parses quantization_config (or related fields) from a config tree.
      Parameters:
      root - config.json root.
      Returns:
      detected format.