Setup
On first use, read setup.md for integration guidelines and local memory initialization.
When to Use
User needs to find the right Hugging Face model, dataset, or Space for a concrete task and move from browsing to reliable execution.
Agent handles discovery, filtering, license checks, quick benchmarking, and integration-ready inference plans.
Architecture
Memory and reusable artifacts live in ~/hugging-face/. See memory-template.md for structure and status fields.
CODEBLOCK0
Quick Reference
Load only one focused file at a time to keep context small and decisions explicit.
| Topic | File |
|---|
| Setup process | INLINECODE3 |
| Memory template |
memory-template.md |
| Model and dataset discovery |
discovery.md |
| Inference execution patterns |
inference.md |
| Evaluation rubric and scoring |
evaluation.md |
| Common failures and recovery |
troubleshooting.md |
Core Rules
1. Lock Objective and Constraints First
Before selecting any artifact, confirm task type, latency budget, cost boundary, and deployment target.
Use this minimum scope packet:
- - Task type: chat, generation, embedding, classification, vision, or speech
- Quality priority: best quality, best speed, or balanced
- Runtime constraints: CPU only, specific GPU class, or hosted endpoint
- Compliance constraints: license, region, or private data limits
2. Separate Discovery from Execution
Do not run inference on the first candidate found.
First create a shortlist of at least three candidates, then execute only on finalists that pass compatibility and license checks.
3. Validate License and Access Before Recommendation
For every candidate, verify license, gated access status, model size, and framework compatibility.
If any of these are unknown, mark the candidate as provisional and avoid production recommendation.
4. Benchmark with a Deterministic Mini Suite
Use the same prompt set and output checks across candidates so results are comparable.
Minimum benchmark set:
- - One typical request
- One edge-case request
- One failure-prone request
5. Minimize External Data
Send only what is required for the selected endpoint.
Never send credentials, local paths, or unrelated private context in request payloads.
6. Use a Fallback Ladder
If the preferred model fails, apply ordered fallback:
- 1. Retry same endpoint with smaller payload
- Switch to a compatible backup model
- Switch to local-only workflow if available
7. Keep Runs Reproducible
Log selected model id, endpoint, key parameters, and evaluation result in local memory so future runs are consistent and auditable.
Common Traps
- - Picking the highest download count as the only criterion -> often misses license, latency, or domain fit.
- Ignoring gated model requirements -> integration fails at runtime due to access restrictions.
- Comparing models with different prompts -> quality conclusions become unreliable.
- Sending full user context to inference endpoints -> unnecessary privacy exposure.
- Skipping fallback design -> workflows fail hard on transient endpoint errors.
External Endpoints
Use discovery endpoints before inference so candidate selection remains explainable and reproducible.
| Endpoint | Data Sent | Purpose |
|---|
| INLINECODE9 | Search terms, filter parameters | Discover model candidates |
| INLINECODE10 |
Search terms, filter parameters | Discover dataset candidates |
|
https://huggingface.co/api/spaces | Search terms, filter parameters | Discover runnable Spaces |
|
https://api-inference.huggingface.co/models/{model_id} | Prompt or task input payload, selected model id, auth token | Run hosted inference |
No other data is sent externally.
Security & Privacy
Data that leaves your machine:
- - Search terms and filter inputs sent to Hugging Face discovery APIs.
- Inference payloads sent to Hugging Face Inference API when execution is requested.
Data that stays local:
- - Preferences, shortlists, evaluation notes, and endpoint decisions in
~/hugging-face/.
This skill does NOT:
- - Exfiltrate local files by default.
- Send undeclared network requests.
- Store raw secrets in local notes.
- Modify its own skill definition file.
Trust
By using this skill, selected request data is sent to Hugging Face services.
Only install if you trust Hugging Face with the inputs you choose to process.
Related Skills
Install with
clawhub install <slug> if user confirms:
- -
ai - general AI strategy and model-selection framing - INLINECODE16 - API-first integration patterns and HTTP debugging
- INLINECODE17 - dataset inspection and quality interpretation
- INLINECODE18 - structured data workflows and extraction patterns
- INLINECODE19 - implementation support for scripts and adapters
Feedback
- - If useful: INLINECODE20
- Stay updated: INLINECODE21
设置
首次使用时,请阅读 setup.md 了解集成指南和本地内存初始化。
使用时机
用户需要为具体任务找到合适的 Hugging Face 模型、数据集或 Space,并从浏览过渡到可靠执行。
智能体负责发现、筛选、许可证检查、快速基准测试以及集成就绪的推理方案。
架构
内存和可复用工件位于 ~/hugging-face/ 目录下。结构和状态字段请参见 memory-template.md。
text
~/hugging-face/
|- memory.md # 稳定上下文、优先级和默认值
|- shortlists.md # 按用例划分的候选模型和数据集
|- evaluations.md # 基准测试运行、优胜者及注意事项
|- endpoints.md # 已批准的端点和认证说明
快速参考
每次仅加载一个聚焦文件,以保持上下文精简,决策明确。
memory-template.md |
| 模型和数据集发现 | discovery.md |
| 推理执行模式 | inference.md |
| 评估标准和评分 | evaluation.md |
| 常见故障与恢复 | troubleshooting.md |
核心规则
1. 首先锁定目标和约束
在选择任何工件之前,确认任务类型、延迟预算、成本边界和部署目标。
使用此最小范围信息包:
- - 任务类型:聊天、生成、嵌入、分类、视觉或语音
- 质量优先级:最佳质量、最快速度或均衡
- 运行时约束:仅 CPU、特定 GPU 类别或托管端点
- 合规约束:许可证、区域或私有数据限制
2. 将发现与执行分离
不要对找到的第一个候选模型运行推理。
首先创建至少三个候选模型的短名单,然后仅对通过兼容性和许可证检查的最终候选模型执行推理。
3. 在推荐前验证许可证和访问权限
对于每个候选模型,验证许可证、门控访问状态、模型大小和框架兼容性。
如果其中任何一项未知,将该候选模型标记为临时性,并避免生产环境推荐。
4. 使用确定性迷你套件进行基准测试
在候选模型之间使用相同的提示集和输出检查,以确保结果具有可比性。
最小基准测试集:
5. 最小化外部数据
仅发送所选端点所需的数据。
切勿在请求负载中发送凭据、本地路径或不相关的私有上下文。
6. 使用降级阶梯
如果首选模型失败,按顺序降级:
- 1. 使用更小的负载重试同一端点
- 切换到兼容的备用模型
- 如果可用,切换到仅本地工作流
7. 保持运行可复现
在本地内存中记录所选模型 ID、端点、关键参数和评估结果,以便未来运行保持一致且可审计。
常见陷阱
- - 仅以最高下载量为唯一标准 -> 常忽略许可证、延迟或领域适配性。
- 忽略门控模型要求 -> 因访问限制导致集成在运行时失败。
- 使用不同提示比较模型 -> 质量结论变得不可靠。
- 将完整用户上下文发送到推理端点 -> 不必要的隐私暴露。
- 跳过降级设计 -> 工作流在临时端点错误时严重失败。
外部端点
在推理之前使用发现端点,以便候选选择保持可解释和可复现。
| 端点 | 发送的数据 | 目的 |
|---|
| https://huggingface.co/api/models | 搜索词、过滤参数 | 发现模型候选 |
| https://huggingface.co/api/datasets |
搜索词、过滤参数 | 发现数据集候选 |
| https://huggingface.co/api/spaces | 搜索词、过滤参数 | 发现可运行的 Space |
| https://api-inference.huggingface.co/models/{model_id} | 提示或任务输入负载、所选模型 ID、认证令牌 | 运行托管推理 |
不会向外部发送其他数据。
安全与隐私
离开您机器的数据:
- - 发送到 Hugging Face 发现 API 的搜索词和过滤输入。
- 请求执行时发送到 Hugging Face 推理 API 的推理负载。
保留在本地数据:
- - ~/hugging-face/ 中的偏好、短名单、评估笔记和端点决策。
此技能不会:
- - 默认泄露本地文件。
- 发送未声明的网络请求。
- 在本地笔记中存储原始密钥。
- 修改自身的技能定义文件。
信任
使用此技能,选定的请求数据将被发送到 Hugging Face 服务。
仅当您信任 Hugging Face 处理您选择输入的请求数据时才安装。
相关技能
如果用户确认,使用 clawhub install 安装:
- - ai - 通用 AI 策略和模型选择框架
- api - API 优先的集成模式和 HTTP 调试
- data-analysis - 数据集检查和质量解释
- data - 结构化数据工作流和提取模式
- code - 脚本和适配器的实现支持
反馈
- - 如果觉得有用:clawhub star hugging-face
- 保持更新:clawhub sync