train-sentence-transformers
Skill by sickn33
Trains or fine-tunes SentenceTransformer, CrossEncoder and SparseEncoder models for retrieval, similarity, clustering, reranking and related embedding tasks. Aimed at ML engineers who build embedding and search models with sentence-transformers.
Install train-sentence-transformers
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/train-sentence-transformers ~/.claude/skills/train-sentence-transformersRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install train-sentence-transformers in Claude Code
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agentic-awesome-skills/skills/train-sentence-transformers ~/.gemini/antigravity-cli/skills/train-sentence-transformersAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install train-sentence-transformers in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill is a router for training and fine-tuning sentence-transformers models. It covers three model types: SentenceTransformer bi-encoders for retrieval, similarity and clustering, CrossEncoder rerankers that score query and passage pairs, and SparseEncoder models for learned sparse retrieval. The skill tells the assistant which reference files and example scripts to read for the chosen type. It asks the assistant to copy a production template rather than write a training script from scratch.
Execution is tightly scoped. Runs need agreed approval for compute, data, hardware and cost, and the examples require an environment flag, a step limit and pinned revisions for each model and dataset. Training saves results locally, and automatic Hub publication is removed. The skill is aimed at developers and ML engineers who fine-tune embedding models and need documented losses, evaluators and troubleshooting guidance.
Written from the project's SKILL.md and checked against it.
What it can do
- Model type selectionPicks SentenceTransformer, CrossEncoder or SparseEncoder based on the task described.
- Reference routingLists which loss, evaluator, architecture and training-argument references to read for each model type.
- Training templateDirects the assistant to copy a per-type production example script as the starting point.
- Loss and evaluator mappingMatches loss functions and evaluators to dataset shape and task, and explains metric key formats.
- Dataset format guidanceCovers column-matching rules, reshaping recipes and hard-negative mining options.
- Base model selectionExplains discovery commands and per-type model namespaces for choosing a starting model.
- TroubleshootingProvides symptom-indexed failure recipes for training and Hub push problems.
- Variant scriptsPoints to variant examples for Matryoshka, LoRA, distillation, multilingual and static embedding training.
What you need
- Python with sentence-transformers[train] 5.0 or later
- GPU strongly recommended (CPU for demos and StaticEmbedding only)
- Read-scoped token for private or gated downloads, if needed
- Separate approval for compute, uploads and Hub writes
Try asking
- Fine-tune a SentenceTransformer model on my query and passage pairs for retrieval.
- Which loss and evaluator should I use to train a CrossEncoder reranker?
- Set up a SparseEncoder training run using the production template.
Good to know
- The examples are adaptable and are not production certified.
- Dataset rows are capped by default at 200 and at most 20,000 per load.
- Distributed multi-process training needs rank-safe persistence changes.
- NanoBEIR sparse evaluator is English-only, and its evaluators may run substantial computation.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/train-sentence-transformers/SKILL.md, skills/train-sentence-transformers/scripts/mine_hard_negatives.py, skills/train-sentence-transformers/scripts/train_cross_encoder_distillation_example.py, skills/train-sentence-transformers/scripts/train_cross_encoder_example.py, skills/train-sentence-transformers/scripts/train_cross_encoder_listwise_example.py, skills/train-sentence-transformers/scripts/train_sentence_transformer_distillation_example.py, skills/train-sentence-transformers/scripts/train_sentence_transformer_example.py, skills/train-sentence-transformers/scripts/train_sentence_transformer_make_multilingual_example.py, skills/train-sentence-transformers/scripts/train_sentence_transformer_matryoshka_example.py. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
LICENSE11 KB -
SKILL.md10 KB -
UPSTREAM-NOTICE.md650 B -
references/base_model_selection.md8 KB -
references/dataset_formats.md7 KB
Show all 32 files
-
references/evaluators_cross_encoder.md6 KB -
references/evaluators_sentence_transformer.md6 KB -
references/evaluators_sparse_encoder.md5 KB -
references/hardware_guide.md5 KB -
references/hf_jobs_execution.md2 KB -
references/losses_cross_encoder.md10 KB -
references/losses_sentence_transformer.md11 KB -
references/losses_sparse_encoder.md5 KB -
references/model_architectures.md9 KB -
references/prompts_and_instructions.md7 KB -
references/training_args.md15 KB -
references/troubleshooting.md13 KB -
scripts/mine_hard_negatives.py9 KB -
scripts/train_cross_encoder_distillation_example.py9 KB -
scripts/train_cross_encoder_example.py9 KB -
scripts/train_cross_encoder_listwise_example.py10 KB -
scripts/train_sentence_transformer_distillation_example.py12 KB -
scripts/train_sentence_transformer_example.py8 KB -
scripts/train_sentence_transformer_make_multilingual_example.py12 KB -
scripts/train_sentence_transformer_matryoshka_example.py7 KB -
scripts/train_sentence_transformer_multi_dataset_example.py10 KB -
scripts/train_sentence_transformer_static_embedding_example.py11 KB -
scripts/train_sentence_transformer_with_lora_example.py11 KB -
scripts/train_sparse_encoder_distillation_example.py10 KB -
scripts/train_sparse_encoder_example.py8 KB
And 2 more files on GitHub.
Alternatives to train-sentence-transformers
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
train-sentence-transformers: common questions
What types of models can this skill train?
It covers SentenceTransformer bi-encoders, CrossEncoder rerankers and SparseEncoder (SPLADE) models. The skill maps each type to its tasks, such as retrieval, reranking or learned sparse retrieval.
Does the skill publish trained models to the Hugging Face Hub automatically?
No. The source says automatic Hub publication and remote telemetry are removed, and each run saves only locally. Hub writes need a separate destination and visibility approval.
Can the assistant run training without asking me first?
No. The source says a request to prepare training code does not authorize compute, purchases, uploads or remote tracking, and scope must be agreed before running.
How do I install train-sentence-transformers?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is train-sentence-transformers free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is train-sentence-transformers safe to use?
It scores 92 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to train-sentence-transformers?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
