You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/inference-providers/register-as-a-provider.md
+56-8Lines changed: 56 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,14 +154,40 @@ Create a new mapping item, with the following body (JSON-encoded):
154
154
-`hfModel` is the model id on the Hub's side.
155
155
-`providerModel` is the model id on your side (can be the same or different).
156
156
157
-
In the future, we will add support for a new parameter (ping us if it's important to you now):
157
+
The output of such route is a mapping ID that you can use later to update the mapping's status; or to delete it.
158
+
159
+
### Using a tag-filter to map several HF models to a single inference endpoint
160
+
161
+
We also support mapping HF models based on their `tags`.
162
+
163
+
This is useful to, for example, automatically map LoRA adapters to a single Inference Endpoint on your side.
164
+
165
+
The API is as follows:
166
+
167
+
```http
168
+
POST /api/partners/{provider}/models
169
+
```
170
+
Create a new mapping item, with the following body (JSON-encoded):
171
+
158
172
```json
159
173
{
160
-
"hfFilter": ["string"]
161
-
// ^Power user move: register a "tag" slice of HF in one go.
162
-
// Example: tag == "base_model:adapter:black-forest-labs/FLUX.1-dev" for all Flux-dev LoRAs
174
+
"type": "tag-filter", // required
175
+
"task": "WidgetType", // required
176
+
"tags": ["string"], // required: any HF model with all of those tags will be mapped to providerModel
177
+
"providerModel": "string", // required: the partner's "model id" i.e. id on your side
178
+
"adapterType": "lora", // required: only "lora" is supported at the moment
179
+
"status": "live"| "staging" // Optional: defaults to "staging". "staging" models are only available to members of the partner's org, then you switch them to "live" when they're ready to go live
163
180
}
164
181
```
182
+
183
+
-`task`, also known as `pipeline_tag` in the HF ecosystem, is the type of model / type of API
184
+
(examples: "text-to-image", "text-generation", but you should use "conversational" for chat models)
185
+
-`tags` is the set of model tags to match. For example, to match all LoRAs of Flux, you can use: `["lora", "base_model:adapter:black-forest-labs/FLUX.1-dev"]`
186
+
-`providerModel` is the model id on your side (can be the same or different).
187
+
-`adapterType` is a literal value designed to help client libraries interpret how to request your API. The only supported value at the moment is `"lora"`.
188
+
189
+
The output of such route is a mapping ID that you can use later to update the mapping's status; or to delete it.
190
+
165
191
#### Authentication
166
192
167
193
You need to be in the _provider_ Hub organization (e.g. https://huggingface.co/togethercomputer
@@ -178,26 +204,31 @@ huggingface.js/inference call of the corresponding task i.e. the API specs are v
0 commit comments