Skip to content

ericrisco/rsc-harness / skills/huggingface

huggingface

Verified

Use when running open models or working on the Hugging Face platform — the Inference Providers router or InferenceClient, Hub repos via the hf CLI, a dedicated Inference Endpoint with scale-to-zero, a Gradio Space with ZeroGPU, picking an open model by task/license/size, or loading one locally with transformers. NOT serving locally on your own machine (that is `ollama`), NOT renting your own GPU box (that is `runpod`), NOT hosted creative image APIs (that is `replicate-images`), NOT fine-tuning with trl/peft (that is `finetuning`).

FileKindSize
SKILL.mdskill md10.0 KB
evals/README.mdmarkdown862 B
evals/cases.yamlconfig2.9 KB
references/endpoints-and-spaces.mdmarkdown3.0 KB
references/hub-and-cli.mdmarkdown2.6 KB
references/inference-providers.mdmarkdown3.8 KB
scripts/verify.shexecutablescript4.2 KB

references/hub-and-cli.md

View on GitHub
# Hub & the `hf` CLI

The CLI was renamed `huggingface-cli` → **`hf`**, shaped `hf <resource> <action>`. The legacy
name still works but prints a deprecation warning — use `hf` in all new scripts.

## Command map

```bash
hf auth login                 # interactive token store; or export HF_TOKEN=...
hf auth whoami                # confirm identity + token scope
hf download <repo>            # pull a repo (model/dataset/space) to the local cache
hf upload <repo> <path>       # push files to a repo
hf repo create <repo>         # create a new repo (--repo-type model|dataset|space)
hf jobs run <image> -- <cmd>  # run a containerized/uv job on HF infra (PRO)
```

## Download patterns

```bash
# Only the weights you need, not the whole repo:
hf download meta-llama/Llama-3.1-8B-Instruct --include "*.safetensors" "config.json"

# A dataset:
hf download HuggingFaceH4/ultrachat_200k --repo-type dataset
```

```python
from huggingface_hub import snapshot_download, hf_hub_download

# Whole repo (resumable, cached):
local = snapshot_download("BAAI/bge-small-en-v1.5")

# A single file:
cfg = hf_hub_download("BAAI/bge-small-en-v1.5", filename="config.json")
```

## Upload patterns

```bash
hf repo create my-org/my-model --repo-type model
hf upload my-org/my-model ./checkpoints --commit-message "v1 weights"
```

```python
from huggingface_hub import HfApi
api = HfApi()
api.create_repo("my-org/my-model", repo_type="model", private=True)
api.upload_folder(repo_id="my-org/my-model", folder_path="./checkpoints",
                  commit_message="v1 weights")
```

## Model cards

A model card is the repo's `README.md` with YAML front-matter. Ship one on every upload — an
uncarded repo is unsearchable and unusable by others.

```markdown
---
license: apache-2.0
pipeline_tag: text-generation
base_model: meta-llama/Llama-3.1-8B
tags: [llama, fine-tune, instruct]
language: [en]
---

# my-model

What it is, what it was trained on, intended use, limitations, and how to load it.
```

## Gated & licensed models

- **Gated** repos (Llama, Gemma, many others): accept the terms on the model page first, then use
  a token with **read** scope. Without acceptance the download/inference returns `403`.
- Read the `license` field before shipping: Apache-2.0/MIT are permissive; Llama/Gemma carry
  commercial conditions; `cc-by-nc`/"research-only" means you cannot ship it commercially.

## `hf jobs run`

Run a one-off containerized or `uv`-script job on HF infra (a PRO feature) — the path for an
eval, a batch convert, or a fine-tune without standing up an Endpoint or a Space.

```bash
hf jobs run python:3.12 -- python -c "print('runs on HF infra')"
```
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall