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 プロバイダーのキーを渡すこともできます。

定義場所

inference/src/types.ts:125


endpointUrl

• Optional endpointUrl: string

使用するエンドポイントのURL。

指定しない場合、デフォルトのrouter.huggingface.co Inference Providers エンドポイントが呼び出されます。

定義場所

inference/src/types.ts:142


model

• Optional model: string

使用するHFモデル。

指定されていない場合、huggingface.co/api/tasksを呼び出して、タスクのデフォルトモデルを取得します。

/!\ レガシーな動作では、この値を URL に設定できますが、これは非推奨であり、将来的に削除されます。 代わりにendpointUrlパラメータを使用してください。

定義場所

inference/src/types.ts:135


プロバイダー

• 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