Skip to content

Conversation

tomsun28
Copy link
Contributor

Hi 🤗 team,
We’d like to apply to register ZAI as inference provider. Thanks

One more question: when we tried to register the model mapping with the endpoint POST api/partners/zai/models, we received a 404 response. https://huggingface.co/docs/inference-providers/register-as-a-provider#3-model-mapping-api Does this action only work after the PR has been merged?

@julien-c
Copy link
Member

Does this action only work after the PR has been merged?

we need to allowlist your org on the Hub side. (we can add a note about this to the doc maybe @SBrandeis @Wauplin)

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.

Haven't tested yet but implementation looks good. Left a comment regarding text-generation vs chat-completion.

Comment on lines 22 to 36
export class ZaiTextGenerationTask extends BaseTextGenerationTask {
constructor() {
super("zai", ZAI_API_BASE_URL);
}

override prepareHeaders(params: HeaderParams, binary: boolean): Record<string, string> {
const headers = super.prepareHeaders(params, binary);
headers["x-source-channel"] = "hugging_face";
return headers;
}

override makeRoute(): string {
return "/chat/completions";
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The text-generation task is meant for non-conversational LLMs. Do you plan to serve any? Usually Inference Providers are starting with conversational ones only i.e. "chat completion".

Note that a model cannot be served through Inference Providers both with the Chat Completion and the Text Generation APIs. If a model is tagged as "conversational" on the Hub (https://huggingface.co/models?other=conversational&sort=trending&search=zai-org), then it must be served as Chat Completion.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you do want to serve some non-conversational text-generation models, then I suppose the API route must be updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hi @Wauplin Thanks for the reminder. We’re providing conversational models, I’ll update the pr.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hi, i have removed the text-generation. PTAL, thanks

@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.

@tomsun28
Copy link
Contributor Author

Does this action only work after the PR has been merged?

we need to allowlist your org on the Hub side. (we can add a note about this to the doc maybe @SBrandeis @Wauplin)

hi @julien-c , could you help add our team zai-org to the allowlist? we would like to register the provider as zai.

@julien-c
Copy link
Member

we try to have provider id === organization namespace on the Hub

Would you rather have zai-org as the provider id? Or we can look into moving your org to hf.co/zai

Let me and @SBrandeis know

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

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

thanks @tomsun28! this looks good

SBrandeis
SBrandeis previously approved these changes Sep 25, 2025
@tomsun28
Copy link
Contributor Author

we try to have provider id === organization namespace on the Hub

Would you rather have zai-org as the provider id? Or we can look into moving your org to hf.co/zai

Let me and @SBrandeis know

hi @julien-c @SBrandeis , got it, Is this mandatory? If zai cannot be used without changing the organization, we can use zai-org as the provider. Thanks.

Copy link
Contributor

@SBrandeis SBrandeis left a comment

Choose a reason for hiding this comment

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

@tomsun28
Copy link
Contributor Author

Sorry, overseen this Took https://github.com/tomsun28/huggingface.js/blob/3a4b909e563ef7e86ffc600045e22be25f0579b9/packages/inference/src/providers/novita.ts for reference

hi @SBrandeis Thanks, the base_url has been updated.
One more check, should we need change the provider id form zai to zai-org ? or keep the zai. If it’s zai-org as the provider id, I’ll go update the code.

@tomsun28
Copy link
Contributor Author

@SBrandeis Hi and could you help add us to the allowlist? so we can proceed with the model mapping registration process.

@SBrandeis
Copy link
Contributor

Hey @tomsun28

@SBrandeis Hi and could you help add us to the allowlist? so we can proceed with the model mapping registration process.

Merging this PR is a pre-requisite before we can enable the model mapping API

One more check, should we need change the provider id form zai to zai-org ? or keep the zai. If it’s zai-org as the provider id, I’ll go update the code.

It would be nice if we could match the provider name with the name of the org yes!

@tomsun28
Copy link
Contributor Author

Hey @tomsun28

@SBrandeis Hi and could you help add us to the allowlist? so we can proceed with the model mapping registration process.

Merging this PR is a pre-requisite before we can enable the model mapping API

One more check, should we need change the provider id form zai to zai-org ? or keep the zai. If it’s zai-org as the provider id, I’ll go update the code.

It would be nice if we could match the provider name with the name of the org yes!

Got it thanks, i will update the provider id.

@julien-c
Copy link
Member

julien-c commented Sep 26, 2025

@tomsun28 you sure you don't want us to rename your org to hf.co/zai instead (all links will be redirected)?

@tomsun28
Copy link
Contributor Author

@tomsun28 you sure you don't want us to rename your org to hf.co/zai instead (all links will be redirected)?

Hey @julien-c thanks for the reminder, we don’t want to rename.

@tomsun28
Copy link
Contributor Author

Hi @julien-c @SBrandeis the provider id has updated to zai-org, PTAL thanks

@SBrandeis SBrandeis merged commit 9b8cd3a into huggingface:main Sep 26, 2025
5 checks passed
@tomsun28 tomsun28 deleted the support-zai branch September 26, 2025 13:45
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.

6 participants