Class HuggingFaceModel


public class HuggingFaceModel extends OpenAiCompatibleModel
A model instance that carries additional metadata discovered from the Hugging Face Hub.
  • Field Details

    • hubConfig

      private com.fasterxml.jackson.databind.JsonNode hubConfig
      The raw JSON from the model's 'config.json', containing architectural details and token limits.
    • tokenizerConfig

      private com.fasterxml.jackson.databind.JsonNode tokenizerConfig
      The raw JSON from the model's 'tokenizer_config.json', used to discover chat templates and tool support markers.
    • generationConfig

      private com.fasterxml.jackson.databind.JsonNode generationConfig
      The raw JSON from the model's 'generation_config.json', used to extract default sampling parameters like temperature and top-p.
    • supportsFunctionCalling

      private boolean supportsFunctionCalling
      Flag derived from the chat template or config indicating if the model supports tool calling.
  • Constructor Details

    • HuggingFaceModel

      public HuggingFaceModel(HuggingFaceProvider provider, String modelId, String displayName)
      Constructs a new Hugging Face model instance.
      Parameters:
      provider - The owning HF provider.
      modelId - The full repo ID.
      displayName - The display name.
  • Method Details

    • isSupportsFunctionCalling

      public boolean isSupportsFunctionCalling()
      Checks if this model supports native function calling (tools).

      Implementation details: Returns the value discovered during the Hub inspection phase.

      Overrides:
      isSupportsFunctionCalling in class OpenAiCompatibleModel
      Returns:
      true if supported.
    • buildHubHtmlDescription

      public String buildHubHtmlDescription()
      Builds a rich HTML view combining architecture, tokenizer class, and deep-inspected sampling parameters.
      Returns:
      The formatted HTML summary string.