Skip to content

Commit df7e8de

Browse files
authored
[inference-providers, sagemaker] Use blockquote rather than deprecated <Tip> component (#1951)
1 parent 0020dbd commit df7e8de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+149
-356
lines changed

docs/inference-providers/guides/building-first-app.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,8 @@ export HF_TOKEN="your_token_here"
5555
const HF_TOKEN = process.env.HF_TOKEN;
5656
```
5757

58-
<Tip warning={true}>
59-
60-
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.
61-
62-
</Tip>
58+
> [!WARNING]
59+
> 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.
6360
6461
</hfoption>
6562
</hfoptions>
@@ -179,11 +176,8 @@ We'll also need to implement the `transcribe` and `summarize` functions.
179176
180177
Now let's implement the transcription using OpenAI's `whisper-large-v3` model for fast, reliable speech processing.
181178
182-
<Tip>
183-
184-
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.
185-
186-
</Tip>
179+
> [!TIP]
180+
> 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.
187181
188182
```python
189183
def transcribe_audio(audio_file_path):
@@ -205,11 +199,8 @@ def transcribe_audio(audio_file_path):
205199
206200
Now let's implement the transcription using OpenAI's `whisper-large-v3` model for fast, reliable speech processing.
207201
208-
<Tip>
209-
210-
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.
211-
212-
</Tip>
202+
> [!TIP]
203+
> 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.
213204
214205
```javascript
215206
import { InferenceClient } from 'https://esm.sh/@huggingface/inference';

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

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ Many developers avoid using open source AI models because they assume deployment
1111

1212
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.
1313

14-
<Tip>
15-
16-
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).
17-
18-
</Tip>
14+
> [!TIP]
15+
> 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).
1916
2017
## Step 1: Find a Model on the Hub
2118

@@ -39,11 +36,8 @@ Here, you can test the model directly in the browser from any of the available p
3936

4037
This widget uses the same endpoint you're about to implement in code.
4138

42-
<Tip warning={true}>
43-
44-
You'll need a Hugging Face account (free at [huggingface.co](https://huggingface.co)) and remaining credits to use the model.
45-
46-
</Tip>
39+
> [!WARNING]
40+
> You'll need a Hugging Face account (free at [huggingface.co](https://huggingface.co)) and remaining credits to use the model.
4741
4842
## Step 3: From Clicks to Code
4943

@@ -59,11 +53,8 @@ Set your token as an environment variable:
5953
export HF_TOKEN="your_token_here"
6054
```
6155

62-
<Tip>
63-
64-
You can add this line to your `.bash_profile` or similar file for all your terminal environments to automatically source the token.
65-
66-
</Tip>
56+
> [!TIP]
57+
> You can add this line to your `.bash_profile` or similar file for all your terminal environments to automatically source the token.
6758
6859
The Python or TypeScript code snippet will use the token from the environment variable.
6960

docs/inference-providers/guides/function-calling.md

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ Function calling enables language models to interact with external tools and API
44

55
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.
66

7-
<Tip>
8-
9-
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).
10-
11-
</Tip>
7+
> [!TIP]
8+
> 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).
129
1310
## Defining Functions
1411

