Skip to content

Commit da646fe

Browse files
committed
clarify some woridng
1 parent 63d51d6 commit da646fe

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

docs/inference-providers/index.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ You can now use the the client with a Python interpreter:
105105
import os
106106
from huggingface_hub import InferenceClient
107107

108-
client = InferenceClient(
109-
api_key=os.environ["HF_TOKEN"],
110-
)
108+
client = InferenceClient()
111109

112110
completion = client.chat.completions.create(
113111
model="deepseek-ai/DeepSeek-V3-0324",
@@ -128,7 +126,7 @@ print(completion.choices[0].message)
128126

129127
If you're already using OpenAI's Python client, then you need a **drop-in OpenAI replacement**. Just swap-out the base URL to instantly access hundreds of additional open-weights models through our provider network.
130128

131-
Our system automatically routes your request to the optimal provider for the specified model:
129+
Our system automatically routes your request to the most popular provider for the specified model. You can also order the available providers from your [user settings](https://huggingface.co/settings/inference-providers), in that case we will route your request to the first provider supporting the model.
132130

133131
```python
134132
import os
@@ -148,8 +146,6 @@ completion = client.chat.completions.create(
148146
}
149147
],
150148
)
151-
152-
For maximum control and interoperability with custom frameworks, use our OpenAI-compatible REST API directly.
153149
```
154150

155151
</hfoption>
@@ -284,7 +280,8 @@ console.log(await response.json());
284280

285281
#### HTTP / cURL
286282

287-
For testing, debugging, or integrating with any HTTP client, here's the raw REST API format. Our intelligent routing automatically selects the optimal provider for your requested model:
283+
For testing, debugging, or integrating with any HTTP client, here's the raw REST API format. Our intelligent routing automatically selects the most popular provider for your requested model,
284+
or to your preferred provider if you've sorted the providers from your [user settings](https://huggingface.co/settings/inference-providers).
288285

289286
```bash
290287
curl https://router.huggingface.co/v1/chat/completions \
@@ -355,11 +352,10 @@ The Inference Providers API acts as a unified proxy layer that sits between your
355352
When using Inference Providers, your requests go through Hugging Face's proxy infrastructure, which provides several key benefits:
356353

357354
- **Unified Authentication & Billing**: Use a single Hugging Face token for all providers
358-
- **Automatic Failover**: If one provider is unavailable, requests can be routed to alternatives
359-
- **Rate Limiting & Load Balancing**: Intelligent distribution of requests across providers
360-
- **Consistent API Interface**: The same request format works across different providers
355+
- **Automatic Failover**: When using automatic provider selection (`provider="auto"`), requests are automatically routed to alternative providers if the primary provider is flagged as unavailable by our validation system
356+
- **Consistent Interface through client libraries**: When using our client libraries, the same request format works across different providers
361357

362-
Because the API acts as a proxy, the exact HTTP request may vary between providers as each provider has their own API requirements and response formats. The Hugging Face inference clients handle these provider-specific differences automatically when you use `provider="auto"` or specify a particular provider.
358+
Because the API acts as a proxy, the exact HTTP request may vary between providers as each provider has their own API requirements and response formats. **When using our official client libraries** (JavaScript or Python), these provider-specific differences are handled automatically whether you use `provider="auto"` or specify a particular provider.
363359

364360
### Client-Side Provider Selection (Inference Clients)
365361

0 commit comments

Comments
 (0)