Setu Recipes: reusable digital workers across every app.Browse templates

Integrations / Hugging Face Hub

Hugging Face Hub

Find and inspect models, datasets and Spaces on the Hugging Face Hub: search, repository details, file listings, and the account behind the token. For chat with open models through Inference Providers use the Hugging Face Inference toolkit (a different host).

6 actions API key 6 read0 write Calls huggingface.co

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "huggingface" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

This toolkit uses a single credential and requests no scopes.

Actions

Get repository inforeadhuggingface.get_repoGet details of one model, dataset or Space on the Hub: latest commit, visibility, gating, downloads, likes, task, library, tags and the list of files. Use owner/name ids like openai-community/gpt2 split into namespace and repo.
InputTypeDescription
repo_typestringRequiredKind of repository
namespacestringRequiredOwner (user or organization), the part before the slash in the repo id, e.g. openai-community
repostringRequiredRepository name, the part after the slash in the repo id, e.g. gpt2
TypeScript
await setu.execute({
  userId: "user_1",
  action: "huggingface.get_repo",
  input: {
    "repo_type": "<repo_type>",
    "namespace": "<namespace>",
    "repo": "<repo>"
  },
});
List repository filesreadhuggingface.list_repo_filesList the files and folders at the top of a repository's branch, tag or commit (the tree), with sizes. Set recursive to true to walk every folder. For large repositories pass the cursor from a previous result.
InputTypeDescription
repo_typestringRequiredKind of repository
namespacestringRequiredOwner (user or organization), the part before the slash in the repo id, e.g. openai-community
repostringRequiredRepository name, the part after the slash in the repo id, e.g. gpt2
revisionstringRequiredBranch, tag or commit id; use main for the default branch
recursivebooleanOptionalList every file in all folders
limitintegerOptionalMaximum entries (default 1000)
cursorstringOptionalPagination cursor from a previous call
TypeScript
await setu.execute({
  userId: "user_1",
  action: "huggingface.list_repo_files",
  input: {
    "repo_type": "<repo_type>",
    "namespace": "<namespace>",
    "repo": "<repo>",
    "revision": "<revision>"
  },
});
Search datasetsreadhuggingface.search_datasetsSearch datasets on the Hugging Face Hub by name text, author and tag, sorted by downloads, likes, trending or date. Returns light records (id, tags, downloads, likes); use get_repo for details.
InputTypeDescription
searchstringOptionalText to look for in the repository name
authorstringOptionalOnly repositories of this user or organization
filterstringOptionalA tag to require, e.g. text-classification, transformers, language:en, license:<name>
sortstringOptionalSort order (descending)
limitintegerOptionalMaximum results (default 10)
TypeScript
await setu.execute({
  userId: "user_1",
  action: "huggingface.search_datasets",
  input: {},
});
Search modelsreadhuggingface.search_modelsSearch models on the Hugging Face Hub by name text, author and tag, sorted by downloads, likes, trending or date. Returns light records (id, tags, downloads, likes); use get_repo for details.
InputTypeDescription
searchstringOptionalText to look for in the repository name
authorstringOptionalOnly repositories of this user or organization
filterstringOptionalA tag to require, e.g. text-classification, transformers, language:en, license:<name>
pipeline_tagstringOptionalOnly models for this task, e.g. text-generation, text-classification, automatic-speech-recognition
sortstringOptionalSort order (descending)
limitintegerOptionalMaximum results (default 10)
TypeScript
await setu.execute({
  userId: "user_1",
  action: "huggingface.search_models",
  input: {},
});
Search Spacesreadhuggingface.search_spacesSearch spaces on the Hugging Face Hub by name text, author and tag, sorted by downloads, likes, trending or date. Returns light records (id, tags, downloads, likes); use get_repo for details.
InputTypeDescription
searchstringOptionalText to look for in the repository name
authorstringOptionalOnly repositories of this user or organization
filterstringOptionalA tag to require, e.g. text-classification, transformers, language:en, license:<name>
sortstringOptionalSort order (descending)
limitintegerOptionalMaximum results (default 10)
TypeScript
await setu.execute({
  userId: "user_1",
  action: "huggingface.search_spaces",
  input: {},
});
Who am Ireadhuggingface.whoamiGet the Hugging Face account the token belongs to: username, full name, email, plan and organizations, plus what kind of token it is.

No input.

TypeScript
await setu.execute({
  userId: "user_1",
  action: "huggingface.whoami",
  input: {},
});