Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

Use Hugging Face Models

Use models hosted on Hugging Face in your pipelines.


About This Task

You can use any model from Hugging Face in your pipelines. There are a couple of ways to do it:

Prerequisites

You need a Hugging Face token for the API you want to use.

Use Models from Hugging Face

Connect Haystack Enterprise Platform to Hugging Face through the Integrations page. You can set up the connection for a single workspace or for the whole organization:

Add Workspace-Level Integration

  1. Click your profile icon and choose Settings.
  2. Go to Workspace>Integrations.
  3. Find the provider you want to connect and click Connect next to them.
  4. Enter the API key and any other required details.
  5. Click Connect. You can use this integration in pipelines and indexes in the current workspace.

Add Organization-Level Integration

  1. Click your profile icon and choose Settings.
  2. Go to Organization>Integrations.
  3. Find the provider you want to connect and click Connect next to them.
  4. Enter the API key and any other required details.
  5. Click Connect. You can use this integration in pipelines and indexes in all workspaces in the current organization.

Then, add a component that uses the model you have in mind. Here are the available components by the model type:

Usage Examples

Check the documentation of the component you want to use for usage examples.