Huggingface Api logo

Huggingface Api

Community
wentorai
huggingface-api

Search and discover ML models, datasets, and Spaces on Hugging Face

Overview

Publisherwentorai
Repositoryresearch-plugins
Skill namehuggingface-api
Stars
294
Forks
42
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by wentorai on GitHub. Read the source before you install it.

Installation

Install the Huggingface Api AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wentorai/research-plugins.git /tmp/research-plugins
mkdir -p .claude/skills
cp -r /tmp/research-plugins/skills/domains/ai-ml/huggingface-api .claude/skills/huggingface-api
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Huggingface Api in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Huggingface Api on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Huggingface Api is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Hugging Face Hub API

Overview

The Hugging Face Hub is the largest open-source ML ecosystem, hosting over 1 million models, 200,000+ datasets, and 400,000+ Spaces (demo apps). The Hub API at https://huggingface.co/api provides programmatic access to search, discover, and retrieve metadata for all public resources without authentication.

For academic researchers, the Hub API enables systematic model selection for benchmarking, dataset discovery for experiments, tracking community adoption metrics (downloads, likes), and building reproducible ML pipelines that reference specific model revisions by SHA.

Authentication

Read endpoints require no authentication. All search and metadata queries work without a token.

For write operations (uploading models, creating repos), set a User Access Token:

bash
export HF_TOKEN="hf_..."
# Pass via header:
curl -H "Authorization: Bearer $HF_TOKEN" https://huggingface.co/api/...

Generate tokens at: https://huggingface.co/settings/tokens

Core Endpoints

Search Models

GET https://huggingface.co/api/models?search={query}&limit={n}&sort={field}&direction={-1|1}

Parameters: search (query string), limit (max results), sort (field: downloads, likes, lastModified, trending), direction (-1 descending, 1 ascending), filter (pipeline tag like text-classification), author (org/user filter), library (e.g. transformers, pytorch)

Example -- top 2 models for "bert" by downloads:

bash
curl -s "https://huggingface.co/api/models?search=bert&limit=2&sort=downloads&direction=-1"
json
[
  {
    "id": "google-bert/bert-base-uncased",
    "likes": 2587,
    "downloads": 71053483,
    "pipeline_tag": "fill-mask",
    "library_name": "transformers",
    "tags": ["transformers","pytorch","tf","jax","bert","fill-mask","en",
             "dataset:bookcorpus","dataset:wikipedia","arxiv:1810.04805",
             "license:apache-2.0"]
  },
  {
    "id": "google-bert/bert-base-multilingual-uncased",
    "likes": 153,
    "downloads": 5017183,
    "pipeline_tag": "fill-mask",
    "library_name": "transformers"
  }
]

Get Model Details

GET https://huggingface.co/api/models/{owner}/{model_name}

Returns full metadata including config.architectures, cardData (license, datasets, language), siblings (file listing), sha (exact revision), and lastModified.

bash
curl -s "https://huggingface.co/api/models/google-bert/bert-base-uncased"

Key fields in response:

json
{
  "id": "google-bert/bert-base-uncased",
  "sha": "86b5e0934494bd15c9632b12f734a8a67f723594",
  "lastModified": "2024-02-19T11:06:12.000Z",
  "downloads": 71053483,
  "config": { "architectures": ["BertForMaskedLM"], "model_type": "bert" },
  "cardData": { "language": "en", "license": "apache-2.0",
                "datasets": ["bookcorpus","wikipedia"] }
}

Search Datasets

GET https://huggingface.co/api/datasets?search={query}&limit={n}

Parameters: search, limit, sort, direction, author, filter (task tag like question-answering)

bash
curl -s "https://huggingface.co/api/datasets?search=squad&limit=2"
json
[
  {
    "id": "rajpurkar/squad_v2",
    "likes": 242,
    "downloads": 36017,
    "description": "Stanford Question Answering Dataset (SQuAD)...",
    "tags": ["task_categories:question-answering","language:en",
             "license:cc-by-sa-4.0","size_categories:100K<n<1M",
             "arxiv:1806.03822"]
  }
]

Get Dataset Details

