HuggingfaceClient.Hub.Models (huggingface_client v0.1.0)

Copy Markdown View Source

Search and retrieve model metadata from the HuggingFace Hub.

Usage

# Stream search results
HuggingfaceClient.Hub.Models.list(search: "llama", limit: 20)
|> Enum.to_list()

# Get detailed info for a specific model
{:ok, model} = HuggingfaceClient.Hub.Models.get("meta-llama/Llama-3.1-8B-Instruct")

Summary

Functions

Returns detailed metadata for a specific model.

Returns inference provider mapping for a model (used by ProviderMapping).

Returns a lazy stream of models matching the given filters.

Functions

get(repo_id, opts \\ [])

@spec get(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Exception.t()}

Returns detailed metadata for a specific model.

Options

  • :revision — branch/tag/commit (default: "main")
  • :access_token

get_provider_mapping(repo_id, opts \\ [])

@spec get_provider_mapping(
  String.t(),
  keyword()
) :: {:ok, term()} | {:error, Exception.t()}

Returns inference provider mapping for a model (used by ProviderMapping).

The response is the raw inferenceProviderMapping field from the model API.

list(opts \\ [])

@spec list(keyword()) :: Enumerable.t()

Returns a lazy stream of models matching the given filters.

Options

  • :search — text search query
  • :author — filter by username/org
  • :filter — tag filter, e.g. "text-generation" or list of tags
  • :sort"downloads" | "likes" | "lastModified" | "trending"

  • :direction"-1" (descending, default) | "1"

  • :limit — stop after N results
  • :full — include full model card / safetensor metadata (true | false)

  • :cardData — include README card data
  • :access_token