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
+62-8Lines changed: 62 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -154,14 +154,46 @@ 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 this route is a mapping ID that you can later use to update the mapping's status or 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`. Using tag filters, you can automatically map multiple HF models to a single inference endpoint on your side.
162
+
For example, any model tagged with both `lora` and `base_model:adapter:black-forest-labs/FLUX.1-dev` can be mapped to your Flux-dev LoRA inference endpoint.
163
+
164
+
165
+
<Tip>
166
+
167
+
Important: Make sure that the JS client library can handle LoRA weights for your provider. Check out [fal's implementation](https://github.com/huggingface/huggingface.js/blob/904964c9f8cd10ed67114ccb88b9028e89fd6cad/packages/inference/src/providers/fal-ai.ts#L78-L124) for more details.
168
+
169
+
</Tip>
170
+
171
+
The API is as follows:
172
+
173
+
```http
174
+
POST /api/partners/{provider}/models
175
+
```
176
+
Create a new mapping item, with the following body (JSON-encoded):
177
+
158
178
```json
159
179
{
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
180
+
"type": "tag-filter", // required
181
+
"task": "WidgetType", // required
182
+
"tags": ["string"], // required: any HF model with all of those tags will be mapped to providerModel
183
+
"providerModel": "string", // required: the partner's "model id" i.e. id on your side
184
+
"adapterType": "lora", // required: only "lora" is supported at the moment
185
+
"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
186
}
164
187
```
188
+
189
+
-`task`, also known as `pipeline_tag` in the HF ecosystem, is the type of model / type of API
190
+
(examples: "text-to-image", "text-generation", but you should use "conversational" for chat models)
191
+
-`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"]`
192
+
-`providerModel` is the model ID on your side (can be the same or different from the HF model ID).
193
+
-`adapterType` is a literal value that helps client libraries interpret how to call your API. The only supported value at the moment is `"lora"`.
194
+
195
+
The output of this route is a mapping ID that you can later use to update the mapping's status or delete it.
196
+
165
197
#### Authentication
166
198
167
199
You need to be in the _provider_ Hub organization (e.g. https://huggingface.co/togethercomputer
@@ -178,26 +210,31 @@ huggingface.js/inference call of the corresponding task i.e. the API specs are v
0 commit comments