Skip to content

Commit 80f8bcf

Browse files
committed
Add a section on how to request models.
1 parent a47c8cd commit 80f8bcf

2 files changed

Lines changed: 66 additions & 1 deletion

File tree

docs/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@
132132
"/model-api/docs/task/visual-question-answering"
133133
]
134134
},
135-
"model-api/docs/containers"
135+
"model-api/docs/containers",
136+
"model-api/docs/requestAModel"
136137
]
137138
}
138139
]
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: 'Request a model'
3+
description: 'How to request a model'
4+
icon: 'send'
5+
mode: 'wide'
6+
---
7+
8+
Bytez is able to automatically process any model on Huggingface. To request a model, you must hit our endpoint at:
9+
10+
`https://api.bytez.com/models/v2/request/{modelId}`
11+
12+
## Request a model
13+
14+
Example model ID:
15+
16+
`Finisha-F-scratch/Lamina-basic`
17+
18+
Endpoint used in the examples below:
19+
20+
`https://api.bytez.com/models/v2/request/Finisha-F-scratch/Lamina-basic`
21+
22+
<CodeGroup>
23+
24+
```javascript title="JavaScript"
25+
const url = 'https://api.bytez.com/models/v2/request/Finisha-F-scratch/Lamina-basic';
26+
27+
fetch(url, {
28+
method: 'POST',
29+
})
30+
.then((response) => response.json())
31+
.then((data) => {
32+
console.log('Response:', data);
33+
})
34+
.catch((error) => {
35+
console.error('Error:', error);
36+
});
37+
```
38+
39+
```python title="Python"
40+
import requests
41+
42+
url = "https://api.bytez.com/models/v2/request/Finisha-F-scratch/Lamina-basic"
43+
44+
response = requests.post(url)
45+
46+
print("Status Code:", response.status_code)
47+
print("Response JSON:", response.json())
48+
```
49+
50+
```bash title="curl"
51+
curl -X POST \
52+
https://api.bytez.com/models/v2/request/Finisha-F-scratch/Lamina-basic
53+
```
54+
55+
</CodeGroup>
56+
57+
### Expected Response
58+
59+
```json
60+
{
61+
"error": null,
62+
"output": "Job queued"
63+
}
64+
```

0 commit comments

Comments
 (0)