diff --git a/docs/inference-providers/guides/building-first-app.md b/docs/inference-providers/guides/building-first-app.md index 9ba00420a..57c79ce45 100644 --- a/docs/inference-providers/guides/building-first-app.md +++ b/docs/inference-providers/guides/building-first-app.md @@ -55,11 +55,8 @@ export HF_TOKEN="your_token_here" const HF_TOKEN = process.env.HF_TOKEN; ``` - - -When we deploy our app to Hugging Face Spaces, we'll need to add our token as a secret. This is a secure way to handle the token and avoid exposing it in the code. - - +> [!WARNING] +> When we deploy our app to Hugging Face Spaces, we'll need to add our token as a secret. This is a secure way to handle the token and avoid exposing it in the code. @@ -179,11 +176,8 @@ We'll also need to implement the `transcribe` and `summarize` functions. Now let's implement the transcription using OpenAI's `whisper-large-v3` model for fast, reliable speech processing. - - -We'll use the `auto` provider to automatically select the first available provider for the model. You can define your own priority list of providers in the [Inference Providers](https://huggingface.co/settings/inference-providers) page. - - +> [!TIP] +> We'll use the `auto` provider to automatically select the first available provider for the model. You can define your own priority list of providers in the [Inference Providers](https://huggingface.co/settings/inference-providers) page. ```python def transcribe_audio(audio_file_path): @@ -205,11 +199,8 @@ def transcribe_audio(audio_file_path): Now let's implement the transcription using OpenAI's `whisper-large-v3` model for fast, reliable speech processing. - - -We'll use the `auto` provider to automatically select the first available provider for the model. You can define your own priority list of providers in the [Inference Providers](https://huggingface.co/settings/inference-providers) page. - - +> [!TIP] +> We'll use the `auto` provider to automatically select the first available provider for the model. You can define your own priority list of providers in the [Inference Providers](https://huggingface.co/settings/inference-providers) page. ```javascript import { InferenceClient } from 'https://esm.sh/@huggingface/inference'; diff --git a/docs/inference-providers/guides/first-api-call.md b/docs/inference-providers/guides/first-api-call.md index 5331fd7ab..682255b54 100644 --- a/docs/inference-providers/guides/first-api-call.md +++ b/docs/inference-providers/guides/first-api-call.md @@ -11,11 +11,8 @@ Many developers avoid using open source AI models because they assume deployment We're going to use the [FLUX.1-schnell](https://huggingface.co/black-forest-labs/FLUX.1-schnell) model, which is a powerful text-to-image model. - - -This guide assumes you have a Hugging Face account. If you don't have one, you can create one for free at [huggingface.co](https://huggingface.co). - - +> [!TIP] +> This guide assumes you have a Hugging Face account. If you don't have one, you can create one for free at [huggingface.co](https://huggingface.co). ## Step 1: Find a Model on the Hub @@ -39,11 +36,8 @@ Here, you can test the model directly in the browser from any of the available p This widget uses the same endpoint you're about to implement in code. - - -You'll need a Hugging Face account (free at [huggingface.co](https://huggingface.co)) and remaining credits to use the model. - - +> [!WARNING] +> You'll need a Hugging Face account (free at [huggingface.co](https://huggingface.co)) and remaining credits to use the model. ## Step 3: From Clicks to Code @@ -59,11 +53,8 @@ Set your token as an environment variable: export HF_TOKEN="your_token_here" ``` - - -You can add this line to your `.bash_profile` or similar file for all your terminal environments to automatically source the token. - - +> [!TIP] +> You can add this line to your `.bash_profile` or similar file for all your terminal environments to automatically source the token. The Python or TypeScript code snippet will use the token from the environment variable. diff --git a/docs/inference-providers/guides/function-calling.md b/docs/inference-providers/guides/function-calling.md index f8e596156..b53198dcb 100644 --- a/docs/inference-providers/guides/function-calling.md +++ b/docs/inference-providers/guides/function-calling.md @@ -4,11 +4,8 @@ Function calling enables language models to interact with external tools and API When you provide a language model that has been fine-tuned to use tools with function descriptions, it can decide when to call these functions based on user requests, execute them, and incorporate the results into natural language responses. For example, you can build an assistant that fetches real-time weather data to provide accurate responses. - - -This guide assumes you have a Hugging Face account and access token. You can create a free account at [huggingface.co](https://huggingface.co) and get your token from your [settings page](https://huggingface.co/settings/tokens). - - +> [!TIP] +> This guide assumes you have a Hugging Face account and access token. You can create a free account at [huggingface.co](https://huggingface.co) and get your token from your [settings page](https://huggingface.co/settings/tokens). ## Defining Functions @@ -126,11 +123,8 @@ response = client.chat.completions.create( response_message = response.choices[0].message ``` - - -The `tool_choice` parameter is used to control when the model calls functions. In this case, we're using `auto`, which means the model will decide when to call functions (0 or more times). Below we'll expand on `tool_choice` and other parameters. - - +> [!TIP] +> The `tool_choice` parameter is used to control when the model calls functions. In this case, we're using `auto`, which means the model will decide when to call functions (0 or more times). Below we'll expand on `tool_choice` and other parameters. Next, we need to check in the model response where the model decided to call any functions. If it did, we need to execute the function and add the result to the conversation, before we send the final response to the user. @@ -172,11 +166,8 @@ else: The workflow is straightforward: make an initial API call with your tools, check if the model wants to call functions, execute them if needed, add the results to the conversation, and get the final response for the user. - - -We have handled the case where the model wants to call a function and that the function actually exists. However, models might try to call functions that don’t exist, so we need to account for that as well. We can also deal with this using `strict` mode, which we'll cover later. - - +> [!WARNING] +> We have handled the case where the model wants to call a function and that the function actually exists. However, models might try to call functions that don’t exist, so we need to account for that as well. We can also deal with this using `strict` mode, which we'll cover later. ## Multiple Functions @@ -341,11 +332,8 @@ client = InferenceClient( By switching provider, you can see the model's response change because each provider uses a different configuration of the model. - - -Each inference provider has different capabilities and performance characteristics. You can find more information about each provider in the [Inference Providers](/inference-providers/index#partners) section. - - +> [!WARNING] +> Each inference provider has different capabilities and performance characteristics. You can find more information about each provider in the [Inference Providers](/inference-providers/index#partners) section. ### Tool Choice Options @@ -402,11 +390,8 @@ Here, we're forcing the model to call the `get_current_weather` function, and no - - -Currently, `huggingface_hub.InferenceClient` does not support the `tool_choice` parameters that specify which function to call. - - +> [!WARNING] +> Currently, `huggingface_hub.InferenceClient` does not support the `tool_choice` parameters that specify which function to call. @@ -440,11 +425,8 @@ tools = [ Strict mode ensures that function arguments match your schema exactly: no additional properties are allowed, all required parameters must be provided, and data types are strictly enforced. - - -Strict mode is not supported by all providers. You can check the provider's documentation to see if it supports strict mode. - - +> [!WARNING] +> Strict mode is not supported by all providers. You can check the provider's documentation to see if it supports strict mode. ### Streaming Responses @@ -473,11 +455,8 @@ for chunk in stream: Streaming allows you to process responses as they arrive, show real-time progress to users, and handle long-running function calls more efficiently. - - -Streaming is not supported by all providers. You can check the provider's documentation to see if it supports streaming, or you can refer to this [dynamic model compatibility table](https://huggingface.co/inference-providers/models). - - +> [!WARNING] +> Streaming is not supported by all providers. You can check the provider's documentation to see if it supports streaming, or you can refer to this [dynamic model compatibility table](https://huggingface.co/inference-providers/models). ## Next Steps diff --git a/docs/inference-providers/guides/gpt-oss.md b/docs/inference-providers/guides/gpt-oss.md index 44d56cd85..bddddd542 100644 --- a/docs/inference-providers/guides/gpt-oss.md +++ b/docs/inference-providers/guides/gpt-oss.md @@ -16,11 +16,8 @@ Both models are supported on Inference Providers and can be accessed through eit export HF_TOKEN="your_token_here" ``` - - -💡 Pro tip: The free tier gives you monthly inference credits to start building and experimenting. Upgrade to [Hugging Face PRO](https://huggingface.co/pro) for even more flexibility, $2 in monthly credits plus pay‑as‑you‑go access to all providers! - - +> [!TIP] +> 💡 Pro tip: The free tier gives you monthly inference credits to start building and experimenting. Upgrade to [Hugging Face PRO](https://huggingface.co/pro) for even more flexibility, $2 in monthly credits plus pay‑as‑you‑go access to all providers! 2. Install the official OpenAI SDK. @@ -293,11 +290,8 @@ Key Advantages: - Stateful, Event-Driven Architecture: Features a stateful, event-driven architecture. Instead of resending the entire text on every update, it streams semantic events that describe only the precise change (the "delta"). This eliminates the need for manual state tracking. - Simplified Development for Complex Logic: The event-driven model makes it easier to build reliable applications with multi-step logic. Your code simply listens for specific events, leading to cleaner and more robust integrations. - - -The implementation is based on the open-source [huggingface/responses.js](https://github.com/huggingface/responses.js) project. - - +> [!TIP] +> The implementation is based on the open-source [huggingface/responses.js](https://github.com/huggingface/responses.js) project. ### Stream responses diff --git a/docs/inference-providers/guides/image-editor.md b/docs/inference-providers/guides/image-editor.md index e9a919a97..42f3407da 100644 --- a/docs/inference-providers/guides/image-editor.md +++ b/docs/inference-providers/guides/image-editor.md @@ -9,11 +9,8 @@ Our app will: 3. **Transform images** using Qwen Image Edit or FLUX.1 Kontext 4. **Display results** in a Gradio interface - - -TL;DR - this guide will show you how to build an AI image editor with Gradio and Inference Providers, just like [this one](https://huggingface.co/spaces/Qwen/Qwen-Image-Edit). - - +> [!TIP] +> TL;DR - this guide will show you how to build an AI image editor with Gradio and Inference Providers, just like [this one](https://huggingface.co/spaces/Qwen/Qwen-Image-Edit). ## Step 1: Set Up Authentication @@ -24,11 +21,8 @@ Before we start coding, authenticate with Hugging Face using your token: export HF_TOKEN="your_token_here" ``` - - -This guide assumes you have a Hugging Face account. If you don't have one, you can create one for free at [huggingface.co](https://huggingface.co). - - +> [!TIP] +> This guide assumes you have a Hugging Face account. If you don't have one, you can create one for free at [huggingface.co](https://huggingface.co). When you set this environment variable, it handles authentication automatically for all your inference calls. You can generate a token from [your settings page](https://huggingface.co/settings/tokens/new?ownUserPermissions=inference.serverless.write&tokenType=fineGrained). @@ -50,11 +44,8 @@ uv add huggingface-hub>=0.34.4 gradio>=5.0.0 pillow>=11.3.0 The dependencies are now installed and ready to use! Also, `uv` will maintain the `pyproject.toml` file for you as you add dependencies. - - -We're using `uv` because it's a fast Python package manager that handles dependency resolution and virtual environment management automatically. It's much faster than pip and provides better dependency resolution. If you're not familiar with `uv`, check it out [here](https://docs.astral.sh/uv/). - - +> [!TIP] +> We're using `uv` because it's a fast Python package manager that handles dependency resolution and virtual environment management automatically. It's much faster than pip and provides better dependency resolution. If you're not familiar with `uv`, check it out [here](https://docs.astral.sh/uv/). ## Step 3: Build the Core Image Editing Function @@ -115,18 +106,15 @@ def edit_image(input_image, prompt): return input_image ``` - - -We're using the `fal-ai` provider with the `Qwen/Qwen-Image-Edit` model. The fal-ai provider offers fast inference times, perfect for interactive applications. - -However, you can experiment with different providers for various performance characteristics: - -```python -client = InferenceClient(provider="replicate", api_key=os.environ["HF_TOKEN"]) -client = InferenceClient(provider="auto", api_key=os.environ["HF_TOKEN"]) # Automatic selection -``` - - +> [!TIP] +> We're using the `fal-ai` provider with the `Qwen/Qwen-Image-Edit` model. The fal-ai provider offers fast inference times, perfect for interactive applications. +> +> However, you can experiment with different providers for various performance characteristics: +> +> ```python +> client = InferenceClient(provider="replicate", api_key=os.environ["HF_TOKEN"]) +> client = InferenceClient(provider="auto", api_key=os.environ["HF_TOKEN"]) # Automatic selection +> ``` ## Step 4: Create the Gradio Interface @@ -322,11 +310,8 @@ uv export --format requirements-txt --output-file requirements.txt This creates a `requirements.txt` file with all your project dependencies and their exact versions from the lockfile. - - -The `uv export` command ensures that your Space will use the exact same dependency versions that you tested locally, preventing deployment issues caused by version mismatches. - - +> [!TIP] +> The `uv export` command ensures that your Space will use the exact same dependency versions that you tested locally, preventing deployment issues caused by version mismatches. Now you can deploy to Spaces: diff --git a/docs/inference-providers/guides/structured-output.md b/docs/inference-providers/guides/structured-output.md index 2ecf29ce1..31b2172e3 100644 --- a/docs/inference-providers/guides/structured-output.md +++ b/docs/inference-providers/guides/structured-output.md @@ -4,11 +4,8 @@ In this guide, we'll show you how to use Inference Providers to generate structu Structured outputs guarantee a model returns a response that matches your exact schema every time. This eliminates the need for complex parsing logic and makes your applications more robust. - - -This guide assumes you have a Hugging Face account. If you don't have one, you can create one for free at [huggingface.co](https://huggingface.co). - - +> [!TIP] +> This guide assumes you have a Hugging Face account. If you don't have one, you can create one for free at [huggingface.co](https://huggingface.co). ## What Are Structured Outputs? @@ -113,11 +110,8 @@ client = OpenAI( - - -Structured outputs are a good use case for selecting a specific provider and model because you want to avoid incompatibility issues between the model, provider and the schema. - - +> [!TIP] +> Structured outputs are a good use case for selecting a specific provider and model because you want to avoid incompatibility issues between the model, provider and the schema. ## Step 3: Generate structured output diff --git a/docs/inference-providers/guides/vscode.md b/docs/inference-providers/guides/vscode.md index 7d62e8453..9fb68dae2 100644 --- a/docs/inference-providers/guides/vscode.md +++ b/docs/inference-providers/guides/vscode.md @@ -13,11 +13,8 @@ Use frontier open LLMs like Kimi K2, DeepSeek V3.1, GLM 4.5 and more in VS Code 5. Enter your Hugging Face Token. You can get one from your [settings page](https://huggingface.co/settings/tokens/new?ownUserPermissions=inference.serverless.write&tokenType=fineGrained). 6. Choose the models you want to add to the model picker. 🥳 - - -VS Code 1.104.0+ is required to install the HF Copilot Chat extension. If "Hugging Face" doesn't appear in the Copilot provider list, update VS Code, then reload. - - +> [!TIP] +> VS Code 1.104.0+ is required to install the HF Copilot Chat extension. If "Hugging Face" doesn't appear in the Copilot provider list, update VS Code, then reload. ## ✨ Why use the Hugging Face provider in Copilot diff --git a/docs/inference-providers/pricing.md b/docs/inference-providers/pricing.md index b4e78164a..22286b731 100644 --- a/docs/inference-providers/pricing.md +++ b/docs/inference-providers/pricing.md @@ -12,11 +12,8 @@ Every Hugging Face user receives monthly credits to experiment with Inference Pr | PRO Users | $2.00 | yes | | Team or Enterprise Organizations | $2.00 per seat | yes | - - -Your monthly credits automatically apply when you route requests through Hugging Face. For Team or Enterprise organizations, credits are shared among all members. - - +> [!TIP] +> Your monthly credits automatically apply when you route requests through Hugging Face. For Team or Enterprise organizations, credits are shared among all members. ## How Billing Works: Choose Your Approach @@ -44,11 +41,8 @@ See the [Organization Billing section](#organization-billing) below for more det **PRO users and Enterprise Hub organizations** can continue using the API after exhausting their monthly credits. This ensures uninterrupted access to models for production workloads. - - -Hugging Face charges you the same rates as the provider, with no additional fees. We just pass through the provider costs directly. - - +> [!TIP] +> Hugging Face charges you the same rates as the provider, with no additional fees. We just pass through the provider costs directly. You can track your spending anytime on your [billing page](https://huggingface.co/settings/billing). @@ -67,11 +61,8 @@ Here is a table that sums up what we've seen so far: | **Routed Requests** | Yes | Hugging Face | Yes | Only for PRO users and for integrated providers | SDKs, Playground, widgets, Data AI Studio | | **Custom Provider Key** | Yes | Provider | No | Yes | SDKs, Playground, widgets, Data AI Studio | - - -You can set your custom provider key in the [settings page](https://huggingface.co/settings/inference-providers) on the Hub, or in the `InferenceClient` when using the JavaScript or Python SDKs. When making a routed request with a custom key, your code remains unchanged—you can still pass your Hugging Face User Access Token. Hugging Face will automatically swap the authentication when routing the request. - - +> [!TIP] +> You can set your custom provider key in the [settings page](https://huggingface.co/settings/inference-providers) on the Hub, or in the `InferenceClient` when using the JavaScript or Python SDKs. When making a routed request with a custom key, your code remains unchanged—you can still pass your Hugging Face User Access Token. Hugging Face will automatically swap the authentication when routing the request. ## HF-Inference cost diff --git a/docs/inference-providers/providers/cerebras.md b/docs/inference-providers/providers/cerebras.md index 10a030964..4235ba8f0 100644 --- a/docs/inference-providers/providers/cerebras.md +++ b/docs/inference-providers/providers/cerebras.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # Cerebras - - -All supported Cerebras models can be found [here](https://huggingface.co/models?inference_provider=cerebras&sort=trending) - - +> [!TIP] +> All supported Cerebras models can be found [here](https://huggingface.co/models?inference_provider=cerebras&sort=trending)
diff --git a/docs/inference-providers/providers/cohere.md b/docs/inference-providers/providers/cohere.md index bce401ec0..ed9f1df06 100644 --- a/docs/inference-providers/providers/cohere.md +++ b/docs/inference-providers/providers/cohere.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # Cohere - - -All supported Cohere models can be found [here](https://huggingface.co/models?inference_provider=cohere&sort=trending) - - +> [!TIP] +> All supported Cohere models can be found [here](https://huggingface.co/models?inference_provider=cohere&sort=trending)
diff --git a/docs/inference-providers/providers/fal-ai.md b/docs/inference-providers/providers/fal-ai.md index 800142765..ab9a3b805 100644 --- a/docs/inference-providers/providers/fal-ai.md +++ b/docs/inference-providers/providers/fal-ai.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # Fal - - -All supported Fal models can be found [here](https://huggingface.co/models?inference_provider=fal-ai&sort=trending) - - +> [!TIP] +> All supported Fal models can be found [here](https://huggingface.co/models?inference_provider=fal-ai&sort=trending)
diff --git a/docs/inference-providers/providers/featherless-ai.md b/docs/inference-providers/providers/featherless-ai.md index 2f89a71fb..eccb16fce 100644 --- a/docs/inference-providers/providers/featherless-ai.md +++ b/docs/inference-providers/providers/featherless-ai.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # Featherless AI - - -All supported Featherless AI models can be found [here](https://huggingface.co/models?inference_provider=featherless-ai&sort=trending) - - +> [!TIP] +> All supported Featherless AI models can be found [here](https://huggingface.co/models?inference_provider=featherless-ai&sort=trending)
diff --git a/docs/inference-providers/providers/fireworks-ai.md b/docs/inference-providers/providers/fireworks-ai.md index 458b4a795..dd3d6e9e5 100644 --- a/docs/inference-providers/providers/fireworks-ai.md +++ b/docs/inference-providers/providers/fireworks-ai.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # Fireworks AI - - -All supported Fireworks AI models can be found [here](https://huggingface.co/models?inference_provider=fireworks-ai&sort=trending) - - +> [!TIP] +> All supported Fireworks AI models can be found [here](https://huggingface.co/models?inference_provider=fireworks-ai&sort=trending)
diff --git a/docs/inference-providers/providers/groq.md b/docs/inference-providers/providers/groq.md index 80df0503b..397376acc 100644 --- a/docs/inference-providers/providers/groq.md +++ b/docs/inference-providers/providers/groq.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # Groq - - -All supported Groq models can be found [here](https://huggingface.co/models?inference_provider=groq&sort=trending) - - +> [!TIP] +> All supported Groq models can be found [here](https://huggingface.co/models?inference_provider=groq&sort=trending)
diff --git a/docs/inference-providers/providers/hf-inference.md b/docs/inference-providers/providers/hf-inference.md index 9de8a9a61..438022dc9 100644 --- a/docs/inference-providers/providers/hf-inference.md +++ b/docs/inference-providers/providers/hf-inference.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # HF Inference - - -All supported HF Inference models can be found [here](https://huggingface.co/models?inference_provider=hf-inference&sort=trending) - - +> [!TIP] +> All supported HF Inference models can be found [here](https://huggingface.co/models?inference_provider=hf-inference&sort=trending)
diff --git a/docs/inference-providers/providers/hyperbolic.md b/docs/inference-providers/providers/hyperbolic.md index b9c6fbbf2..4d468d41b 100644 --- a/docs/inference-providers/providers/hyperbolic.md +++ b/docs/inference-providers/providers/hyperbolic.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # Hyperbolic: The On-Demand AI Cloud - - -All supported Hyperbolic models can be found [here](https://huggingface.co/models?inference_provider=hyperbolic&sort=trending) - - +> [!TIP] +> All supported Hyperbolic models can be found [here](https://huggingface.co/models?inference_provider=hyperbolic&sort=trending)
diff --git a/docs/inference-providers/providers/nebius.md b/docs/inference-providers/providers/nebius.md index 7d7ab29cc..72fc63175 100644 --- a/docs/inference-providers/providers/nebius.md +++ b/docs/inference-providers/providers/nebius.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # Nebius - - -All supported Nebius models can be found [here](https://huggingface.co/models?inference_provider=nebius&sort=trending) - - +> [!TIP] +> All supported Nebius models can be found [here](https://huggingface.co/models?inference_provider=nebius&sort=trending)
diff --git a/docs/inference-providers/providers/novita.md b/docs/inference-providers/providers/novita.md index 8e5d5df82..1ea629f60 100644 --- a/docs/inference-providers/providers/novita.md +++ b/docs/inference-providers/providers/novita.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # Novita - - -All supported Novita models can be found [here](https://huggingface.co/models?inference_provider=novita&sort=trending) - - +> [!TIP] +> All supported Novita models can be found [here](https://huggingface.co/models?inference_provider=novita&sort=trending)
diff --git a/docs/inference-providers/providers/nscale.md b/docs/inference-providers/providers/nscale.md index f84d741cb..fbb3a3960 100644 --- a/docs/inference-providers/providers/nscale.md +++ b/docs/inference-providers/providers/nscale.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # Nscale - - -All supported Nscale models can be found [here](https://huggingface.co/models?inference_provider=nscale&sort=trending) - - +> [!TIP] +> All supported Nscale models can be found [here](https://huggingface.co/models?inference_provider=nscale&sort=trending)
diff --git a/docs/inference-providers/providers/publicai.md b/docs/inference-providers/providers/publicai.md index 5d578408c..21a7627cb 100644 --- a/docs/inference-providers/providers/publicai.md +++ b/docs/inference-providers/providers/publicai.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # PublicAI - - -All models supported by the PublicAI Inference Utility can be found [here](https://huggingface.co/models?inference_provider=publicai&sort=trending) - - +> [!TIP] +> All models supported by the PublicAI Inference Utility can be found [here](https://huggingface.co/models?inference_provider=publicai&sort=trending)
diff --git a/docs/inference-providers/providers/replicate.md b/docs/inference-providers/providers/replicate.md index 677f10d31..de9832ff4 100644 --- a/docs/inference-providers/providers/replicate.md +++ b/docs/inference-providers/providers/replicate.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # Replicate - - -All supported Replicate models can be found [here](https://huggingface.co/models?inference_provider=replicate&sort=trending) - - +> [!TIP] +> All supported Replicate models can be found [here](https://huggingface.co/models?inference_provider=replicate&sort=trending)
diff --git a/docs/inference-providers/providers/sambanova.md b/docs/inference-providers/providers/sambanova.md index fefd34b9b..df463faf5 100644 --- a/docs/inference-providers/providers/sambanova.md +++ b/docs/inference-providers/providers/sambanova.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # SambaNova - - -All supported SambaNova models can be found [here](https://huggingface.co/models?inference_provider=sambanova&sort=trending) - - +> [!TIP] +> All supported SambaNova models can be found [here](https://huggingface.co/models?inference_provider=sambanova&sort=trending)
diff --git a/docs/inference-providers/providers/scaleway.md b/docs/inference-providers/providers/scaleway.md index 1dbf5cc4c..b44591e36 100644 --- a/docs/inference-providers/providers/scaleway.md +++ b/docs/inference-providers/providers/scaleway.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # Scaleway - - -All supported Scaleway models can be found [here](https://huggingface.co/models?inference_provider=scaleway&sort=trending) - - +> [!TIP] +> All supported Scaleway models can be found [here](https://huggingface.co/models?inference_provider=scaleway&sort=trending)
diff --git a/docs/inference-providers/providers/together.md b/docs/inference-providers/providers/together.md index 9b5035ef7..f73670045 100644 --- a/docs/inference-providers/providers/together.md +++ b/docs/inference-providers/providers/together.md @@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging # Together - - -All supported Together models can be found [here](https://huggingface.co/models?inference_provider=together&sort=trending) - - +> [!TIP] +> All supported Together models can be found [here](https://huggingface.co/models?inference_provider=together&sort=trending)
diff --git a/docs/inference-providers/register-as-a-provider.md b/docs/inference-providers/register-as-a-provider.md index 2f62c4676..9952e161f 100644 --- a/docs/inference-providers/register-as-a-provider.md +++ b/docs/inference-providers/register-as-a-provider.md @@ -1,18 +1,12 @@ # How to be registered as an inference provider on the Hub? - +> [!TIP] +> Want to be listed as an Inference Provider on the Hugging Face Hub? Let's get in touch! +> +> Please reach out to us on social networks or [here on the Hub](https://huggingface.co/spaces/huggingface/HuggingDiscussions/discussions/49). -Want to be listed as an Inference Provider on the Hugging Face Hub? Let's get in touch! - -Please reach out to us on social networks or [here on the Hub](https://huggingface.co/spaces/huggingface/HuggingDiscussions/discussions/49). - - - - - -Note that Step 3 will require your organization to upgrade their Hub account to a [Team or Enterprise plan](https://huggingface.co/pricing). - - +> [!WARNING] +> Note that Step 3 will require your organization to upgrade their Hub account to a [Team or Enterprise plan](https://huggingface.co/pricing). This guide details the steps for registering as an inference provider on the Hub and provides implementation guidance. @@ -29,11 +23,8 @@ This guide details the steps for registering as an inference provider on the Hub ## 1. Prerequisites - - -If your implementation strictly follows the OpenAI API for LLMs and VLMs, you may be able to skip most of this section. In that case, simply open a PR on [huggingface.js](https://github.com/huggingface/huggingface.js/tree/main/packages/inference) to register. - - +> [!TIP] +> If your implementation strictly follows the OpenAI API for LLMs and VLMs, you may be able to skip most of this section. In that case, simply open a PR on [huggingface.js](https://github.com/huggingface/huggingface.js/tree/main/packages/inference) to register. The first step to understand the integration is to take a look at the JS inference client that lives inside the [huggingface.js](https://github.com/huggingface/huggingface.js/tree/main/packages/inference) repo. @@ -58,13 +49,10 @@ or "text-to-image". It is indicated prominently on model pages, here: The list of all possible tasks can be found at https://huggingface.co/tasks and the list of JS method names is documented in the README at https://github.com/huggingface/huggingface.js/tree/main/packages/inference. - - -Note that `chatCompletion` is an exception as it is not a pipeline_tag, per se. Instead, it -includes models with either `pipeline_tag="text-generation"` or `pipeline_tag="image-text-to-text"` -which are tagged as "conversational". - - +> [!TIP] +> Note that `chatCompletion` is an exception as it is not a pipeline_tag, per se. Instead, it +> includes models with either `pipeline_tag="text-generation"` or `pipeline_tag="image-text-to-text"` +> which are tagged as "conversational". ### Task API schema @@ -135,11 +123,8 @@ Congratulations! You now have a JS implementation to successfully make inference First step is to use the Model Mapping API to register which HF models are supported. - - -To proceed with this step, we have to enable your account server-side. Make sure you have an organization on the Hub for your company, and upgrade it to a [Team or Enterprise plan](https://huggingface.co/pricing). - - +> [!TIP] +> To proceed with this step, we have to enable your account server-side. Make sure you have an organization on the Hub for your company, and upgrade it to a [Team or Enterprise plan](https://huggingface.co/pricing). ### Register a mapping item @@ -183,11 +168,8 @@ We also support mapping HF models based on their `tags`. Using tag filters, you For example, any model tagged with both `lora` and `base_model:adapter:black-forest-labs/FLUX.1-dev` can be mapped to your Flux-dev LoRA inference endpoint. - - -Important: Make sure that the JS client library can handle LoRA weights for your provider. Check out [fal's implementation](https://github.com/huggingface/huggingface.js/blob/904964c9f8cd10ed67114ccb88b9028e89fd6cad/packages/inference/src/providers/fal-ai.ts#L78-L124) for more details. - - +> [!TIP] +> Important: Make sure that the JS client library can handle LoRA weights for your provider. Check out [fal's implementation](https://github.com/huggingface/huggingface.js/blob/904964c9f8cd10ed67114ccb88b9028e89fd6cad/packages/inference/src/providers/fal-ai.ts#L78-L124) for more details. The API is as follows: @@ -250,11 +232,8 @@ GET /api/partners/{provider}/models?status=staging|live ``` This gets all mapping items from the DB. For clarity, the output is grouped by task. - - -This is publicly accessible. It's useful to be transparent by default and it helps debug client SDKs, etc. - - +> [!WARNING] +> This is publicly accessible. It's useful to be transparent by default and it helps debug client SDKs, etc. Here is an example of response: @@ -416,11 +395,8 @@ Inference-Id: unique-id-00131 ## 5. Python client integration - - -Before adding a new provider to the `huggingface_hub` Python library, make sure that all the previous steps have been completed and everything is working on the Hub. Support in the Python library comes as a second step. - - +> [!TIP] +> Before adding a new provider to the `huggingface_hub` Python library, make sure that all the previous steps have been completed and everything is working on the Hub. Support in the Python library comes as a second step. ### Implement the provider helper (Python) diff --git a/docs/inference-providers/tasks/audio-classification.md b/docs/inference-providers/tasks/audio-classification.md index fcc01910f..379f76354 100644 --- a/docs/inference-providers/tasks/audio-classification.md +++ b/docs/inference-providers/tasks/audio-classification.md @@ -21,11 +21,8 @@ Example applications: * Identifying a speaker * Detecting the genre of a song - - -For more details about the `audio-classification` task, check out its [dedicated page](https://huggingface.co/tasks/audio-classification)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `audio-classification` task, check out its [dedicated page](https://huggingface.co/tasks/audio-classification)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/automatic-speech-recognition.md b/docs/inference-providers/tasks/automatic-speech-recognition.md index 5e04d7548..f7d0f2d73 100644 --- a/docs/inference-providers/tasks/automatic-speech-recognition.md +++ b/docs/inference-providers/tasks/automatic-speech-recognition.md @@ -21,11 +21,8 @@ Example applications: * Building a voice assistant * Generating subtitles for a video - - -For more details about the `automatic-speech-recognition` task, check out its [dedicated page](https://huggingface.co/tasks/automatic-speech-recognition)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `automatic-speech-recognition` task, check out its [dedicated page](https://huggingface.co/tasks/automatic-speech-recognition)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/feature-extraction.md b/docs/inference-providers/tasks/feature-extraction.md index bdb6c786a..feeaf9547 100644 --- a/docs/inference-providers/tasks/feature-extraction.md +++ b/docs/inference-providers/tasks/feature-extraction.md @@ -21,11 +21,8 @@ Example applications: * Reranking a list of documents based on their similarity to a query. * Calculating the similarity between two sentences. - - -For more details about the `feature-extraction` task, check out its [dedicated page](https://huggingface.co/tasks/feature-extraction)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `feature-extraction` task, check out its [dedicated page](https://huggingface.co/tasks/feature-extraction)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/fill-mask.md b/docs/inference-providers/tasks/fill-mask.md index f8839a82f..55000d75b 100644 --- a/docs/inference-providers/tasks/fill-mask.md +++ b/docs/inference-providers/tasks/fill-mask.md @@ -16,11 +16,8 @@ For more details, check out: Mask filling is the task of predicting the right word (token to be precise) in the middle of a sequence. - - -For more details about the `fill-mask` task, check out its [dedicated page](https://huggingface.co/tasks/fill-mask)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `fill-mask` task, check out its [dedicated page](https://huggingface.co/tasks/fill-mask)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/image-classification.md b/docs/inference-providers/tasks/image-classification.md index 6c3864f8d..97ac6c361 100644 --- a/docs/inference-providers/tasks/image-classification.md +++ b/docs/inference-providers/tasks/image-classification.md @@ -16,11 +16,8 @@ For more details, check out: Image classification is the task of assigning a label or class to an entire image. Images are expected to have only one class for each image. - - -For more details about the `image-classification` task, check out its [dedicated page](https://huggingface.co/tasks/image-classification)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `image-classification` task, check out its [dedicated page](https://huggingface.co/tasks/image-classification)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/image-segmentation.md b/docs/inference-providers/tasks/image-segmentation.md index 1ceca0e68..48bfdb28d 100644 --- a/docs/inference-providers/tasks/image-segmentation.md +++ b/docs/inference-providers/tasks/image-segmentation.md @@ -16,11 +16,8 @@ For more details, check out: Image Segmentation divides an image into segments where each pixel in the image is mapped to an object. - - -For more details about the `image-segmentation` task, check out its [dedicated page](https://huggingface.co/tasks/image-segmentation)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `image-segmentation` task, check out its [dedicated page](https://huggingface.co/tasks/image-segmentation)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/image-text-to-text.md b/docs/inference-providers/tasks/image-text-to-text.md index eef80d473..5ad5a4dcd 100644 --- a/docs/inference-providers/tasks/image-text-to-text.md +++ b/docs/inference-providers/tasks/image-text-to-text.md @@ -16,11 +16,8 @@ For more details, check out: Image-text-to-text models take in an image and text prompt and output text. These models are also called vision-language models, or VLMs. The difference from image-to-text models is that these models take an additional text input, not restricting the model to certain use cases like image captioning, and may also be trained to accept a conversation as input. - - -For more details about the `image-text-to-text` task, check out its [dedicated page](https://huggingface.co/tasks/image-text-to-text)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `image-text-to-text` task, check out its [dedicated page](https://huggingface.co/tasks/image-text-to-text)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/image-to-image.md b/docs/inference-providers/tasks/image-to-image.md index 392614205..4515d9d16 100644 --- a/docs/inference-providers/tasks/image-to-image.md +++ b/docs/inference-providers/tasks/image-to-image.md @@ -21,11 +21,8 @@ Example applications: * Colorizing a black and white image * Increasing the resolution of an image - - -For more details about the `image-to-image` task, check out its [dedicated page](https://huggingface.co/tasks/image-to-image)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `image-to-image` task, check out its [dedicated page](https://huggingface.co/tasks/image-to-image)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/object-detection.md b/docs/inference-providers/tasks/object-detection.md index 3c36c4081..d484cb1df 100644 --- a/docs/inference-providers/tasks/object-detection.md +++ b/docs/inference-providers/tasks/object-detection.md @@ -16,11 +16,8 @@ For more details, check out: Object Detection models allow users to identify objects of certain defined classes. These models receive an image as input and output the images with bounding boxes and labels on detected objects. - - -For more details about the `object-detection` task, check out its [dedicated page](https://huggingface.co/tasks/object-detection)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `object-detection` task, check out its [dedicated page](https://huggingface.co/tasks/object-detection)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/question-answering.md b/docs/inference-providers/tasks/question-answering.md index 2f1330014..2f4a4a436 100644 --- a/docs/inference-providers/tasks/question-answering.md +++ b/docs/inference-providers/tasks/question-answering.md @@ -16,11 +16,8 @@ For more details, check out: Question Answering models can retrieve the answer to a question from a given text, which is useful for searching for an answer in a document. - - -For more details about the `question-answering` task, check out its [dedicated page](https://huggingface.co/tasks/question-answering)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `question-answering` task, check out its [dedicated page](https://huggingface.co/tasks/question-answering)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/summarization.md b/docs/inference-providers/tasks/summarization.md index 6d3994406..114956850 100644 --- a/docs/inference-providers/tasks/summarization.md +++ b/docs/inference-providers/tasks/summarization.md @@ -16,11 +16,8 @@ For more details, check out: Summarization is the task of producing a shorter version of a document while preserving its important information. Some models can extract text from the original input, while other models can generate entirely new text. - - -For more details about the `summarization` task, check out its [dedicated page](https://huggingface.co/tasks/summarization)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `summarization` task, check out its [dedicated page](https://huggingface.co/tasks/summarization)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/table-question-answering.md b/docs/inference-providers/tasks/table-question-answering.md index 358287c69..4834bc808 100644 --- a/docs/inference-providers/tasks/table-question-answering.md +++ b/docs/inference-providers/tasks/table-question-answering.md @@ -16,11 +16,8 @@ For more details, check out: Table Question Answering (Table QA) is the answering a question about an information on a given table. - - -For more details about the `table-question-answering` task, check out its [dedicated page](https://huggingface.co/tasks/table-question-answering)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `table-question-answering` task, check out its [dedicated page](https://huggingface.co/tasks/table-question-answering)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/text-classification.md b/docs/inference-providers/tasks/text-classification.md index 5e30ee191..5274c67ab 100644 --- a/docs/inference-providers/tasks/text-classification.md +++ b/docs/inference-providers/tasks/text-classification.md @@ -16,11 +16,8 @@ For more details, check out: Text Classification is the task of assigning a label or class to a given text. Some use cases are sentiment analysis, natural language inference, and assessing grammatical correctness. - - -For more details about the `text-classification` task, check out its [dedicated page](https://huggingface.co/tasks/text-classification)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `text-classification` task, check out its [dedicated page](https://huggingface.co/tasks/text-classification)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/text-generation.md b/docs/inference-providers/tasks/text-generation.md index 3cf64a02b..f929e1cb0 100644 --- a/docs/inference-providers/tasks/text-generation.md +++ b/docs/inference-providers/tasks/text-generation.md @@ -18,11 +18,8 @@ Generate text based on a prompt. If you are interested in a Chat Completion task, which generates a response based on a list of messages, check out the [`chat-completion`](./chat_completion) task. - - -For more details about the `text-generation` task, check out its [dedicated page](https://huggingface.co/tasks/text-generation)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `text-generation` task, check out its [dedicated page](https://huggingface.co/tasks/text-generation)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/text-to-image.md b/docs/inference-providers/tasks/text-to-image.md index 08eaa0b37..2b485f7b7 100644 --- a/docs/inference-providers/tasks/text-to-image.md +++ b/docs/inference-providers/tasks/text-to-image.md @@ -16,11 +16,8 @@ For more details, check out: Generate an image based on a given text prompt. - - -For more details about the `text-to-image` task, check out its [dedicated page](https://huggingface.co/tasks/text-to-image)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `text-to-image` task, check out its [dedicated page](https://huggingface.co/tasks/text-to-image)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/text-to-video.md b/docs/inference-providers/tasks/text-to-video.md index 9d8625958..3b17a8e57 100644 --- a/docs/inference-providers/tasks/text-to-video.md +++ b/docs/inference-providers/tasks/text-to-video.md @@ -16,11 +16,8 @@ For more details, check out: Generate an video based on a given text prompt. - - -For more details about the `text-to-video` task, check out its [dedicated page](https://huggingface.co/tasks/text-to-video)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `text-to-video` task, check out its [dedicated page](https://huggingface.co/tasks/text-to-video)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/token-classification.md b/docs/inference-providers/tasks/token-classification.md index 3636602eb..5bbcfb447 100644 --- a/docs/inference-providers/tasks/token-classification.md +++ b/docs/inference-providers/tasks/token-classification.md @@ -16,11 +16,8 @@ For more details, check out: Token classification is a task in which a label is assigned to some tokens in a text. Some popular token classification subtasks are Named Entity Recognition (NER) and Part-of-Speech (PoS) tagging. - - -For more details about the `token-classification` task, check out its [dedicated page](https://huggingface.co/tasks/token-classification)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `token-classification` task, check out its [dedicated page](https://huggingface.co/tasks/token-classification)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/translation.md b/docs/inference-providers/tasks/translation.md index 5aa8b1c61..94ecc0e5c 100644 --- a/docs/inference-providers/tasks/translation.md +++ b/docs/inference-providers/tasks/translation.md @@ -16,11 +16,8 @@ For more details, check out: Translation is the task of converting text from one language to another. - - -For more details about the `translation` task, check out its [dedicated page](https://huggingface.co/tasks/translation)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `translation` task, check out its [dedicated page](https://huggingface.co/tasks/translation)! You will find examples and related materials. ### Recommended models diff --git a/docs/inference-providers/tasks/zero-shot-classification.md b/docs/inference-providers/tasks/zero-shot-classification.md index 6a9f4768a..08851fdf1 100644 --- a/docs/inference-providers/tasks/zero-shot-classification.md +++ b/docs/inference-providers/tasks/zero-shot-classification.md @@ -16,11 +16,8 @@ For more details, check out: Zero-shot text classification is super useful to try out classification with zero code, you simply pass a sentence/paragraph and the possible labels for that sentence, and you get a result. The model has not been necessarily trained on the labels you provide, but it can still predict the correct label. - - -For more details about the `zero-shot-classification` task, check out its [dedicated page](https://huggingface.co/tasks/zero-shot-classification)! You will find examples and related materials. - - +> [!TIP] +> For more details about the `zero-shot-classification` task, check out its [dedicated page](https://huggingface.co/tasks/zero-shot-classification)! You will find examples and related materials. ### Recommended models