Commit fd90183
[Inference] [3rd party] Support versioned and unversioned Replicate models (huggingface#1106)
This PR updates the Replicate integration to support running both
versioned and unversioned models via API.
### Versioned models
The vast majority of models on Replicate are
[versioned](https://replicate.com/docs/topics/models/versions). Each
time a model author publishes changes to the model, a new version is
created with a new 64-character SHA identifier. You have to specify a
model's version by ID when running them with the API.
Versioned models use the following HTTP API endpoint:
```
POST /v1/predictions
```
☝🏼 This endpoint expects a `version` in the body of the request.
See https://replicate.com/docs/reference/http#predictions.create
### Unversioned models
Some models on Replicate like
[black-forest-labs/flux-schnell](https://replicate.com/black-forest-labs/flux-schnell)
are _unversioned_. Replicate staff maintains these as evergreen models,
improving their performance and fixing bugs while maintaining API
compatibility, so users know they're always running the latest and
greatest.
Unversioned models have their own HTTP API endpoint:
```
POST /v1/models/{owner}/{model}/predictions
```
See https://replicate.com/docs/reference/http#models.predictions.create
---------
Co-authored-by: SBrandeis <[email protected]>1 parent 5d92ceb commit fd90183
File tree
5 files changed
+81
-4
lines changed- packages
- inference
- src
- lib
- providers
- test
- tasks/src
5 files changed
+81
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
138 | 144 | | |
139 | 145 | | |
140 | 146 | | |
| |||
168 | 174 | | |
169 | 175 | | |
170 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
171 | 185 | | |
172 | 186 | | |
173 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
799 | 799 | | |
800 | 800 | | |
801 | 801 | | |
802 | | - | |
| 802 | + | |
803 | 803 | | |
804 | 804 | | |
805 | 805 | | |
806 | 806 | | |
807 | 807 | | |
808 | 808 | | |
809 | 809 | | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
810 | 819 | | |
811 | 820 | | |
812 | 821 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2525 | 2525 | | |
2526 | 2526 | | |
2527 | 2527 | | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
2528 | 2581 | | |
2529 | 2582 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
772 | 772 | | |
773 | 773 | | |
774 | 774 | | |
775 | | - | |
| 775 | + | |
776 | 776 | | |
777 | 777 | | |
778 | 778 | | |
| |||
0 commit comments