GET https://huggingface.co/api/datasets/{owner}/{dataset_name}
bash
curl -s "https://huggingface.co/api/datasets/rajpurkar/squad_v2"

Returns cardData with structured metadata (task categories, languages, license, size), description, paperswithcode_id for cross-referencing, and tags with arXiv paper IDs.

Search Spaces

GET https://huggingface.co/api/spaces?search={query}&limit={n}
bash
curl -s "https://huggingface.co/api/spaces?search=chatbot&limit=2"
json
[
  {
    "id": "21Hg/chatbot",
    "likes": 5,
    "sdk": "docker",
    "tags": ["docker","streamlit","region:us"]
  },
  {
    "id": "lmarena-ai/chatbot-arena",
    "likes": 234,
    "sdk": "static"
  }
]

Advanced Filters

Combine filters via query params to narrow results:

bash
# PyTorch text-generation models with 1000+ likes
curl -s "https://huggingface.co/api/models?filter=text-generation&library=pytorch&sort=likes&direction=-1&limit=5"

# Datasets for NER tasks in Chinese
curl -s "https://huggingface.co/api/datasets?filter=token-classification&language=zh&limit=10"

# Gradio Spaces sorted by trending
curl -s "https://huggingface.co/api/spaces?filter=gradio&sort=trending&direction=-1&limit=5"

Rate Limits

  • Unauthenticated: generous but undocumented; suitable for interactive use and small scripts
  • Authenticated: higher limits with Bearer token
  • Best practice: add limit parameter to avoid fetching thousands of results; cache responses locally for batch analysis
  • No strict per-minute quota is published; if you receive HTTP 429, back off exponentially

Academic Use Cases

  1. Model selection for benchmarks: Search by pipeline tag (text-classification, token-classification, summarization) and sort by downloads to find community-validated baselines
  2. Dataset discovery: Filter by task_categories, language, and size_categories tags to find training data matching your experimental requirements
  3. Reproducibility: Pin model versions using the sha field from model details -- load exact revisions with revision="86b5e093..." in transformers
  4. Citation tracking: Extract arxiv: tags from model/dataset metadata to trace foundational papers
  5. Ecosystem analysis: Aggregate download/like counts across model families to study adoption trends in ML research

Code Examples

Python with requests

python
import requests

# Search for top text-classification models
resp = requests.get("https://huggingface.co/api/models", params={
    "filter": "text-classification",
    "sort": "downloads",
    "direction": -1,
    "limit": 10
})
models = resp.json()
for m in models:
    print(f"{m['id']:50s}  downloads={m.get('downloads',0):>12,}")

# Get specific model metadata
detail = requests.get("https://huggingface.co/api/models/google-bert/bert-base-uncased").json()
print(f"SHA: {detail['sha']}")
print(f"License: {detail['cardData'].get('license')}")

Python with huggingface_hub library

python
from huggingface_hub import HfApi

api = HfApi()

# Search models (returns ModelInfo objects)
models = api.list_models(search="bert", sort="downloads", direction=-1, limit=5)
for m in models:
    print(f"{m.id}  downloads={m.downloads}")

# Get full model info
info = api.model_info("google-bert/bert-base-uncased")
print(f"Pipeline: {info.pipeline_tag}, SHA: {info.sha}")

# Search datasets
datasets = api.list_datasets(search="squad", sort="downloads", direction=-1, limit=5)
for d in datasets:
    print(f"{d.id}  downloads={d.downloads}")

# List Spaces
spaces = api.list_spaces(search="chatbot", limit=5)
for s in spaces:
    print(f"{s.id}  sdk={s.sdk}")

References

Frequently asked questions

What does the Huggingface Api AI skill do?

Search and discover ML models, datasets, and Spaces on Hugging Face

Why use Huggingface Api on TypingMind?

Because you install it once and use it with any model. Huggingface Api is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Huggingface Api in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wentorai/research-plugins/tree/main/skills/domains/ai-ml/huggingface-api. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Huggingface Api?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Huggingface Api?

As many as you like. As long as a model supports skills, you can use Huggingface Api with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Huggingface Api AI skill free?

Yes. It is published on GitHub by wentorai under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