Class ModelDescription

java.lang.Object
dev.langchain4j.model.catalog.ModelDescription

@Experimental public class ModelDescription extends Object
Represents metadata about an available model from a provider. This class provides a unified view of model information across different providers.

Only name and provider are required fields. All other fields are optional and may be null depending on what information the provider makes available.

Since:
1.10.0
  • Method Details

    • builder

      public static ModelDescription.Builder builder()
    • name

      public String name()
      Unique identifier for the model as defined by the provider. For example: "gpt-4", "claude-3-opus-20240229", "llama2".
    • displayName

      public String displayName()
      Human-readable display name for the model. If absent, name() will be returned.
    • description

      public String description()
      Optional textual description of the model's characteristics and intended use cases.
    • provider

      public ModelProvider provider()
    • type

      public ModelType type()
      Type of the model (e.g., ModelType.CHAT, ModelType.EMBEDDING, ModelType.IMAGE_GENERATION). May be null if the provider doesn't categorize models or the type is unknown.
    • maxInputTokens

      public Integer maxInputTokens()
      Maximum number of input tokens the model can accept in a single request. This represents the limit on the size of the prompt/input that can be sent to the model. May be null if this information is not provided by the provider.
    • maxOutputTokens

      public Integer maxOutputTokens()
      Maximum number of tokens the model can generate in a single response. This is typically smaller than the context window. May be null if this information is not provided by the provider.
    • createdAt

      public Instant createdAt()
      Timestamp when the model was created or released by the provider. May be null if this information is not available.
    • owner

      public String owner()
      Organization or entity that created or owns the model. For example: "openai", "anthropic", "meta". May be null if this information is not provided.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object