@@ -126,11 +123,8 @@ response = client.chat.completions.create(
126123
response_message = response.choices[0].message
127124
```
128125

129-
<Tip>
130-
131-
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.
132-
133-
</Tip>
126+
> [!TIP]
127+
> 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.
134128
135129
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.
136130

@@ -172,11 +166,8 @@ else:
172166

173167
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.
174168

175-
<Tip warning={true}>
176-
177-
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.
178-
179-
</Tip>
169+
> [!WARNING]
170+
> 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.
180171
181172
## Multiple Functions
182173

@@ -341,11 +332,8 @@ client = InferenceClient(
341332

342333
By switching provider, you can see the model's response change because each provider uses a different configuration of the model.
343334

344-
<Tip warning={true}>
345-
346-
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.
347-
348-
</Tip>
335+
> [!WARNING]
336+
> 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.
349337
350338
### Tool Choice Options
351339

@@ -402,11 +390,8 @@ Here, we're forcing the model to call the `get_current_weather` function, and no
402390

403391
<hfoption id="huggingface_hub">
404392

405-
<Tip warning={true}>
406-
407-
Currently, `huggingface_hub.InferenceClient` does not support the `tool_choice` parameters that specify which function to call.
408-
409-
</Tip>
393+
> [!WARNING]
394+
> Currently, `huggingface_hub.InferenceClient` does not support the `tool_choice` parameters that specify which function to call.
410395
411396
</hfoption>
412397

@@ -440,11 +425,8 @@ tools = [
440425

441426
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.
442427

443-
<Tip warning={true}>
444-
445-
Strict mode is not supported by all providers. You can check the provider's documentation to see if it supports strict mode.
446-
447-
</Tip>
428+
> [!WARNING]
429+
> Strict mode is not supported by all providers. You can check the provider's documentation to see if it supports strict mode.
448430
449431
### Streaming Responses
450432

@@ -473,11 +455,8 @@ for chunk in stream:
473455

474456
Streaming allows you to process responses as they arrive, show real-time progress to users, and handle long-running function calls more efficiently.
475457

476-
<Tip warning={true}>
477-
478-
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).
479-
480-
</Tip>
458+
> [!WARNING]
459+
> 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).
481460
482461
## Next Steps
483462

docs/inference-providers/guides/gpt-oss.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@ Both models are supported on Inference Providers and can be accessed through eit
1616
export HF_TOKEN="your_token_here"
1717
```
1818

19-
<Tip>
20-
21-
💡 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!
22-
23-
</Tip>
19+
> [!TIP]
20+
> 💡 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!
2421
2522
2. Install the official OpenAI SDK.
2623

@@ -293,11 +290,8 @@ Key Advantages:
293290
- 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.
294291
- 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.
295292

296-
<Tip>
297-
298-
The implementation is based on the open-source [huggingface/responses.js](https://github.com/huggingface/responses.js) project.
299-
300-
</Tip>
293+
> [!TIP]
294+
> The implementation is based on the open-source [huggingface/responses.js](https://github.com/huggingface/responses.js) project.
301295
302296
### Stream responses
303297

docs/inference-providers/guides/image-editor.md

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ Our app will:
99
3. **Transform images** using Qwen Image Edit or FLUX.1 Kontext
1010
4. **Display results** in a Gradio interface
1111

12-
<Tip>
13-
14-
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).
15-
16-
</Tip>
12+
> [!TIP]
13+
> 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).
1714
1815
## Step 1: Set Up Authentication
1916

@@ -24,11 +21,8 @@ Before we start coding, authenticate with Hugging Face using your token:
2421
export HF_TOKEN="your_token_here"
2522
```
2623

27-
<Tip>
28-
29-
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).
30-
31-
</Tip>
24+
> [!TIP]
25+
> 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).
3226
3327
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).
3428

@@ -50,11 +44,8 @@ uv add huggingface-hub>=0.34.4 gradio>=5.0.0 pillow>=11.3.0
5044

5145
The dependencies are now installed and ready to use! Also, `uv` will maintain the `pyproject.toml` file for you as you add dependencies.
5246

53-
<Tip>
54-
55-
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/).
56-
57-
</Tip>
47+
> [!TIP]
48+
> 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/).
5849
5950
## Step 3: Build the Core Image Editing Function
6051

@@ -115,18 +106,15 @@ def edit_image(input_image, prompt):
115106
return input_image
116107
```
117108

118-
<Tip>
119-
120-
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.
121-
122-
However, you can experiment with different providers for various performance characteristics:
123-
124-
```python
125-
client = InferenceClient(provider="replicate", api_key=os.environ["HF_TOKEN"])
126-
client = InferenceClient(provider="auto", api_key=os.environ["HF_TOKEN"]) # Automatic selection
127-
```
128-
129-
</Tip>
109+
> [!TIP]
110+
> 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.
111+
>
112+
> However, you can experiment with different providers for various performance characteristics:
113+
>
114+
> ```python
115+
> client = InferenceClient(provider="replicate", api_key=os.environ["HF_TOKEN"])
116+
> client = InferenceClient(provider="auto", api_key=os.environ["HF_TOKEN"]) # Automatic selection
117+
> ```
130118
131119
## Step 4: Create the Gradio Interface
132120
@@ -322,11 +310,8 @@ uv export --format requirements-txt --output-file requirements.txt
322310

323311
This creates a `requirements.txt` file with all your project dependencies and their exact versions from the lockfile.
324312

325-
<Tip>
326-
327-
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.
328-
329-
</Tip>
313+
> [!TIP]
314+
> 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.
330315
331316
Now you can deploy to Spaces:
332317

docs/inference-providers/guides/structured-output.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ In this guide, we'll show you how to use Inference Providers to generate structu
44

55
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.
66

7-
<Tip>
8-
9-
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).
10-
11-
</Tip>
7+
> [!TIP]
8+
> 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).
129
1310
## What Are Structured Outputs?
1411

