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
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.
| Input | Type | Description | |
|---|---|---|---|
repo_type | string | Required | Kind of repository |
namespace | string | Required | Owner (user or organization), the part before the slash in the repo id, e.g. openai-community |
repo | string | Required | Repository name, the part after the slash in the repo id, e.g. gpt2 |
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.
| Input | Type | Description | |
|---|---|---|---|
repo_type | string | Required | Kind of repository |
namespace | string | Required | Owner (user or organization), the part before the slash in the repo id, e.g. openai-community |
repo | string | Required | Repository name, the part after the slash in the repo id, e.g. gpt2 |
revision | string | Required | Branch, tag or commit id; use main for the default branch |
recursive | boolean | Optional | List every file in all folders |
limit | integer | Optional | Maximum entries (default 1000) |
cursor | string | Optional | Pagination cursor from a previous call |
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.
| Input | Type | Description | |
|---|---|---|---|
search | string | Optional | Text to look for in the repository name |
author | string | Optional | Only repositories of this user or organization |
filter | string | Optional | A tag to require, e.g. text-classification, transformers, language:en, license:<name> |
sort | string | Optional | Sort order (descending) |
limit | integer | Optional | Maximum results (default 10) |
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.
| Input | Type | Description | |
|---|---|---|---|
search | string | Optional | Text to look for in the repository name |
author | string | Optional | Only repositories of this user or organization |
filter | string | Optional | A tag to require, e.g. text-classification, transformers, language:en, license:<name> |
pipeline_tag | string | Optional | Only models for this task, e.g. text-generation, text-classification, automatic-speech-recognition |
sort | string | Optional | Sort order (descending) |
limit | integer | Optional | Maximum results (default 10) |
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.
| Input | Type | Description | |
|---|---|---|---|
search | string | Optional | Text to look for in the repository name |
author | string | Optional | Only repositories of this user or organization |
filter | string | Optional | A tag to require, e.g. text-classification, transformers, language:en, license:<name> |
sort | string | Optional | Sort order (descending) |
limit | integer | Optional | Maximum results (default 10) |
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.
await setu.execute({
userId: "user_1",
action: "huggingface.whoami",
input: {},
});