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
- 1Identify 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.
- 2Read the required references
It loads the loss, evaluator and cross-cutting guides for that type in full before writing code.
- 3Start from the template
It copies the matching production script and swaps in your model, dataset, run name, loss and evaluator.
- 4Smoke-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.
- 5Publish 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 --consentCommands 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
/hf-cliGive your agent the complete Hugging Face Hub command lineGives the agent the full hf command reference for downloads, uploads, repos, buckets, Jobs, Spaces, endpoints and webhooks.Read the guide →/hf-cloud-sagemaker-deployment-plannerPlan a SageMaker model deployment with few questionsPlans a SageMaker deployment by asking few questions, picking real-time, scale-to-zero or async, and checking instance quotas.Read the guide →/huggingface-spacesBuild and debug Hugging Face Spaces the agent can verifyCreates, pushes, debugs and verifies Hugging Face Spaces, choosing SDK and hardware such as ZeroGPU from your account's limits.Read the guide →/transformers-jsRun Hugging Face models in JavaScript with Transformers.jsRuns Hub models in JavaScript with Transformers.js pipelines in the browser, Node, Bun or Deno over WebGPU or WASM.Read the guide →
Also in this pack
/hf-cloud-aws-context-discoveryReads your active AWS profile, region and caller identity before any AWS work instead of assuming a default region.↗/hf-cloud-python-env-setupCreates an isolated Python 3.10 to 3.12 environment with current boto3 for SageMaker scripts, never the system Python.↗/hf-cloud-sagemaker-iam-preflightValidates or discovers a usable SageMaker execution role before deploying, creating a new one only when none fits.↗/hf-cloud-sagemaker-production-defaultsDeploys a SageMaker endpoint with autoscaling, CloudWatch alarms and cleanup tags switched on from the start.↗/hf-cloud-serving-image-selectionChooses the serving container for a SageMaker model, preferring Hugging Face vLLM or TEI images, and finds its current URI.↗/hf-memEstimates the memory needed to run a Safetensors or GGUF model, optionally with KV cache, without downloading its weights.↗/huggingface-gradioBuilds Gradio apps with Interface or Blocks, wires event listeners and custom HTML components, and calls them from the CLI.↗/huggingface-lora-space-builderDesigns and publishes a private Gradio Space tailored to one LoRA, following the trigger words and settings on its model card.↗/huggingface-papersFetches Hugging Face paper pages as markdown and pulls metadata such as authors, linked models, datasets and GitHub repo.↗/huggingface-vision-trainerFine-tunes object detection, image classification and SAM or SAM2 segmentation models on Hugging Face Jobs GPUs or locally.↗/huggingface-zerogpuApplies ZeroGPU rules for @spaces.GPU code: duration and quota tuning, process isolation, concurrency and CUDA wheel limits.↗/trl-trainingWrites and debugs TRL post-training code, matching each trainer to its dataset format and the config fields that matter.↗
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.