# `HuggingfaceClient.Hub.Models`
[🔗](https://github.com/huggingface/huggingface_client/blob/v0.1.0/lib/huggingface_client/hub/models.ex#L1)

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")

# `get`

```elixir
@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`

```elixir
@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`

```elixir
@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`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
