Skip to content

Commit 4123969

Browse files
davanstrienclaude
andauthored
Document hf models ls --inference-provider / --warm on the Inference Providers Hub API page (#2632)
* Document hf models ls --inference-provider and --warm on the Hub API page Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Match repo conventions (bash fence, no prompt prefix) + fresher examples Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Surface CLI model discovery on index + first-api-call guide; mention --json Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Use --pipeline-tag (hh#4512) for exact parity with the website filter links Swap the first-api-call TIP's --filter for --pipeline-tag (same filter as the models?pipeline_tag= links, not a tags superset) and add a fal-ai task example to the hub-api CLI block mirroring the curl example above it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Neutral comment wording for the search example Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 58487fb commit 4123969

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

docs/inference-providers/guides/first-api-call.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ Visit the [Hugging Face Hub](https://huggingface.co/models?pipeline_tag=text-to-
2222

2323
For this example, we'll use [FLUX.1-schnell](https://huggingface.co/black-forest-labs/FLUX.1-schnell), a powerful text-to-image model. Next, navigate to the model page and scroll down to find the inference widget on the right side.
2424

25+
> [!TIP]
26+
> You can also do this step from the terminal — or have a coding agent do it for you. The `hf` CLI (installed with `huggingface_hub`) supports the same filters:
27+
>
28+
> ```bash
29+
> hf models ls --pipeline-tag text-to-image --warm --sort trending_score
30+
> ```
31+
>
32+
> Swap `--warm` for `--inference-provider fal-ai` to narrow to a specific provider, or add `--json` for machine-readable output. See the [Hub API page](https://huggingface.co/docs/inference-providers/hub-api) for the full set of filters.
33+
2534
## Step 2: Try the Interactive Widget
2635
2736
Before writing any code, try the widget directly on the [model page](https://huggingface.co/black-forest-labs/FLUX.1-dev?inference_provider=fal-ai):

docs/inference-providers/hub-api.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,24 @@ Finally, you can select all models served by at least one inference provider:
5252
"BagOu22/Lora_HKLPAZ"
5353
```
5454

55+
The same filters are available from the terminal with the [`hf` CLI](https://huggingface.co/docs/huggingface_hub/package_reference/cli#hf-models-list):
56+
57+
```bash
58+
# List models served by at least one inference provider
59+
hf models ls --warm
60+
61+
# Search served models for GLM-5.2
62+
hf models ls --warm --search GLM-5.2
63+
64+
# List text-to-image models served by Fal AI
65+
hf models ls --inference-provider fal-ai --pipeline-tag text-to-image
66+
67+
# List models served by Fireworks AI, most downloaded first
68+
hf models ls --inference-provider fireworks-ai --sort downloads
69+
```
70+
71+
Repeat `--inference-provider` to match models served by any of several providers. Add `--expand inferenceProviderMapping` to see which provider serves each model and the provider-specific model id, or `--json` for machine-readable output.
72+
5573
## Get model status
5674

5775
To find an inference provider for a specific model, request the `inference` attribute in the model info endpoint:

docs/inference-providers/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ Before diving into integration, explore models interactively with our [Inference
9898

9999
<a href="https://huggingface.co/playground" target="blank"><img src="https://cdn-uploads.huggingface.co/production/uploads/5f17f0a0925b9863e28ad517/9_Tgf0Tv65srhBirZQMTp.png" alt="Inference Playground thumbnail" style="max-width: 550px; width: 100%;"/></a>
100100

101+
Prefer the terminal? Run `hf models ls --warm` with the [`hf` CLI](https://huggingface.co/docs/huggingface_hub/package_reference/cli#hf-models-list) to list every model served by at least one provider, and add `--json` for scripts and agents. See the [Hub API](./hub-api) page for the full set of filters.
102+
101103
### Authentication
102104

103105
You'll need a Hugging Face token to authenticate your requests. Create one by visiting your [token settings](https://huggingface.co/settings/tokens/new?ownUserPermissions=inference.serverless.write&tokenType=fineGrained) and generating a `fine-grained` token with `Make calls to Inference Providers` permissions.

0 commit comments

Comments
 (0)