Skills Prompts Hues

Popular categories

Agent skill · Hugging Face Skills

/train-sentence-transformers Train embedding and reranker models from tested templates

This skill routes sentence-transformers training to the right model type, references and production template instead of letting the agent improvise a script. It covers bi-encoders, cross-encoder rerankers, SPLADE sparse encoders and ColBERT-style multi-vector models, and requires a baseline score, a smoke test and a single verdict line comparing the result to that baseline.

Works with

  • Claude Code
  • Gemini CLI

Used forMachine learning and evals

When to use it

  • You need a domain-specific embedding model for retrieval or deduplication.
  • You want to train a reranker for two-stage search.
  • You are building learned-sparse or late-interaction retrieval.

How it works

  1. 1
    Identify the model type

    The agent maps the request to bi-encoder, cross-encoder, sparse or multi-vector, using keywords such as rerank or SPLADE, and asks if it is still unclear.

  2. 2
    Read the required references

    It loads the loss, evaluator and cross-cutting guides for that type in full before writing code.

  3. 3
    Start from the template

    It copies the matching production script and swaps in your model, dataset, run name, loss and evaluator.

  4. 4
    Smoke-test, then run

    It runs one step on a tiny slice first, then trains, recording the baseline before training and a WIN, MARGINAL or REGRESSION verdict after.

  5. 5
    Publish and log

    It pushes the model to the Hub inside a try block, appends the run to an experiments log and proposes further runs if the gain is weak.

What it steers the agent away from

  • Training scripts synthesised from memory that miss the template's scaffolding.
  • Reporting a score without a pre-training baseline to compare against.
  • Sparse models that score well while their sparsity has collapsed.

Install this skill

It installs with the Hugging Face Skills pack.

Claude CodeThe plugin marketplace exposes only hf-cli; the rest are added one by one with the hf CLI.
/plugin marketplace add huggingface/skills
/plugin install hf-cli@huggingface/skills
hf skills add <skill-name>
Gemini CLIInstalls the repository as a Gemini CLI extension; you can also run the install from a local checkout.
gemini extensions install https://github.com/huggingface/skills.git --consent

Commands come from the author’s README; check it for changes before you run them.

Questions

Does it need a GPU?

A GPU is strongly recommended; CPU training is only practical for demos and static embedding models.

Where does training run by default?

Locally. It only suggests Hugging Face Jobs when your hardware cannot handle the job.

More guides from Hugging Face Skills

Also in this pack

All 19 skills →

Summary by trendhub. The skill itself lives in huggingface/skills/skills/train-sentence-transformers by Hugging Face (Apache-2.0); read the full, current text there.