Skip to content

Commit 38a7103

Browse files
Update API inference documentation (automated) (#1588)
Co-authored-by: hanouticelina <[email protected]>
1 parent 3c3f3a8 commit 38a7103

File tree

11 files changed

+32
-33
lines changed

11 files changed

+32
-33
lines changed

docs/api-inference/tasks/chat-completion.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ This is a subtask of [`text-generation`](https://huggingface.co/docs/api-inferen
2323

2424
- [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it): A text-generation model trained to follow instructions.
2525
- [meta-llama/Meta-Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct): Very powerful text generation model trained to follow instructions.
26-
- [microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct): Small yet powerful text generation model.
26+
- [microsoft/phi-4](https://huggingface.co/microsoft/phi-4): Powerful text generation model by Microsoft.
27+
- [PowerInfer/SmallThinker-3B-Preview](https://huggingface.co/PowerInfer/SmallThinker-3B-Preview): A very powerful model with reasoning capabilities.
2728
- [Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct): Strong text generation model to follow instructions.
29+
- [Qwen/Qwen2.5-Coder-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-32B-Instruct): Text generation model used to write code.
2830

2931
#### Conversational Vision-Language Models (VLMs)
3032

31-
- [meta-llama/Llama-3.2-11B-Vision-Instruct](https://huggingface.co/meta-llama/Llama-3.2-11B-Vision-Instruct): Powerful vision language model with great visual understanding and reasoning capabilities.
3233
- [Qwen/Qwen2-VL-7B-Instruct](https://huggingface.co/Qwen/Qwen2-VL-7B-Instruct): Strong image-text-to-text model.
34+
- [Qwen/QVQ-72B-Preview](https://huggingface.co/Qwen/QVQ-72B-Preview): Image-text-to-text model with reasoning capabilities.
3335

3436
### API Playground
3537

@@ -208,11 +210,11 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
208210

209211
<curl>
210212
```bash
211-
curl 'https://api-inference.huggingface.co/models/meta-llama/Llama-3.2-11B-Vision-Instruct/v1/chat/completions' \
213+
curl 'https://api-inference.huggingface.co/models/Qwen/Qwen2-VL-7B-Instruct/v1/chat/completions' \
212214
-H 'Authorization: Bearer hf_***' \
213215
-H 'Content-Type: application/json' \
214216
--data '{
215-
"model": "meta-llama/Llama-3.2-11B-Vision-Instruct",
217+
"model": "Qwen/Qwen2-VL-7B-Instruct",
216218
"messages": [
217219
{
218220
"role": "user",
@@ -262,7 +264,7 @@ messages = [
262264
]
263265

264266
stream = client.chat.completions.create(
265-
model="meta-llama/Llama-3.2-11B-Vision-Instruct",
267+
model="Qwen/Qwen2-VL-7B-Instruct",
266268
messages=messages,
267269
max_tokens=500,
268270
stream=True
@@ -300,7 +302,7 @@ messages = [
300302
]
301303

302304
stream = client.chat.completions.create(
303-
model="meta-llama/Llama-3.2-11B-Vision-Instruct",
305+
model="Qwen/Qwen2-VL-7B-Instruct",
304306
messages=messages,
305307
max_tokens=500,
306308
stream=True
@@ -323,7 +325,7 @@ const client = new HfInference("hf_***");
323325
let out = "";
324326

325327
const stream = client.chatCompletionStream({
326-
model: "meta-llama/Llama-3.2-11B-Vision-Instruct",
328+
model: "Qwen/Qwen2-VL-7B-Instruct",
327329
messages: [
328330
{
329331
role: "user",
@@ -365,7 +367,7 @@ const client = new OpenAI({
365367
let out = "";
366368

367369
const stream = await client.chat.completions.create({
368-
model: "meta-llama/Llama-3.2-11B-Vision-Instruct",
370+
model: "Qwen/Qwen2-VL-7B-Instruct",
369371
messages: [
370372
{
371373
role: "user",

docs/api-inference/tasks/fill-mask.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ For more details about the `fill-mask` task, check out its [dedicated page](http
2424

2525
### Recommended models
2626

27-
- [google-bert/bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased): The famous BERT model.
2827
- [FacebookAI/xlm-roberta-base](https://huggingface.co/FacebookAI/xlm-roberta-base): A multilingual model trained on 100 languages.
2928

3029
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=fill-mask&sort=trending).
@@ -36,7 +35,7 @@ Explore all available models and find the one that suits you best [here](https:/
3635

3736
<curl>
3837
```bash
39-
curl https://api-inference.huggingface.co/models/google-bert/bert-base-uncased \
38+
curl https://api-inference.huggingface.co/models/FacebookAI/xlm-roberta-base \
4039
-X POST \
4140
-d '{"inputs": "The answer to the universe is [MASK]."}' \
4241
-H 'Content-Type: application/json' \
@@ -48,7 +47,7 @@ curl https://api-inference.huggingface.co/models/google-bert/bert-base-uncased \
4847
```py
4948
import requests
5049

51-
API_URL = "https://api-inference.huggingface.co/models/google-bert/bert-base-uncased"
50+
API_URL = "https://api-inference.huggingface.co/models/FacebookAI/xlm-roberta-base"
5251
headers = {"Authorization": "Bearer hf_***"}
5352

5453
def query(payload):
@@ -67,7 +66,7 @@ To use the Python client, see `huggingface_hub`'s [package reference](https://hu
6766
```js
6867
async function query(data) {
6968
const response = await fetch(
70-
"https://api-inference.huggingface.co/models/google-bert/bert-base-uncased",
69+
"https://api-inference.huggingface.co/models/FacebookAI/xlm-roberta-base",
7170
{
7271
headers: {
7372
Authorization: "Bearer hf_***",

docs/api-inference/tasks/image-text-to-text.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ For more details about the `image-text-to-text` task, check out its [dedicated p
2424

2525
### Recommended models
2626

27-
- [meta-llama/Llama-3.2-11B-Vision-Instruct](https://huggingface.co/meta-llama/Llama-3.2-11B-Vision-Instruct): Powerful vision language model with great visual understanding and reasoning capabilities.
2827
- [Qwen/Qwen2-VL-7B-Instruct](https://huggingface.co/Qwen/Qwen2-VL-7B-Instruct): Strong image-text-to-text model.
28+
- [Qwen/QVQ-72B-Preview](https://huggingface.co/Qwen/QVQ-72B-Preview): Image-text-to-text model with reasoning capabilities.
2929

3030
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=image-text-to-text&sort=trending).
3131

@@ -36,7 +36,7 @@ Explore all available models and find the one that suits you best [here](https:/
3636

3737
<curl>
3838
```bash
39-
curl https://api-inference.huggingface.co/models/meta-llama/Llama-3.2-11B-Vision-Instruct \
39+
curl https://api-inference.huggingface.co/models/Qwen/Qwen2-VL-7B-Instruct \
4040
-X POST \
4141
-d '{"inputs": "Can you please let us know more details about your "}' \
4242
-H 'Content-Type: application/json' \
@@ -54,7 +54,7 @@ client = InferenceClient(api_key="hf_***")
5454
messages = "\"Can you please let us know more details about your \""
5555

5656
stream = client.chat.completions.create(
57-
model="meta-llama/Llama-3.2-11B-Vision-Instruct",
57+
model="Qwen/Qwen2-VL-7B-Instruct",
5858
messages=messages,
5959
max_tokens=500,
6060
stream=True
@@ -76,7 +76,7 @@ client = OpenAI(
7676
messages = "\"Can you please let us know more details about your \""
7777

7878
stream = client.chat.completions.create(
79-
model="meta-llama/Llama-3.2-11B-Vision-Instruct",
79+
model="Qwen/Qwen2-VL-7B-Instruct",
8080
messages=messages,
8181
max_tokens=500,
8282
stream=True
@@ -93,7 +93,7 @@ To use the Python client, see `huggingface_hub`'s [package reference](https://hu
9393
```js
9494
async function query(data) {
9595
const response = await fetch(
96-
"https://api-inference.huggingface.co/models/meta-llama/Llama-3.2-11B-Vision-Instruct",
96+
"https://api-inference.huggingface.co/models/Qwen/Qwen2-VL-7B-Instruct",
9797
{
9898
headers: {
9999
Authorization: "Bearer hf_***",

docs/api-inference/tasks/image-to-image.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ For more details about the `image-to-image` task, check out its [dedicated page]
2929

3030
### Recommended models
3131

32-
- [timbrooks/instruct-pix2pix](https://huggingface.co/timbrooks/instruct-pix2pix): A model that takes an image and an instruction to edit the image.
3332

3433
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=image-to-image&sort=trending).
3534

@@ -49,7 +48,7 @@ No snippet available for this task.
4948
| **inputs*** | _string_ | The input image data as a base64-encoded string. If no `parameters` are provided, you can also provide the image data as a raw bytes payload. |
5049
| **parameters** | _object_ | |
5150
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;guidance_scale** | _number_ | For diffusion models. A higher guidance scale value encourages the model to generate images closely linked to the text prompt at the expense of lower image quality. |
52-
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;negative_prompt** | _string[]_ | One or several prompt to guide what NOT to include in image generation. |
51+
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;negative_prompt** | _string_ | One prompt to guide what NOT to include in image generation. |
5352
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;num_inference_steps** | _integer_ | For diffusion models. The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference. |
5453
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target_size** | _object_ | The size in pixel of the output image. |
5554
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width*** | _integer_ | |

docs/api-inference/tasks/question-answering.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ For more details about the `question-answering` task, check out its [dedicated p
2626

2727
- [deepset/roberta-base-squad2](https://huggingface.co/deepset/roberta-base-squad2): A robust baseline model for most question answering domains.
2828
- [distilbert/distilbert-base-cased-distilled-squad](https://huggingface.co/distilbert/distilbert-base-cased-distilled-squad): Small yet robust model that can answer questions.
29-
- [google/tapas-base-finetuned-wtq](https://huggingface.co/google/tapas-base-finetuned-wtq): A special model that can answer questions from tables.
3029

3130
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=question-answering&sort=trending).
3231

docs/api-inference/tasks/table-question-answering.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ For more details about the `table-question-answering` task, check out its [dedic
2424

2525
### Recommended models
2626

27-
- [google/tapas-base-finetuned-wtq](https://huggingface.co/google/tapas-base-finetuned-wtq): A robust table question answering model.
2827

2928
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=table-question-answering&sort=trending).
3029

@@ -35,7 +34,7 @@ Explore all available models and find the one that suits you best [here](https:/
3534

3635
<curl>
3736
```bash
38-
curl https://api-inference.huggingface.co/models/google/tapas-base-finetuned-wtq \
37+
curl https://api-inference.huggingface.co/models/<REPO_ID> \
3938
-X POST \
4039
-d '{"inputs": { "query": "How many stars does the transformers repository have?", "table": { "Repository": ["Transformers", "Datasets", "Tokenizers"], "Stars": ["36542", "4512", "3934"], "Contributors": ["651", "77", "34"], "Programming language": [ "Python", "Python", "Rust, Python and NodeJS" ] } }}' \
4140
-H 'Content-Type: application/json' \
@@ -47,7 +46,7 @@ curl https://api-inference.huggingface.co/models/google/tapas-base-finetuned-wtq
4746
```py
4847
import requests
4948

50-
API_URL = "https://api-inference.huggingface.co/models/google/tapas-base-finetuned-wtq"
49+
API_URL = "https://api-inference.huggingface.co/models/<REPO_ID>"
5150
headers = {"Authorization": "Bearer hf_***"}
5251

5352
def query(payload):
@@ -78,7 +77,7 @@ To use the Python client, see `huggingface_hub`'s [package reference](https://hu
7877
```js
7978
async function query(data) {
8079
const response = await fetch(
81-
"https://api-inference.huggingface.co/models/google/tapas-base-finetuned-wtq",
80+
"https://api-inference.huggingface.co/models/<REPO_ID>",
8281
{
8382
headers: {
8483
Authorization: "Bearer hf_***",

docs/api-inference/tasks/text-generation.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ For more details about the `text-generation` task, check out its [dedicated page
2828

2929
- [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it): A text-generation model trained to follow instructions.
3030
- [meta-llama/Meta-Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct): Very powerful text generation model trained to follow instructions.
31-
- [microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct): Small yet powerful text generation model.
31+
- [microsoft/phi-4](https://huggingface.co/microsoft/phi-4): Powerful text generation model by Microsoft.
32+
- [PowerInfer/SmallThinker-3B-Preview](https://huggingface.co/PowerInfer/SmallThinker-3B-Preview): A very powerful model with reasoning capabilities.
3233
- [Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct): Strong text generation model to follow instructions.
34+
- [Qwen/Qwen2.5-Coder-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-32B-Instruct): Text generation model used to write code.
3335

3436
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=text-generation&sort=trending).
3537

docs/api-inference/tasks/text-to-image.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ To use the JavaScript client, see `huggingface.js`'s [package reference](https:/
115115
| **inputs*** | _string_ | The input text data (sometimes called "prompt") |
116116
| **parameters** | _object_ | |
117117
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;guidance_scale** | _number_ | A higher guidance scale value encourages the model to generate images closely linked to the text prompt, but values too high may cause saturation and other artifacts. |
118-
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;negative_prompt** | _string[]_ | One or several prompt to guide what NOT to include in image generation. |
118+
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;negative_prompt** | _string_ | One prompt to guide what NOT to include in image generation. |
119119
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;num_inference_steps** | _integer_ | The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference. |
120120
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target_size** | _object_ | The size in pixel of the output image |
121121
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width*** | _integer_ | |

docs/api-inference/tasks/zero-shot-classification.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ For more details about the `zero-shot-classification` task, check out its [dedic
2525
### Recommended models
2626

2727
- [facebook/bart-large-mnli](https://huggingface.co/facebook/bart-large-mnli): Powerful zero-shot text classification model.
28-
- [MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7](https://huggingface.co/MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7): Powerful zero-shot multilingual text classification model that can accomplish multiple tasks.
2928

3029
Explore all available models and find the one that suits you best [here](https://huggingface.co/models?inference=warm&pipeline_tag=zero-shot-classification&sort=trending).
3130

scripts/api-inference/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"author": "",
1515
"license": "ISC",
1616
"dependencies": {
17-
"@huggingface/tasks": "^0.13.14",
17+
"@huggingface/tasks": "^0.14.0",
1818
"@types/node": "^22.5.0",
1919
"handlebars": "^4.7.8",
2020
"node": "^20.17.0",

0 commit comments

Comments
 (0)