Huggingface.js documentation

Interface: BaseArgs

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Interface: BaseArgs

Properties

accessToken

Optional accessToken: string

The access token to use. Without it, you’ll get rate-limited quickly.

Can be created for free in hf.co/settings/token

You can also pass an external Inference provider’s key if you intend to call a compatible provider like Sambanova, Together, Replicate…

Defined in

inference/src/types.ts:59


endpointUrl

Optional endpointUrl: string

The URL of the endpoint to use. If not specified, will call huggingface.co/api/tasks to get the default endpoint for the task.

If specified, will use this URL instead of the default one.

Defined in

inference/src/types.ts:76


model

Optional model: string

The HF model to use.

If not specified, will call huggingface.co/api/tasks to get the default model for the task.

/!\ Legacy behavior allows this to be an URL, but this is deprecated and will be removed in the future. Use the endpointUrl parameter instead.

Defined in

inference/src/types.ts:69


provider

Optional provider: "fal-ai" | "replicate" | "sambanova" | "together" | "hf-inference"

Set an Inference provider to run this model on.

Defaults to the first provider in your user settings that is compatible with this model.

Defined in

inference/src/types.ts:83

< > Update on GitHub