跳到正文
Skillpedia
通用编程48k · #4842

hugging-face-tool-builder

它能做什么

这个智能体可以编写用于调用 Hugging Face API 的命令行脚本,帮助你自动化重复性任务,并把不同的工具组合起来使用。

适用场景

  • ✓需要编写脚本来获取 Hugging Face 上的模型信息时。
  • ✓想自动下载 Hugging Face 仓库中的文件时。
  • ✓想把多个 Hugging Face API 调用合并成一个完整流程时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hugging-face-tool-builder/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hugging-face-tool-builder/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“创建一个脚本,列出 Hugging Face 上下载量最高的 10 个模型,并把它们的名称保存到一个文件中。”

每周 5 个新技能,1 分钟读完。

工作原理

它会使用 `hf` 命令行工具,或直接调用 Hugging Face API。生成的脚本可以串联起来,分步骤处理数据。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Supporting material availability

This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:

  • <support-root>/references/hf_model_papers_auth.sh
  • <support-root>/references/find_models_by_paper.sh
  • <support-root>/references/hf_model_card_frontmatter.sh
  • <support-root>/references/baseline_hf_api.sh
  • <support-root>/references/baseline_hf_api.py
  • <support-root>/references/baseline_hf_api.tsx
  • <support-root>/references/hf_enrich_models.sh

Ask for the original supporting material or an existing installation before using a step that depends on these paths; this catalog does not identify a verified download source for them. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.

Hugging Face API Tool Builder

Your purpose is now is to create reusable command line scripts and utilities for using the Hugging Face API, allowing chaining, piping and intermediate processing where helpful. You can access the API directly, as well as use the hf command line tool. Model and Dataset cards can be accessed from repositories directly.

When to Use

  • You need reusable CLI scripts around the Hugging Face API or hf command line tool.
  • You want shell-friendly utilities that support chaining, piping, and intermediate processing.
  • You are automating repeated Hub tasks and need a composable interface instead of ad hoc API calls.

Script Rules

Make sure to follow these rules:

  • Scripts must take a --help command line argument to describe their inputs and outputs
  • Non-destructive scripts should be tested before handing over to the User
  • Shell scripts are preferred, but use Python or TSX if complexity or user need requires it.
  • IMPORTANT: Use the HF_TOKEN environment variable as an Authorization header. For example: curl -H "Authorization: Bearer ${HF_TOKEN}" https://huggingface.co/api/. This provides higher rate limits and appropriate authorization for data access.
  • Investigate the shape of the API results before commiting to a final design; make use of piping and chaining where composability would be an advantage - prefer simple solutions where possible.
  • Share usage examples once complete.

Be sure to confirm User preferences where there are questions or clarifications needed.

Sample Scripts

Paths below are relative to this skill directory.

Reference examples:

  • references/hf_model_papers_auth.sh — uses HF_TOKEN automatically and chains trending → model metadata → model card parsing with fallbacks; it demonstrates multi-step API usage plus auth hygiene for gated/private content.
  • references/find_models_by_paper.sh — optional HF_TOKEN usage via --token, consistent authenticated search, and a retry path when arXiv-prefixed searches are too narrow; it shows resilient query strategy and clear user-facing help.
  • references/hf_model_card_frontmatter.sh — uses the hf CLI to download model cards, extracts YAML frontmatter, and emits NDJSON summaries (license, pipeline tag, tags, gated prompt flag) for easy filtering.

Baseline examples (ultra-simple, minimal logic, raw JSON output with HF_TOKEN header):

  • references/baseline_hf_api.sh — bash
  • references/baseline_hf_api.py — python
  • references/baseline_hf_api.tsx — typescript executable

Composable utility (stdin → NDJSON):

  • references/hf_enrich_models.sh — reads model IDs from stdin, fetches metadata per ID, emits one JSON object per line for streaming pipelines.

Composability through piping (shell-friendly JSON output):

  • <support-root>/references/baseline_hf_api.sh 25 | jq -r '.[].id' | references/hf_enrich_models.sh | jq -s 'sort_by(.downloads) | reverse | .[:10]'
  • <support-root>/references/baseline_hf_api.sh 50 | jq '[.[] | {id, downloads}] | sort_by(.downloads) | reverse | .[:10]'
  • printf '%s\n' openai/gpt-oss-120b meta-llama/Meta-Llama-3.1-8B | references/hf_model_card_frontmatter.sh | jq -s 'map({id, license, has_extra_gated_prompt})'

High Level Endpoints

…

常见问题

什么是 Hugging Face API?

它是一组命令,可以让计算机程序与 Hugging Face 上的资源(例如模型和数据集)进行交互。

“命令行”是什么意思?

就是在终端或命令提示符等程序中输入命令来操作电脑的方式,而不是用鼠标点击图标。

`jq` 是什么?

`jq` 是一个用来读取和整理 JSON 格式数据的工具,而 Hugging Face API 返回的大量信息正是 JSON 格式。

详情

作者的原始描述

Your purpose is now is to create reusable command line scripts and utilities for using the Hugging Face API, allowing chaining, piping and intermediate processing where helpful. You can access the API directly, as well as use the hf command line tool.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4842
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能