Huggingface.js documentation

接口:BaseArgs

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

接口:BaseArgs

属性

accessToken

• Optional accessToken:string

要使用的访问令牌。如果没有它,您很快就会受到速率限制。

可以在 hf.co/settings/token 免费创建

您也可以传入外部推理提供商的密钥,以便调用诸如 Together、Replicate、Cohere 等兼容的提供商。

定义于

inference/src/types.ts:125


endpointUrl

• Optional endpointUrl:string

要使用的端点的 URL。

如果未指定,将调用默认的 router.huggingface.co Inference Providers 端点。

定义于

inference/src/types.ts:142


model

• Optional 模型:string

要使用的 HF 模型。

如果未指定,将调用 huggingface.co/api/tasks 以获取该任务的默认模型。

/!\ 旧版行为允许此参数为 URL,但此用法已弃用,并将在未来版本中移除。 请改用 endpointUrl 参数。

定义于

inference/src/types.ts:135


provider

• Optional provider: "baseten" | "cerebras" | "cohere" | "deepinfra" | "fal-ai" | "featherless-ai" | "fireworks-ai" | "groq" | "hf-inference" | "humain-ai" | "novita" | "nscale" | "openai" | "openrouter" | "ovhcloud" | "publicai" | "replicate" | "scaleway" | "together" | "wavespeed" | "zai-org" | "auto"

设置一个推理提供商来运行此模型。

默认值为“auto”,即按用户在https://hf.co/settings/inference-providers中设置的顺序,选择该模型可用的第一个提供商。

定义于

inference/src/types.ts:149

Update on GitHub