diff --git a/docs/inference-providers/guides/first-api-call.md b/docs/inference-providers/guides/first-api-call.md index 46fc42900..4370a91be 100644 --- a/docs/inference-providers/guides/first-api-call.md +++ b/docs/inference-providers/guides/first-api-call.md @@ -22,6 +22,15 @@ Visit the [Hugging Face Hub](https://huggingface.co/models?pipeline_tag=text-to- 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. +> [!TIP] +> 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: +> +> ```bash +> hf models ls --pipeline-tag text-to-image --warm --sort trending_score +> ``` +> +> 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. + ## Step 2: Try the Interactive Widget 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): diff --git a/docs/inference-providers/hub-api.md b/docs/inference-providers/hub-api.md index a6279b5c7..8b9521880 100644 --- a/docs/inference-providers/hub-api.md +++ b/docs/inference-providers/hub-api.md @@ -52,6 +52,24 @@ Finally, you can select all models served by at least one inference provider: "BagOu22/Lora_HKLPAZ" ``` +The same filters are available from the terminal with the [`hf` CLI](https://huggingface.co/docs/huggingface_hub/package_reference/cli#hf-models-list): + +```bash +# List models served by at least one inference provider +hf models ls --warm + +# Search served models for GLM-5.2 +hf models ls --warm --search GLM-5.2 + +# List text-to-image models served by Fal AI +hf models ls --inference-provider fal-ai --pipeline-tag text-to-image + +# List models served by Fireworks AI, most downloaded first +hf models ls --inference-provider fireworks-ai --sort downloads +``` + +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. + ## Get model status To find an inference provider for a specific model, request the `inference` attribute in the model info endpoint: diff --git a/docs/inference-providers/index.md b/docs/inference-providers/index.md index ca3c483d0..7127c1444 100644 --- a/docs/inference-providers/index.md +++ b/docs/inference-providers/index.md @@ -98,6 +98,8 @@ Before diving into integration, explore models interactively with our [Inference Inference Playground thumbnail +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. + ### Authentication 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.