@@ -113,11 +110,8 @@ client = OpenAI(
113110

114111
</hfoptions>
115112

116-
<Tip>
117-
118-
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.
119-
120-
</Tip>
113+
> [!TIP]
114+
> 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.
121115
122116
## Step 3: Generate structured output
123117

docs/inference-providers/guides/vscode.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@ Use frontier open LLMs like Kimi K2, DeepSeek V3.1, GLM 4.5 and more in VS Code
1313
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).
1414
6. Choose the models you want to add to the model picker. 🥳
1515

16-
<Tip>
17-
18-
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.
19-
20-
</Tip>
16+
> [!TIP]
17+
> 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.
2118
2219
## ✨ Why use the Hugging Face provider in Copilot
2320

docs/inference-providers/pricing.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ Every Hugging Face user receives monthly credits to experiment with Inference Pr
1212
| PRO Users | $2.00 | yes |
1313
| Team or Enterprise Organizations | $2.00 per seat | yes |
1414

15-
<Tip>
16-
17-
Your monthly credits automatically apply when you route requests through Hugging Face. For Team or Enterprise organizations, credits are shared among all members.
18-
19-
</Tip>
15+
> [!TIP]
16+
> Your monthly credits automatically apply when you route requests through Hugging Face. For Team or Enterprise organizations, credits are shared among all members.
2017
2118
## How Billing Works: Choose Your Approach
2219

@@ -44,11 +41,8 @@ See the [Organization Billing section](#organization-billing) below for more det
4441
**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.
4542

4643

47-
<Tip>
48-
49-
Hugging Face charges you the same rates as the provider, with no additional fees. We just pass through the provider costs directly.
50-
51-
</Tip>
44+
> [!TIP]
45+
> Hugging Face charges you the same rates as the provider, with no additional fees. We just pass through the provider costs directly.
5246
5347
You can track your spending anytime on your [billing page](https://huggingface.co/settings/billing).
5448

@@ -67,11 +61,8 @@ Here is a table that sums up what we've seen so far:
6761
| **Routed Requests** | Yes | Hugging Face | Yes | Only for PRO users and for integrated providers | SDKs, Playground, widgets, Data AI Studio |
6862
| **Custom Provider Key** | Yes | Provider | No | Yes | SDKs, Playground, widgets, Data AI Studio |
6963

70-
<Tip>
71-
72-
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.
73-
74-
</Tip>
64+
> [!TIP]
65+
> 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.
7566
7667
## HF-Inference cost
7768

docs/inference-providers/providers/cerebras.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@ For more details, check out the `generate.ts` script: https://github.com/hugging
1919

2020
# Cerebras
2121

22-
<Tip>
23-
24-
All supported Cerebras models can be found [here](https://huggingface.co/models?inference_provider=cerebras&sort=trending)
25-
26-
</Tip>
22+
> [!TIP]
23+
> All supported Cerebras models can be found [here](https://huggingface.co/models?inference_provider=cerebras&sort=trending)
2724
2825
<div class="flex justify-center">
2926
<a href="https://www.cerebras.ai/" target="_blank">

0 commit comments

Comments
 (0)