Skip to content

Conversation

@hanouticelina
Copy link
Contributor

@hanouticelina hanouticelina commented Apr 1, 2025

Closes #1664.

Copied from this document (internal).

TODO:

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@hanouticelina
Copy link
Contributor Author

hanouticelina commented Apr 1, 2025

I don't understand why the build of the PR doc is failing, I may need some help here cc @mishig25 if you have an idea

EDIT: it seems fixed now 🤷‍♀️


For example, you can find the expected schema for Text to Speech here: [https://github.com/huggingface/huggingface.js/packages/src/tasks/text-to-speech/spec/input.json#L4](https://github.com/huggingface/huggingface.js/blob/0a690a14d52041a872dc103846225603599f4a33/packages/tasks/src/tasks/text-to-speech/spec/input.json#L4), and similarly for other supported tasks. If your API for a given task is different from HF's, it is not an issue: you can tweak the code in `huggingface.js` to be able to call your models, i.e., provide some kind of "translation" of parameter names and output names. However, API specs should not be model-specific, only task-specific. Run the JS code and add some [tests](https://github.com/huggingface/huggingface.js/blob/main/packages/inference/test/HfInference.spec.ts) to make sure it works well. We can help with this step!

## 2. JS Client Integration
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this section is based on the refacto implemented here huggingface/huggingface.js#1315 (not merged yet)

@hanouticelina hanouticelina marked this pull request as ready for review April 1, 2025 15:28
Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a first pass!

hanouticelina and others added 2 commits April 2, 2025 13:02
Co-authored-by: Julien Chaumond <[email protected]>
Co-authored-by: Julien Chaumond <[email protected]>
Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, i'm wondering if we should or not split into one page per section? wdyt

Comment on lines +117 to +119
### Register the provider

Go to [packages/inference/src/lib/getProviderHelper.ts](https://github.com/huggingface/huggingface.js//blob/main/packages/inference/src/lib/getProviderHelper.ts) and add your provider to `PROVIDERS`. Please try to respect alphabetical order.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An additional step here is to get in touch with us to add the provider to moon-landing and map to the organization

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we added a Tip in the Model Mapping API section for that:

To proceed with this step, we have to enable your account server-side. Make sure you have an organization on the Hub for your enterprise.

but I'm okay to add a specific section for that, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added in the introduction a "Reach out to us to add your provider server-side and provide your SVG icon" step just after the JS integration a179888

@Wauplin
Copy link
Contributor

Wauplin commented Apr 2, 2025

Copy link
Contributor

@gary149 gary149 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!


<Tip>

Note that `chatCompletion` is an exception as it is not a pipeline_tag, per se. Instead, it
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍

@hanouticelina
Copy link
Contributor Author

merging!

@hanouticelina hanouticelina merged commit beb4d0f into main Apr 3, 2025
2 checks passed
@hanouticelina hanouticelina deleted the how-to-register-as-a-provider branch April 3, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Page: "how to be registered as a provider"?

7 participants