train-sentence-transformers agent skill by huggingface
Trains and fine-tunes sentence-transformers models, including bi-encoders, cross-encoders, sparse encoders, and multi-vector encoders, with guidance on loss selection, hard-negative mining, evaluators, and Hub publishing.
At a glance
| Publisher | Hugging Face Official |
|---|---|
| Repository | huggingface/skills (24 listed skills) |
| Category | AI Agents and LLM Engineering |
| License | Apache-2.0 |
| Last commit | October 8, 2026 (repository) |
| SKILL.md | 104 lines, 1,101 words |
| Bundled files | 31 files, including references, scripts |
| Quality score | 83/100 · B Passes all seven graded checks |
| Security scan | Not scanned |
| README badge | Get the badges for this listing |
Before you install
Read from the skill's files at the directory's October 19, 2026 snapshot: what ships with it, what its code reads, and the terms it is published under.
- Bundled scripts: 14 script files (14 Python). Your agent may run them, so read them first.
- Commands in SKILL.md: its code blocks run
pip install, which fetches or runs software from outside the skill folder. - Environment variables its scripts read:
HF_TOKEN. Check SKILL.md for which ones it needs. - License: Apache-2.0, an open-source or open-content license.
Install train-sentence-transformers
The skills CLI works with Claude Code, Codex, Cursor and other agents; the other routes copy the folder by hand.
npx skills add https://github.com/huggingface/skills/tree/main/skills/train-sentence-transformers
tmp="$(mktemp -d)"
git clone --depth 1 https://github.com/huggingface/skills.git "$tmp/repo"
mkdir -p .claude/skills
cp -R "$tmp/repo/"skills/train-sentence-transformers .claude/skills/
rm -rf "$tmp"
python3 ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-github.py \
--repo huggingface/skills \
--path skills/train-sentence-transformers
huggingface/skills is third-party code. Read SKILL.md and any bundled scripts before you install it.
How the author describes it
Train or fine-tune sentence-transformers models across `SentenceTransformer` (bi-encoder, dense or static embedding model for retrieval, similarity, clustering, classification, paraphrase mining, dedup, multimodal), `CrossEncoder` (reranker, pair scoring for two-stage retrieval / pair classification), `SparseEncoder` (SPLADE, sparse embedding model for learned-sparse retrieval), and `MultiVectorEncoder` (ColBERT / late-interaction, per-token embeddings scored with MaxSim). Covers loss selection, hard-negative mining, evaluators, distillation, LoRA, Matryoshka, and Hugging Face Hub publishing. Use for any sentence-transformers training task.
From the description field of SKILL.md. Agents read this line to decide when to load the skill.
Sections in SKILL.md
- 1. Identify the model type
- 2. Required reading
- Per-type: always required
- Cross-cutting: always required (regardless of task)
- Cross-cutting: load when applicable
- Variant scripts (open when the task matches)
- 3. Defaults
- 4. Constraints the produced script must satisfy
- 5. Workflow
- Prerequisites
Files in the skill folder
SKILL.mdreferences/base_model_selection.mdreferences/dataset_formats.mdreferences/evaluators_cross_encoder.mdreferences/evaluators_multi_vector_encoder.mdreferences/evaluators_sentence_transformer.mdreferences/evaluators_sparse_encoder.mdreferences/hardware_guide.mdreferences/hf_jobs_execution.mdreferences/losses_cross_encoder.mdreferences/losses_multi_vector_encoder.mdreferences/losses_sentence_transformer.mdreferences/losses_sparse_encoder.mdreferences/model_architectures.mdreferences/prompts_and_instructions.mdreferences/training_args.mdreferences/troubleshooting.mdscripts/mine_hard_negatives.pyscripts/train_cross_encoder_distillation_example.pyscripts/train_cross_encoder_example.pyscripts/train_cross_encoder_listwise_example.pyscripts/train_multi_vector_encoder_example.pyscripts/train_sentence_transformer_distillation_example.pyscripts/train_sentence_transformer_example.py
Showing 24 of 31 files. Browse the folder on GitHub.
Suede Skill Check: 83/100 · B
Report snapshot · · graded-v2
The rubric totals 100 points; published scores are capped at 99. Security scan: not scanned.
Source revision: c3ff942be3e0. Report version 3762f4badf58. Badge URLs follow the latest listing; save the report to keep this version.
Download report · Request a fresh review
What to review next
- Boundary clause: 0 of 4 points. 4 when the description says when not to use the skill (“Not for …”, “Do not use …”, “Use … instead”).
- Example request: 0 of 3 points. 3 when the description quotes an example request (3–60 characters in quotation marks).
- Description length: 3 of 5 points. 5 for 150–600 characters; 3 for 100–900; 1 for 50–1,024.
Add declarations and bundled files when they describe the skill’s actual needs. Update the source, then request a fresh review with the changed commit or PR.
train-sentence-transformers passes the required frontmatter check and all seven graded checks, which cover the SKILL.md format, a declared license and a commit in the last year. Those checks earn 56 of the score’s points; the rest come from description quality, instruction depth, bundled files, maintenance and curated-list citations. How the score works.
See the checks and points
| Check | Result |
|---|---|
| Frontmatter parses and declares a name and a description | Pass |
| Name uses lowercase letters, digits and hyphens, 64 characters or fewer | Pass |
| Name matches the skill's folder name | Pass |
| Description is between 50 and 1,024 characters | Pass |
| Description says when an agent should use the skill | Pass |
| SKILL.md body is 500 lines or fewer | Pass |
| A license is declared in the frontmatter or the repository | Pass |
| Repository has a commit in the last 12 months | Pass |
| Score component | Points |
|---|---|
| Structural checks | 56 of 56 |
| Description length | 3 of 5 |
| Boundary clause | 0 of 4 |
| Example request | 0 of 3 |
| Instruction depth | 7 of 7 |
| Reference files | 3 of 3 |
| Bundled scripts | 2 of 2 |
| Recent maintenance | 9 of 9 |
| Curated-list citations | 3 of 7 |
| Tool permissions declared | 0 of 2 |
| Compatibility declared | 0 of 2 |
Two badges for train-sentence-transformers
Choose the numeric badge, the letter badge, or both. Each links to this skill’s Suede listing; either valid linked badge can qualify for the feature offer.
[](https://skills.suedeai.ai/directory/huggingface/skills/train-sentence-transformers/)
[](https://skills.suedeai.ai/directory/huggingface/skills/train-sentence-transformers/)<a href="https://skills.suedeai.ai/directory/huggingface/skills/train-sentence-transformers/"><img src="https://skills.suedeai.ai/directory/huggingface/skills/train-sentence-transformers/score.svg" alt="Suede Skill Check: 83/100" width="160" height="175"></a>
<a href="https://skills.suedeai.ai/directory/huggingface/skills/train-sentence-transformers/"><img src="https://skills.suedeai.ai/directory/huggingface/skills/train-sentence-transformers/badge.svg" alt="Suede Skill Check: Grade B" width="160" height="175"></a>Suede Certified on the shield refers to this published structural quality check. Security scan: not scanned. Read the methodology.
Limited-time feature offer: display either the numeric or letter badge in your repository or skill README (both also qualify), then request badge verification. Eligible skills scoring 80–99 can receive a featured placement after Suede verifies at least one valid badge linked to the skill’s listing. Suede has not announced an end date.
Where this skill is cited
huggingface/skills appears in 2 curated lists: heilcheng/awesome-agent-skills, skillmatic-ai/awesome-agent-skills.