[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-huggingface-train-sentence-transformers":3,"mdc--x4mirc-key":38,"related-repo-huggingface-train-sentence-transformers":1348,"related-org-huggingface-train-sentence-transformers":1358},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":27,"repoUrl":28,"updatedAt":29,"license":30,"forks":31,"topics":32,"repo":33,"sourceUrl":36,"mdContent":37},"train-sentence-transformers","train sentence-transformers models","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 \u002F pair classification), and `SparseEncoder` (SPLADE, sparse embedding model; for learned-sparse retrieval). Covers loss selection, hard-negative mining, evaluators, distillation, LoRA, Matryoshka, and Hugging Face Hub publishing. Use for any sentence-transformers training task.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"huggingface","Hugging Face","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fhuggingface.png",[12,15,18,21,24],{"name":9,"slug":13,"type":14},"hugging-face","tag",{"name":16,"slug":17,"type":14},"LLM","llm",{"name":19,"slug":20,"type":14},"Deep Learning","deep-learning",{"name":22,"slug":23,"type":14},"Python","python",{"name":25,"slug":26,"type":14},"Search","search",18914,"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fsentence-transformers","2026-05-08T05:09:16.820066",null,2829,[],{"repoUrl":28,"stars":27,"forks":31,"topics":34,"description":35},[],"State-of-the-Art Embeddings, Retrieval, and Reranking","https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fsentence-transformers\u002Ftree\u002FHEAD\u002Fskills\u002Ftrain-sentence-transformers","---\nname: train-sentence-transformers\ndescription: 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 \u002F pair classification), and `SparseEncoder` (SPLADE, sparse embedding model; for learned-sparse retrieval). Covers loss selection, hard-negative mining, evaluators, distillation, LoRA, Matryoshka, and Hugging Face Hub publishing. Use for any sentence-transformers training task.\n---\n\n# Train a sentence-transformers Model\n\n**This SKILL.md is a router, not a manual.** It tells you which references and example scripts to load for your task. The actual content — recommended losses, evaluators, training-script structure, model selection, training-arg knobs, troubleshooting — lives in `references\u002F` and `scripts\u002F`.\n\n**Do not synthesize a training script from this file alone.** Open the per-type production template (`scripts\u002Ftrain_\u003Ctype>_example.py`) and copy it as your starting point. The templates contain load-bearing scaffolding (autocast helper, model-card class, logger silencing list, `force=True`, `seed`, TF32, version-compatible imports, named-evaluator metric handling) that prior agent runs have repeatedly missed when rolling their own from a synthesized snippet.\n\n## 1. Identify the model type\n\n| Tag | Class | What it does | When to pick |\n|---|---|---|---|\n| **[SentenceTransformer]** | `SentenceTransformer` (bi-encoder) | Maps each input to a fixed-dim dense vector | Retrieval, similarity, clustering, classification, paraphrase mining, dedup |\n| **[CrossEncoder]** | `CrossEncoder` (reranker) | Scores `(query, passage)` pairs jointly | Two-stage retrieval (rerank top-100 from bi-encoder), pair classification |\n| **[SparseEncoder]** | `SparseEncoder` (SPLADE) | Sparse vectors over the vocabulary | Learned-sparse retrieval, inverted-index backends (Elasticsearch \u002F OpenSearch \u002F Lucene) |\n\nTiebreakers when the request is ambiguous: \"embedding model\" \u002F \"vector search\" \u002F \"similarity\" → **[SentenceTransformer]**. \"rerank\" \u002F \"ranker\" \u002F \"two-stage\" → **[CrossEncoder]**. \"SPLADE\" \u002F \"sparse\" \u002F \"inverted index\" → **[SparseEncoder]**. If still unclear, ask.\n\n## 2. Required reading\n\n**Read these in full before writing any code. Do not triage by perceived relevance.**\n\n### Per-type — always required\n\n**[SentenceTransformer]**\n- `references\u002Flosses_sentence_transformer.md` — loss-to-data-shape mapping; `BatchSamplers.NO_DUPLICATES` requirement for MNRL-family; `Cached*` ↔ `gradient_checkpointing` incompatibility.\n- `references\u002Fevaluators_sentence_transformer.md` — evaluator-to-task mapping; `metric_for_best_model` key construction (named vs unnamed); per-evaluator `primary_metric` values.\n- `references\u002Fmodel_architectures.md` — encoder vs decoder vs static vs Router pipelines; pooling rules (mean \u002F cls \u002F lasttoken); auto-mean-pooling behavior for fresh-start MLM bases.\n- `scripts\u002Ftrain_sentence_transformer_example.py` — production template; copy this as your starting point.\n\n**[CrossEncoder]**\n- `references\u002Flosses_cross_encoder.md` — pointwise \u002F pairwise \u002F listwise \u002F distillation; `pos_weight` derivation; `activation_fn=Identity()` mandatory for non-BCE losses (silent eval-rank collapse otherwise).\n- `references\u002Fevaluators_cross_encoder.md` — `CrossEncoderRerankingEvaluator` recipe; named-evaluator key format `eval_{name}_{primary_metric}`.\n- `scripts\u002Ftrain_cross_encoder_example.py` — production template; copy this as your starting point.\n\n**[SparseEncoder]**\n- `references\u002Flosses_sparse_encoder.md` — `SpladeLoss` wrapper requirement; FLOPS regularizer weights; smoke-test active-dim ramp behavior.\n- `references\u002Fevaluators_sparse_encoder.md` — `SparseNanoBEIREvaluator` (English-only) and the in-domain alternative; `eval_{name}_{primary_metric}` key format.\n- `scripts\u002Ftrain_sparse_encoder_example.py` — production template; copy this as your starting point.\n\n### Cross-cutting — always required (regardless of task)\n\n- `references\u002Ftraining_args.md` — `TrainingArguments` knobs, precision rules (load fp32 + autocast bf16\u002Ffp16; never `torch_dtype=bfloat16`), `warmup_steps` (float) vs deprecated `warmup_ratio`, `save_steps` must be a multiple of `eval_steps` for `load_best_model_at_end`, schedulers, HPO, tracker, resume, hub-push variants.\n- `references\u002Fdataset_formats.md` — column-matching rules (label name auto-detection; column-order-not-name); reshaping recipes; hard-negative mining options.\n- `references\u002Fbase_model_selection.md` — discovery commands; per-type model namespaces; ModernBERT-family `max_seq_length=8192` trap; `datasets >= 4` script-loader rejection; non-English starting-point shortcuts.\n- `references\u002Ftroubleshooting.md` — symptom-indexed failure recipes. Skim the section headings on every run, even a healthy one; the \"Metrics don't improve\" and \"Hub push fails\" entries cover bugs that bite frequently and are cheaper to recognize before they fire than to debug after.\n\n### Cross-cutting — load when applicable\n\n- `references\u002Fhardware_guide.md` — VRAM sizing, multi-GPU, FSDP \u002F DeepSpeed, HF Jobs flavors. Required for >24GB models, multi-GPU, or HF Jobs runs.\n- `references\u002Fhf_jobs_execution.md` — required when running on HF Jobs.\n- `references\u002Fprompts_and_instructions.md` — required when using prompt-tuned bases (E5, BGE, GTE, Qwen3-Embedding, Instructor, Nomic, etc.) or adding `query: ` \u002F `passage: ` style prefixes.\n\n### Variant scripts (open when the task matches)\n- **[SentenceTransformer]** `scripts\u002Ftrain_sentence_transformer_\u003Cmatryoshka|multi_dataset|with_lora|distillation|make_multilingual|static_embedding>_example.py`.\n- **[CrossEncoder]** `scripts\u002Ftrain_cross_encoder_\u003Cdistillation|listwise>_example.py`.\n- **[SparseEncoder]** `scripts\u002Ftrain_sparse_encoder_distillation_example.py`.\n- Hard-negative mining CLI — `scripts\u002Fmine_hard_negatives.py`.\n\n## 3. Defaults\n\nOverride only if the user specifies otherwise:\n- **Local execution.** Pitch HF Jobs only if local hardware can't fit the job.\n- **Single run.** After it completes, propose experimentation if the user would benefit (weak\u002Fmarginal verdict, \"see how high you can push it\" framing, etc.). Iteration rules in `references\u002Ftraining_args.md` (Experimentation section).\n- **Public Hub push at end-of-run, wrapped in try-except.** On HF Jobs (ephemeral env) ALSO enable in-trainer push (`push_to_hub=True` + `hub_strategy=\"every_save\"`); details in `references\u002Fhf_jobs_execution.md`.\n\n## 4. Constraints the produced script must satisfy\n\nThese are non-negotiable contracts. Implementation lives in the production templates and references — do not reinvent.\n\n- Capture the pre-training evaluator score as `baseline_eval` **before** `trainer.train()`.\n- Emit a single end-of-run line: `VERDICT: WIN|MARGINAL|REGRESSION | score=... | baseline=... | delta=...`. A monitor scrapes for this.\n- Silence `httpx`, `httpcore`, `huggingface_hub`, `urllib3`, `filelock`, `fsspec` to WARNING (otherwise HF download URLs flood the agent's context).\n- Tee logs to `logs\u002F{RUN_NAME}.log`.\n- End with `model.push_to_hub(...)` wrapped in `try\u002Fexcept`.\n- Smoke-test before any long run (`max_steps=1` + tiny dataset slice). The production templates show one common pattern (`SMOKE_TEST` env var).\n- **[CrossEncoder]** Include `EarlyStoppingCallback(patience>=3)` — CE rerankers often peak mid-training and regress.\n- **[SparseEncoder]** Log `query_active_dims` \u002F `corpus_active_dims` on the verdict line; high nDCG with collapsed sparsity is not a win. The keys come back name-prefixed (e.g. `..._query_active_dims`); use suffix matching to pluck them — see the SPARSE production template for the exact pattern.\n\n## 5. Workflow\n\n1. Identify the model type (§1). Ask if ambiguous.\n2. Load the §2 required-reading files for that type.\n3. Open `scripts\u002Ftrain_\u003Ctype>_example.py` and copy it as your starting point.\n4. Replace `MODEL_NAME`, `DATASET_NAME`, `RUN_NAME`, the loss, and the evaluator with the user's task. Cross-check loss\u002Fdata-shape match against `references\u002Flosses_\u003Ctype>.md`; cross-check the `metric_for_best_model` key against `references\u002Fevaluators_\u003Ctype>.md` (named evaluators format the key as `eval_{name}_{primary_metric}`).\n5. Smoke-test (`max_steps=1`).\n6. Run.\n7. After the run, append to `logs\u002Fexperiments.md` and propose iteration if the verdict is weak\u002Fmarginal.\n\n## Prerequisites\n\n```bash\npip install \"sentence-transformers[train]>=5.0\"        # add [train,image] \u002F [audio] \u002F [video] for [SentenceTransformer] multimodal\npip install trackio                                    # optional tracker; or wandb \u002F tensorboard \u002F mlflow\nhf auth login                                          # or set HF_TOKEN with write scope (for Hub push)\n```\n\nGPU strongly recommended. CPU works only for demos and `[SentenceTransformer]` `StaticEmbedding`.\n",{"data":39,"body":40},{"name":4,"description":6},{"type":41,"children":42},"root",[43,52,81,115,122,271,303,309,317,324,334,423,433,499,509,565,571,688,694,746,752,822,828,833,895,901,906,1103,1109,1221,1227,1323,1342],{"type":44,"tag":45,"props":46,"children":48},"element","h1",{"id":47},"train-a-sentence-transformers-model",[49],{"type":50,"value":51},"text","Train a sentence-transformers Model",{"type":44,"tag":53,"props":54,"children":55},"p",{},[56,62,64,71,73,79],{"type":44,"tag":57,"props":58,"children":59},"strong",{},[60],{"type":50,"value":61},"This SKILL.md is a router, not a manual.",{"type":50,"value":63}," It tells you which references and example scripts to load for your task. The actual content — recommended losses, evaluators, training-script structure, model selection, training-arg knobs, troubleshooting — lives in ",{"type":44,"tag":65,"props":66,"children":68},"code",{"className":67},[],[69],{"type":50,"value":70},"references\u002F",{"type":50,"value":72}," and ",{"type":44,"tag":65,"props":74,"children":76},{"className":75},[],[77],{"type":50,"value":78},"scripts\u002F",{"type":50,"value":80},".",{"type":44,"tag":53,"props":82,"children":83},{},[84,89,91,97,99,105,107,113],{"type":44,"tag":57,"props":85,"children":86},{},[87],{"type":50,"value":88},"Do not synthesize a training script from this file alone.",{"type":50,"value":90}," Open the per-type production template (",{"type":44,"tag":65,"props":92,"children":94},{"className":93},[],[95],{"type":50,"value":96},"scripts\u002Ftrain_\u003Ctype>_example.py",{"type":50,"value":98},") and copy it as your starting point. The templates contain load-bearing scaffolding (autocast helper, model-card class, logger silencing list, ",{"type":44,"tag":65,"props":100,"children":102},{"className":101},[],[103],{"type":50,"value":104},"force=True",{"type":50,"value":106},", ",{"type":44,"tag":65,"props":108,"children":110},{"className":109},[],[111],{"type":50,"value":112},"seed",{"type":50,"value":114},", TF32, version-compatible imports, named-evaluator metric handling) that prior agent runs have repeatedly missed when rolling their own from a synthesized snippet.",{"type":44,"tag":116,"props":117,"children":119},"h2",{"id":118},"_1-identify-the-model-type",[120],{"type":50,"value":121},"1. Identify the model type",{"type":44,"tag":123,"props":124,"children":125},"table",{},[126,155],{"type":44,"tag":127,"props":128,"children":129},"thead",{},[130],{"type":44,"tag":131,"props":132,"children":133},"tr",{},[134,140,145,150],{"type":44,"tag":135,"props":136,"children":137},"th",{},[138],{"type":50,"value":139},"Tag",{"type":44,"tag":135,"props":141,"children":142},{},[143],{"type":50,"value":144},"Class",{"type":44,"tag":135,"props":146,"children":147},{},[148],{"type":50,"value":149},"What it does",{"type":44,"tag":135,"props":151,"children":152},{},[153],{"type":50,"value":154},"When to pick",{"type":44,"tag":156,"props":157,"children":158},"tbody",{},[159,195,237],{"type":44,"tag":131,"props":160,"children":161},{},[162,175,185,190],{"type":44,"tag":163,"props":164,"children":165},"td",{},[166],{"type":44,"tag":57,"props":167,"children":168},{},[169],{"type":44,"tag":170,"props":171,"children":172},"span",{},[173],{"type":50,"value":174},"SentenceTransformer",{"type":44,"tag":163,"props":176,"children":177},{},[178,183],{"type":44,"tag":65,"props":179,"children":181},{"className":180},[],[182],{"type":50,"value":174},{"type":50,"value":184}," (bi-encoder)",{"type":44,"tag":163,"props":186,"children":187},{},[188],{"type":50,"value":189},"Maps each input to a fixed-dim dense vector",{"type":44,"tag":163,"props":191,"children":192},{},[193],{"type":50,"value":194},"Retrieval, similarity, clustering, classification, paraphrase mining, dedup",{"type":44,"tag":131,"props":196,"children":197},{},[198,209,219,232],{"type":44,"tag":163,"props":199,"children":200},{},[201],{"type":44,"tag":57,"props":202,"children":203},{},[204],{"type":44,"tag":170,"props":205,"children":206},{},[207],{"type":50,"value":208},"CrossEncoder",{"type":44,"tag":163,"props":210,"children":211},{},[212,217],{"type":44,"tag":65,"props":213,"children":215},{"className":214},[],[216],{"type":50,"value":208},{"type":50,"value":218}," (reranker)",{"type":44,"tag":163,"props":220,"children":221},{},[222,224,230],{"type":50,"value":223},"Scores ",{"type":44,"tag":65,"props":225,"children":227},{"className":226},[],[228],{"type":50,"value":229},"(query, passage)",{"type":50,"value":231}," pairs jointly",{"type":44,"tag":163,"props":233,"children":234},{},[235],{"type":50,"value":236},"Two-stage retrieval (rerank top-100 from bi-encoder), pair classification",{"type":44,"tag":131,"props":238,"children":239},{},[240,251,261,266],{"type":44,"tag":163,"props":241,"children":242},{},[243],{"type":44,"tag":57,"props":244,"children":245},{},[246],{"type":44,"tag":170,"props":247,"children":248},{},[249],{"type":50,"value":250},"SparseEncoder",{"type":44,"tag":163,"props":252,"children":253},{},[254,259],{"type":44,"tag":65,"props":255,"children":257},{"className":256},[],[258],{"type":50,"value":250},{"type":50,"value":260}," (SPLADE)",{"type":44,"tag":163,"props":262,"children":263},{},[264],{"type":50,"value":265},"Sparse vectors over the vocabulary",{"type":44,"tag":163,"props":267,"children":268},{},[269],{"type":50,"value":270},"Learned-sparse retrieval, inverted-index backends (Elasticsearch \u002F OpenSearch \u002F Lucene)",{"type":44,"tag":53,"props":272,"children":273},{},[274,276,283,285,292,294,301],{"type":50,"value":275},"Tiebreakers when the request is ambiguous: \"embedding model\" \u002F \"vector search\" \u002F \"similarity\" → ",{"type":44,"tag":57,"props":277,"children":278},{},[279],{"type":44,"tag":170,"props":280,"children":281},{},[282],{"type":50,"value":174},{"type":50,"value":284},". \"rerank\" \u002F \"ranker\" \u002F \"two-stage\" → ",{"type":44,"tag":57,"props":286,"children":287},{},[288],{"type":44,"tag":170,"props":289,"children":290},{},[291],{"type":50,"value":208},{"type":50,"value":293},". \"SPLADE\" \u002F \"sparse\" \u002F \"inverted index\" → ",{"type":44,"tag":57,"props":295,"children":296},{},[297],{"type":44,"tag":170,"props":298,"children":299},{},[300],{"type":50,"value":250},{"type":50,"value":302},". If still unclear, ask.",{"type":44,"tag":116,"props":304,"children":306},{"id":305},"_2-required-reading",[307],{"type":50,"value":308},"2. Required reading",{"type":44,"tag":53,"props":310,"children":311},{},[312],{"type":44,"tag":57,"props":313,"children":314},{},[315],{"type":50,"value":316},"Read these in full before writing any code. Do not triage by perceived relevance.",{"type":44,"tag":318,"props":319,"children":321},"h3",{"id":320},"per-type-always-required",[322],{"type":50,"value":323},"Per-type — always required",{"type":44,"tag":53,"props":325,"children":326},{},[327],{"type":44,"tag":57,"props":328,"children":329},{},[330],{"type":44,"tag":170,"props":331,"children":332},{},[333],{"type":50,"value":174},{"type":44,"tag":335,"props":336,"children":337},"ul",{},[338,374,401,412],{"type":44,"tag":339,"props":340,"children":341},"li",{},[342,348,350,356,358,364,366,372],{"type":44,"tag":65,"props":343,"children":345},{"className":344},[],[346],{"type":50,"value":347},"references\u002Flosses_sentence_transformer.md",{"type":50,"value":349}," — loss-to-data-shape mapping; ",{"type":44,"tag":65,"props":351,"children":353},{"className":352},[],[354],{"type":50,"value":355},"BatchSamplers.NO_DUPLICATES",{"type":50,"value":357}," requirement for MNRL-family; ",{"type":44,"tag":65,"props":359,"children":361},{"className":360},[],[362],{"type":50,"value":363},"Cached*",{"type":50,"value":365}," ↔ ",{"type":44,"tag":65,"props":367,"children":369},{"className":368},[],[370],{"type":50,"value":371},"gradient_checkpointing",{"type":50,"value":373}," incompatibility.",{"type":44,"tag":339,"props":375,"children":376},{},[377,383,385,391,393,399],{"type":44,"tag":65,"props":378,"children":380},{"className":379},[],[381],{"type":50,"value":382},"references\u002Fevaluators_sentence_transformer.md",{"type":50,"value":384}," — evaluator-to-task mapping; ",{"type":44,"tag":65,"props":386,"children":388},{"className":387},[],[389],{"type":50,"value":390},"metric_for_best_model",{"type":50,"value":392}," key construction (named vs unnamed); per-evaluator ",{"type":44,"tag":65,"props":394,"children":396},{"className":395},[],[397],{"type":50,"value":398},"primary_metric",{"type":50,"value":400}," values.",{"type":44,"tag":339,"props":402,"children":403},{},[404,410],{"type":44,"tag":65,"props":405,"children":407},{"className":406},[],[408],{"type":50,"value":409},"references\u002Fmodel_architectures.md",{"type":50,"value":411}," — encoder vs decoder vs static vs Router pipelines; pooling rules (mean \u002F cls \u002F lasttoken); auto-mean-pooling behavior for fresh-start MLM bases.",{"type":44,"tag":339,"props":413,"children":414},{},[415,421],{"type":44,"tag":65,"props":416,"children":418},{"className":417},[],[419],{"type":50,"value":420},"scripts\u002Ftrain_sentence_transformer_example.py",{"type":50,"value":422}," — production template; copy this as your starting point.",{"type":44,"tag":53,"props":424,"children":425},{},[426],{"type":44,"tag":57,"props":427,"children":428},{},[429],{"type":44,"tag":170,"props":430,"children":431},{},[432],{"type":50,"value":208},{"type":44,"tag":335,"props":434,"children":435},{},[436,463,489],{"type":44,"tag":339,"props":437,"children":438},{},[439,445,447,453,455,461],{"type":44,"tag":65,"props":440,"children":442},{"className":441},[],[443],{"type":50,"value":444},"references\u002Flosses_cross_encoder.md",{"type":50,"value":446}," — pointwise \u002F pairwise \u002F listwise \u002F distillation; ",{"type":44,"tag":65,"props":448,"children":450},{"className":449},[],[451],{"type":50,"value":452},"pos_weight",{"type":50,"value":454}," derivation; ",{"type":44,"tag":65,"props":456,"children":458},{"className":457},[],[459],{"type":50,"value":460},"activation_fn=Identity()",{"type":50,"value":462}," mandatory for non-BCE losses (silent eval-rank collapse otherwise).",{"type":44,"tag":339,"props":464,"children":465},{},[466,472,474,480,482,488],{"type":44,"tag":65,"props":467,"children":469},{"className":468},[],[470],{"type":50,"value":471},"references\u002Fevaluators_cross_encoder.md",{"type":50,"value":473}," — ",{"type":44,"tag":65,"props":475,"children":477},{"className":476},[],[478],{"type":50,"value":479},"CrossEncoderRerankingEvaluator",{"type":50,"value":481}," recipe; named-evaluator key format ",{"type":44,"tag":65,"props":483,"children":485},{"className":484},[],[486],{"type":50,"value":487},"eval_{name}_{primary_metric}",{"type":50,"value":80},{"type":44,"tag":339,"props":490,"children":491},{},[492,498],{"type":44,"tag":65,"props":493,"children":495},{"className":494},[],[496],{"type":50,"value":497},"scripts\u002Ftrain_cross_encoder_example.py",{"type":50,"value":422},{"type":44,"tag":53,"props":500,"children":501},{},[502],{"type":44,"tag":57,"props":503,"children":504},{},[505],{"type":44,"tag":170,"props":506,"children":507},{},[508],{"type":50,"value":250},{"type":44,"tag":335,"props":510,"children":511},{},[512,530,555],{"type":44,"tag":339,"props":513,"children":514},{},[515,521,522,528],{"type":44,"tag":65,"props":516,"children":518},{"className":517},[],[519],{"type":50,"value":520},"references\u002Flosses_sparse_encoder.md",{"type":50,"value":473},{"type":44,"tag":65,"props":523,"children":525},{"className":524},[],[526],{"type":50,"value":527},"SpladeLoss",{"type":50,"value":529}," wrapper requirement; FLOPS regularizer weights; smoke-test active-dim ramp behavior.",{"type":44,"tag":339,"props":531,"children":532},{},[533,539,540,546,548,553],{"type":44,"tag":65,"props":534,"children":536},{"className":535},[],[537],{"type":50,"value":538},"references\u002Fevaluators_sparse_encoder.md",{"type":50,"value":473},{"type":44,"tag":65,"props":541,"children":543},{"className":542},[],[544],{"type":50,"value":545},"SparseNanoBEIREvaluator",{"type":50,"value":547}," (English-only) and the in-domain alternative; ",{"type":44,"tag":65,"props":549,"children":551},{"className":550},[],[552],{"type":50,"value":487},{"type":50,"value":554}," key format.",{"type":44,"tag":339,"props":556,"children":557},{},[558,564],{"type":44,"tag":65,"props":559,"children":561},{"className":560},[],[562],{"type":50,"value":563},"scripts\u002Ftrain_sparse_encoder_example.py",{"type":50,"value":422},{"type":44,"tag":318,"props":566,"children":568},{"id":567},"cross-cutting-always-required-regardless-of-task",[569],{"type":50,"value":570},"Cross-cutting — always required (regardless of task)",{"type":44,"tag":335,"props":572,"children":573},{},[574,639,650,677],{"type":44,"tag":339,"props":575,"children":576},{},[577,583,584,590,592,598,600,606,608,614,615,621,623,629,631,637],{"type":44,"tag":65,"props":578,"children":580},{"className":579},[],[581],{"type":50,"value":582},"references\u002Ftraining_args.md",{"type":50,"value":473},{"type":44,"tag":65,"props":585,"children":587},{"className":586},[],[588],{"type":50,"value":589},"TrainingArguments",{"type":50,"value":591}," knobs, precision rules (load fp32 + autocast bf16\u002Ffp16; never ",{"type":44,"tag":65,"props":593,"children":595},{"className":594},[],[596],{"type":50,"value":597},"torch_dtype=bfloat16",{"type":50,"value":599},"), ",{"type":44,"tag":65,"props":601,"children":603},{"className":602},[],[604],{"type":50,"value":605},"warmup_steps",{"type":50,"value":607}," (float) vs deprecated ",{"type":44,"tag":65,"props":609,"children":611},{"className":610},[],[612],{"type":50,"value":613},"warmup_ratio",{"type":50,"value":106},{"type":44,"tag":65,"props":616,"children":618},{"className":617},[],[619],{"type":50,"value":620},"save_steps",{"type":50,"value":622}," must be a multiple of ",{"type":44,"tag":65,"props":624,"children":626},{"className":625},[],[627],{"type":50,"value":628},"eval_steps",{"type":50,"value":630}," for ",{"type":44,"tag":65,"props":632,"children":634},{"className":633},[],[635],{"type":50,"value":636},"load_best_model_at_end",{"type":50,"value":638},", schedulers, HPO, tracker, resume, hub-push variants.",{"type":44,"tag":339,"props":640,"children":641},{},[642,648],{"type":44,"tag":65,"props":643,"children":645},{"className":644},[],[646],{"type":50,"value":647},"references\u002Fdataset_formats.md",{"type":50,"value":649}," — column-matching rules (label name auto-detection; column-order-not-name); reshaping recipes; hard-negative mining options.",{"type":44,"tag":339,"props":651,"children":652},{},[653,659,661,667,669,675],{"type":44,"tag":65,"props":654,"children":656},{"className":655},[],[657],{"type":50,"value":658},"references\u002Fbase_model_selection.md",{"type":50,"value":660}," — discovery commands; per-type model namespaces; ModernBERT-family ",{"type":44,"tag":65,"props":662,"children":664},{"className":663},[],[665],{"type":50,"value":666},"max_seq_length=8192",{"type":50,"value":668}," trap; ",{"type":44,"tag":65,"props":670,"children":672},{"className":671},[],[673],{"type":50,"value":674},"datasets >= 4",{"type":50,"value":676}," script-loader rejection; non-English starting-point shortcuts.",{"type":44,"tag":339,"props":678,"children":679},{},[680,686],{"type":44,"tag":65,"props":681,"children":683},{"className":682},[],[684],{"type":50,"value":685},"references\u002Ftroubleshooting.md",{"type":50,"value":687}," — symptom-indexed failure recipes. Skim the section headings on every run, even a healthy one; the \"Metrics don't improve\" and \"Hub push fails\" entries cover bugs that bite frequently and are cheaper to recognize before they fire than to debug after.",{"type":44,"tag":318,"props":689,"children":691},{"id":690},"cross-cutting-load-when-applicable",[692],{"type":50,"value":693},"Cross-cutting — load when applicable",{"type":44,"tag":335,"props":695,"children":696},{},[697,708,719],{"type":44,"tag":339,"props":698,"children":699},{},[700,706],{"type":44,"tag":65,"props":701,"children":703},{"className":702},[],[704],{"type":50,"value":705},"references\u002Fhardware_guide.md",{"type":50,"value":707}," — VRAM sizing, multi-GPU, FSDP \u002F DeepSpeed, HF Jobs flavors. Required for >24GB models, multi-GPU, or HF Jobs runs.",{"type":44,"tag":339,"props":709,"children":710},{},[711,717],{"type":44,"tag":65,"props":712,"children":714},{"className":713},[],[715],{"type":50,"value":716},"references\u002Fhf_jobs_execution.md",{"type":50,"value":718}," — required when running on HF Jobs.",{"type":44,"tag":339,"props":720,"children":721},{},[722,728,730,736,738,744],{"type":44,"tag":65,"props":723,"children":725},{"className":724},[],[726],{"type":50,"value":727},"references\u002Fprompts_and_instructions.md",{"type":50,"value":729}," — required when using prompt-tuned bases (E5, BGE, GTE, Qwen3-Embedding, Instructor, Nomic, etc.) or adding ",{"type":44,"tag":65,"props":731,"children":733},{"className":732},[],[734],{"type":50,"value":735},"query: ",{"type":50,"value":737}," \u002F ",{"type":44,"tag":65,"props":739,"children":741},{"className":740},[],[742],{"type":50,"value":743},"passage: ",{"type":50,"value":745}," style prefixes.",{"type":44,"tag":318,"props":747,"children":749},{"id":748},"variant-scripts-open-when-the-task-matches",[750],{"type":50,"value":751},"Variant scripts (open when the task matches)",{"type":44,"tag":335,"props":753,"children":754},{},[755,774,792,810],{"type":44,"tag":339,"props":756,"children":757},{},[758,765,767,773],{"type":44,"tag":57,"props":759,"children":760},{},[761],{"type":44,"tag":170,"props":762,"children":763},{},[764],{"type":50,"value":174},{"type":50,"value":766}," ",{"type":44,"tag":65,"props":768,"children":770},{"className":769},[],[771],{"type":50,"value":772},"scripts\u002Ftrain_sentence_transformer_\u003Cmatryoshka|multi_dataset|with_lora|distillation|make_multilingual|static_embedding>_example.py",{"type":50,"value":80},{"type":44,"tag":339,"props":775,"children":776},{},[777,784,785,791],{"type":44,"tag":57,"props":778,"children":779},{},[780],{"type":44,"tag":170,"props":781,"children":782},{},[783],{"type":50,"value":208},{"type":50,"value":766},{"type":44,"tag":65,"props":786,"children":788},{"className":787},[],[789],{"type":50,"value":790},"scripts\u002Ftrain_cross_encoder_\u003Cdistillation|listwise>_example.py",{"type":50,"value":80},{"type":44,"tag":339,"props":793,"children":794},{},[795,802,803,809],{"type":44,"tag":57,"props":796,"children":797},{},[798],{"type":44,"tag":170,"props":799,"children":800},{},[801],{"type":50,"value":250},{"type":50,"value":766},{"type":44,"tag":65,"props":804,"children":806},{"className":805},[],[807],{"type":50,"value":808},"scripts\u002Ftrain_sparse_encoder_distillation_example.py",{"type":50,"value":80},{"type":44,"tag":339,"props":811,"children":812},{},[813,815,821],{"type":50,"value":814},"Hard-negative mining CLI — ",{"type":44,"tag":65,"props":816,"children":818},{"className":817},[],[819],{"type":50,"value":820},"scripts\u002Fmine_hard_negatives.py",{"type":50,"value":80},{"type":44,"tag":116,"props":823,"children":825},{"id":824},"_3-defaults",[826],{"type":50,"value":827},"3. Defaults",{"type":44,"tag":53,"props":829,"children":830},{},[831],{"type":50,"value":832},"Override only if the user specifies otherwise:",{"type":44,"tag":335,"props":834,"children":835},{},[836,846,863],{"type":44,"tag":339,"props":837,"children":838},{},[839,844],{"type":44,"tag":57,"props":840,"children":841},{},[842],{"type":50,"value":843},"Local execution.",{"type":50,"value":845}," Pitch HF Jobs only if local hardware can't fit the job.",{"type":44,"tag":339,"props":847,"children":848},{},[849,854,856,861],{"type":44,"tag":57,"props":850,"children":851},{},[852],{"type":50,"value":853},"Single run.",{"type":50,"value":855}," After it completes, propose experimentation if the user would benefit (weak\u002Fmarginal verdict, \"see how high you can push it\" framing, etc.). Iteration rules in ",{"type":44,"tag":65,"props":857,"children":859},{"className":858},[],[860],{"type":50,"value":582},{"type":50,"value":862}," (Experimentation section).",{"type":44,"tag":339,"props":864,"children":865},{},[866,871,873,879,881,887,889,894],{"type":44,"tag":57,"props":867,"children":868},{},[869],{"type":50,"value":870},"Public Hub push at end-of-run, wrapped in try-except.",{"type":50,"value":872}," On HF Jobs (ephemeral env) ALSO enable in-trainer push (",{"type":44,"tag":65,"props":874,"children":876},{"className":875},[],[877],{"type":50,"value":878},"push_to_hub=True",{"type":50,"value":880}," + ",{"type":44,"tag":65,"props":882,"children":884},{"className":883},[],[885],{"type":50,"value":886},"hub_strategy=\"every_save\"",{"type":50,"value":888},"); details in ",{"type":44,"tag":65,"props":890,"children":892},{"className":891},[],[893],{"type":50,"value":716},{"type":50,"value":80},{"type":44,"tag":116,"props":896,"children":898},{"id":897},"_4-constraints-the-produced-script-must-satisfy",[899],{"type":50,"value":900},"4. Constraints the produced script must satisfy",{"type":44,"tag":53,"props":902,"children":903},{},[904],{"type":50,"value":905},"These are non-negotiable contracts. Implementation lives in the production templates and references — do not reinvent.",{"type":44,"tag":335,"props":907,"children":908},{},[909,934,947,995,1007,1027,1048,1068],{"type":44,"tag":339,"props":910,"children":911},{},[912,914,920,921,926,927,933],{"type":50,"value":913},"Capture the pre-training evaluator score as ",{"type":44,"tag":65,"props":915,"children":917},{"className":916},[],[918],{"type":50,"value":919},"baseline_eval",{"type":50,"value":766},{"type":44,"tag":57,"props":922,"children":923},{},[924],{"type":50,"value":925},"before",{"type":50,"value":766},{"type":44,"tag":65,"props":928,"children":930},{"className":929},[],[931],{"type":50,"value":932},"trainer.train()",{"type":50,"value":80},{"type":44,"tag":339,"props":935,"children":936},{},[937,939,945],{"type":50,"value":938},"Emit a single end-of-run line: ",{"type":44,"tag":65,"props":940,"children":942},{"className":941},[],[943],{"type":50,"value":944},"VERDICT: WIN|MARGINAL|REGRESSION | score=... | baseline=... | delta=...",{"type":50,"value":946},". A monitor scrapes for this.",{"type":44,"tag":339,"props":948,"children":949},{},[950,952,958,959,965,966,972,973,979,980,986,987,993],{"type":50,"value":951},"Silence ",{"type":44,"tag":65,"props":953,"children":955},{"className":954},[],[956],{"type":50,"value":957},"httpx",{"type":50,"value":106},{"type":44,"tag":65,"props":960,"children":962},{"className":961},[],[963],{"type":50,"value":964},"httpcore",{"type":50,"value":106},{"type":44,"tag":65,"props":967,"children":969},{"className":968},[],[970],{"type":50,"value":971},"huggingface_hub",{"type":50,"value":106},{"type":44,"tag":65,"props":974,"children":976},{"className":975},[],[977],{"type":50,"value":978},"urllib3",{"type":50,"value":106},{"type":44,"tag":65,"props":981,"children":983},{"className":982},[],[984],{"type":50,"value":985},"filelock",{"type":50,"value":106},{"type":44,"tag":65,"props":988,"children":990},{"className":989},[],[991],{"type":50,"value":992},"fsspec",{"type":50,"value":994}," to WARNING (otherwise HF download URLs flood the agent's context).",{"type":44,"tag":339,"props":996,"children":997},{},[998,1000,1006],{"type":50,"value":999},"Tee logs to ",{"type":44,"tag":65,"props":1001,"children":1003},{"className":1002},[],[1004],{"type":50,"value":1005},"logs\u002F{RUN_NAME}.log",{"type":50,"value":80},{"type":44,"tag":339,"props":1008,"children":1009},{},[1010,1012,1018,1020,1026],{"type":50,"value":1011},"End with ",{"type":44,"tag":65,"props":1013,"children":1015},{"className":1014},[],[1016],{"type":50,"value":1017},"model.push_to_hub(...)",{"type":50,"value":1019}," wrapped in ",{"type":44,"tag":65,"props":1021,"children":1023},{"className":1022},[],[1024],{"type":50,"value":1025},"try\u002Fexcept",{"type":50,"value":80},{"type":44,"tag":339,"props":1028,"children":1029},{},[1030,1032,1038,1040,1046],{"type":50,"value":1031},"Smoke-test before any long run (",{"type":44,"tag":65,"props":1033,"children":1035},{"className":1034},[],[1036],{"type":50,"value":1037},"max_steps=1",{"type":50,"value":1039}," + tiny dataset slice). The production templates show one common pattern (",{"type":44,"tag":65,"props":1041,"children":1043},{"className":1042},[],[1044],{"type":50,"value":1045},"SMOKE_TEST",{"type":50,"value":1047}," env var).",{"type":44,"tag":339,"props":1049,"children":1050},{},[1051,1058,1060,1066],{"type":44,"tag":57,"props":1052,"children":1053},{},[1054],{"type":44,"tag":170,"props":1055,"children":1056},{},[1057],{"type":50,"value":208},{"type":50,"value":1059}," Include ",{"type":44,"tag":65,"props":1061,"children":1063},{"className":1062},[],[1064],{"type":50,"value":1065},"EarlyStoppingCallback(patience>=3)",{"type":50,"value":1067}," — CE rerankers often peak mid-training and regress.",{"type":44,"tag":339,"props":1069,"children":1070},{},[1071,1078,1080,1086,1087,1093,1095,1101],{"type":44,"tag":57,"props":1072,"children":1073},{},[1074],{"type":44,"tag":170,"props":1075,"children":1076},{},[1077],{"type":50,"value":250},{"type":50,"value":1079}," Log ",{"type":44,"tag":65,"props":1081,"children":1083},{"className":1082},[],[1084],{"type":50,"value":1085},"query_active_dims",{"type":50,"value":737},{"type":44,"tag":65,"props":1088,"children":1090},{"className":1089},[],[1091],{"type":50,"value":1092},"corpus_active_dims",{"type":50,"value":1094}," on the verdict line; high nDCG with collapsed sparsity is not a win. The keys come back name-prefixed (e.g. ",{"type":44,"tag":65,"props":1096,"children":1098},{"className":1097},[],[1099],{"type":50,"value":1100},"..._query_active_dims",{"type":50,"value":1102},"); use suffix matching to pluck them — see the SPARSE production template for the exact pattern.",{"type":44,"tag":116,"props":1104,"children":1106},{"id":1105},"_5-workflow",[1107],{"type":50,"value":1108},"5. Workflow",{"type":44,"tag":1110,"props":1111,"children":1112},"ol",{},[1113,1118,1123,1135,1192,1203,1208],{"type":44,"tag":339,"props":1114,"children":1115},{},[1116],{"type":50,"value":1117},"Identify the model type (§1). Ask if ambiguous.",{"type":44,"tag":339,"props":1119,"children":1120},{},[1121],{"type":50,"value":1122},"Load the §2 required-reading files for that type.",{"type":44,"tag":339,"props":1124,"children":1125},{},[1126,1128,1133],{"type":50,"value":1127},"Open ",{"type":44,"tag":65,"props":1129,"children":1131},{"className":1130},[],[1132],{"type":50,"value":96},{"type":50,"value":1134}," and copy it as your starting point.",{"type":44,"tag":339,"props":1136,"children":1137},{},[1138,1140,1146,1147,1153,1154,1160,1162,1168,1170,1175,1177,1183,1185,1190],{"type":50,"value":1139},"Replace ",{"type":44,"tag":65,"props":1141,"children":1143},{"className":1142},[],[1144],{"type":50,"value":1145},"MODEL_NAME",{"type":50,"value":106},{"type":44,"tag":65,"props":1148,"children":1150},{"className":1149},[],[1151],{"type":50,"value":1152},"DATASET_NAME",{"type":50,"value":106},{"type":44,"tag":65,"props":1155,"children":1157},{"className":1156},[],[1158],{"type":50,"value":1159},"RUN_NAME",{"type":50,"value":1161},", the loss, and the evaluator with the user's task. Cross-check loss\u002Fdata-shape match against ",{"type":44,"tag":65,"props":1163,"children":1165},{"className":1164},[],[1166],{"type":50,"value":1167},"references\u002Flosses_\u003Ctype>.md",{"type":50,"value":1169},"; cross-check the ",{"type":44,"tag":65,"props":1171,"children":1173},{"className":1172},[],[1174],{"type":50,"value":390},{"type":50,"value":1176}," key against ",{"type":44,"tag":65,"props":1178,"children":1180},{"className":1179},[],[1181],{"type":50,"value":1182},"references\u002Fevaluators_\u003Ctype>.md",{"type":50,"value":1184}," (named evaluators format the key as ",{"type":44,"tag":65,"props":1186,"children":1188},{"className":1187},[],[1189],{"type":50,"value":487},{"type":50,"value":1191},").",{"type":44,"tag":339,"props":1193,"children":1194},{},[1195,1197,1202],{"type":50,"value":1196},"Smoke-test (",{"type":44,"tag":65,"props":1198,"children":1200},{"className":1199},[],[1201],{"type":50,"value":1037},{"type":50,"value":1191},{"type":44,"tag":339,"props":1204,"children":1205},{},[1206],{"type":50,"value":1207},"Run.",{"type":44,"tag":339,"props":1209,"children":1210},{},[1211,1213,1219],{"type":50,"value":1212},"After the run, append to ",{"type":44,"tag":65,"props":1214,"children":1216},{"className":1215},[],[1217],{"type":50,"value":1218},"logs\u002Fexperiments.md",{"type":50,"value":1220}," and propose iteration if the verdict is weak\u002Fmarginal.",{"type":44,"tag":116,"props":1222,"children":1224},{"id":1223},"prerequisites",[1225],{"type":50,"value":1226},"Prerequisites",{"type":44,"tag":1228,"props":1229,"children":1234},"pre",{"className":1230,"code":1231,"language":1232,"meta":1233,"style":1233},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pip install \"sentence-transformers[train]>=5.0\"        # add [train,image] \u002F [audio] \u002F [video] for [SentenceTransformer] multimodal\npip install trackio                                    # optional tracker; or wandb \u002F tensorboard \u002F mlflow\nhf auth login                                          # or set HF_TOKEN with write scope (for Hub push)\n","bash","",[1235],{"type":44,"tag":65,"props":1236,"children":1237},{"__ignoreMap":1233},[1238,1277,1299],{"type":44,"tag":170,"props":1239,"children":1242},{"class":1240,"line":1241},"line",1,[1243,1249,1255,1261,1266,1271],{"type":44,"tag":170,"props":1244,"children":1246},{"style":1245},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[1247],{"type":50,"value":1248},"pip",{"type":44,"tag":170,"props":1250,"children":1252},{"style":1251},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[1253],{"type":50,"value":1254}," install",{"type":44,"tag":170,"props":1256,"children":1258},{"style":1257},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[1259],{"type":50,"value":1260}," \"",{"type":44,"tag":170,"props":1262,"children":1263},{"style":1251},[1264],{"type":50,"value":1265},"sentence-transformers[train]>=5.0",{"type":44,"tag":170,"props":1267,"children":1268},{"style":1257},[1269],{"type":50,"value":1270},"\"",{"type":44,"tag":170,"props":1272,"children":1274},{"style":1273},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[1275],{"type":50,"value":1276},"        # add [train,image] \u002F [audio] \u002F [video] for [SentenceTransformer] multimodal\n",{"type":44,"tag":170,"props":1278,"children":1280},{"class":1240,"line":1279},2,[1281,1285,1289,1294],{"type":44,"tag":170,"props":1282,"children":1283},{"style":1245},[1284],{"type":50,"value":1248},{"type":44,"tag":170,"props":1286,"children":1287},{"style":1251},[1288],{"type":50,"value":1254},{"type":44,"tag":170,"props":1290,"children":1291},{"style":1251},[1292],{"type":50,"value":1293}," trackio",{"type":44,"tag":170,"props":1295,"children":1296},{"style":1273},[1297],{"type":50,"value":1298},"                                    # optional tracker; or wandb \u002F tensorboard \u002F mlflow\n",{"type":44,"tag":170,"props":1300,"children":1302},{"class":1240,"line":1301},3,[1303,1308,1313,1318],{"type":44,"tag":170,"props":1304,"children":1305},{"style":1245},[1306],{"type":50,"value":1307},"hf",{"type":44,"tag":170,"props":1309,"children":1310},{"style":1251},[1311],{"type":50,"value":1312}," auth",{"type":44,"tag":170,"props":1314,"children":1315},{"style":1251},[1316],{"type":50,"value":1317}," login",{"type":44,"tag":170,"props":1319,"children":1320},{"style":1273},[1321],{"type":50,"value":1322},"                                          # or set HF_TOKEN with write scope (for Hub push)\n",{"type":44,"tag":53,"props":1324,"children":1325},{},[1326,1328,1334,1335,1341],{"type":50,"value":1327},"GPU strongly recommended. CPU works only for demos and ",{"type":44,"tag":65,"props":1329,"children":1331},{"className":1330},[],[1332],{"type":50,"value":1333},"[SentenceTransformer]",{"type":50,"value":766},{"type":44,"tag":65,"props":1336,"children":1338},{"className":1337},[],[1339],{"type":50,"value":1340},"StaticEmbedding",{"type":50,"value":80},{"type":44,"tag":1343,"props":1344,"children":1345},"style",{},[1346],{"type":50,"value":1347},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1349,"total":1241},[1350],{"slug":4,"name":4,"fn":5,"description":6,"org":1351,"tags":1352,"stars":27,"repoUrl":28,"updatedAt":29},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1353,1354,1355,1356,1357],{"name":19,"slug":20,"type":14},{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},{"name":22,"slug":23,"type":14},{"name":25,"slug":26,"type":14},{"items":1359,"total":1522},[1360,1368,1384,1401,1415,1428,1441,1456,1470,1480,1493,1507],{"slug":4,"name":4,"fn":5,"description":6,"org":1361,"tags":1362,"stars":27,"repoUrl":28,"updatedAt":29},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1363,1364,1365,1366,1367],{"name":19,"slug":20,"type":14},{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},{"name":22,"slug":23,"type":14},{"name":25,"slug":26,"type":14},{"slug":1369,"name":1369,"fn":1370,"description":1371,"org":1372,"tags":1373,"stars":1381,"repoUrl":1382,"updatedAt":1383},"trl-training","train and fine-tune LLMs with TRL","Train and fine-tune transformer language models using TRL (Transformers Reinforcement Learning). Supports SFT, DPO, GRPO, KTO, RLOO and Reward Model training via CLI commands.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1374,1377,1378,1379,1380],{"name":1375,"slug":1376,"type":14},"AI Infrastructure","ai-infrastructure",{"name":19,"slug":20,"type":14},{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},{"name":22,"slug":23,"type":14},18850,"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftrl","2026-04-06T18:25:32.746828",{"slug":1385,"name":1385,"fn":1386,"description":1387,"org":1388,"tags":1389,"stars":1398,"repoUrl":1399,"updatedAt":1400},"hf-cli","manage Hugging Face Hub resources via CLI","Hugging Face Hub CLI (`hf`) for downloading, uploading, and managing models, datasets, spaces, buckets, repos, papers, jobs, and more on the Hugging Face Hub. Use when: handling authentication; managing local cache; managing Hugging Face Buckets; running or scheduling jobs on Hugging Face infrastructure; managing Hugging Face repos; discussions and pull requests; browsing models, datasets and spaces; reading, searching, or browsing academic papers; managing collections; querying datasets; configuring spaces; setting up webhooks; or deploying and managing HF Inference Endpoints. Make sure to use this skill whenever the user mentions 'hf', 'huggingface', 'Hugging Face', 'huggingface-cli', or 'hugging face cli', or wants to do anything related to the Hugging Face ecosystem and to AI and ML in general. Also use for cloud storage needs like training checkpoints, data pipelines, or agent traces. Use even if the user doesn't explicitly ask for a CLI command. Replaces the deprecated `huggingface-cli`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1390,1393,1396,1397],{"name":1391,"slug":1392,"type":14},"CLI","cli",{"name":1394,"slug":1395,"type":14},"Datasets","datasets",{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},10861,"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fskills","2026-04-06T18:25:34.020855",{"slug":1402,"name":1402,"fn":1403,"description":1404,"org":1405,"tags":1406,"stars":1398,"repoUrl":1399,"updatedAt":1414},"hf-cloud-aws-context-discovery","discover local AWS environment context","Discover the user's local AWS context (active profile, region, account ID, caller identity) at the start of any AWS task. Use this skill before any other AWS work — deploying to SageMaker, creating resources, calling AWS APIs, or anything that touches an AWS account. Use it especially when the user has not specified a region or profile explicitly, when they say things like \"use my AWS account\", \"deploy to AWS\", \"use my profile\", or when about to make any AWS CLI or SDK call. Never guess the region or account ID — always use this skill to read it from the local configuration first.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1407,1410,1411],{"name":1408,"slug":1409,"type":14},"AWS","aws",{"name":1391,"slug":1392,"type":14},{"name":1412,"slug":1413,"type":14},"Configuration","configuration","2026-07-08T05:55:33.716099",{"slug":1416,"name":1416,"fn":1417,"description":1418,"org":1419,"tags":1420,"stars":1398,"repoUrl":1399,"updatedAt":1427},"hf-cloud-python-env-setup","set up Python environments for AWS","Set up an isolated Python environment for SageMaker \u002F AWS work, with the right Python version and current boto3. Use this skill whenever Python code will be executed for a SageMaker deployment, training job, or any AWS automation — including when about to run `pip install`, when about to invoke `boto3`, when creating or activating a virtualenv, or when the user asks to \"set up the environment\". Never use system Python and never `pip install` into it. Always isolate. This skill prevents the most common failure modes: wrong Python version, dependency conflicts, and stale SDKs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1421,1422,1423,1426],{"name":1375,"slug":1376,"type":14},{"name":1408,"slug":1409,"type":14},{"name":1424,"slug":1425,"type":14},"Engineering","engineering",{"name":22,"slug":23,"type":14},"2026-07-08T05:55:32.505017",{"slug":1429,"name":1429,"fn":1430,"description":1431,"org":1432,"tags":1433,"stars":1398,"repoUrl":1399,"updatedAt":1440},"hf-cloud-sagemaker-deployment-planner","plan model deployments to Amazon SageMaker","Plan and coordinate the deployment of a model to Amazon SageMaker AI. Use this skill whenever the user wants to deploy, host, serve, or expose a model on SageMaker or AWS — including phrases like \"deploy a model\", \"host this LLM on AWS\", \"serve this embedding model\", \"deploy a reranker\", \"deploy a text-to-image \u002F diffusion model\", \"host this for async inference\", \"create an endpoint\", \"serve my fine-tuned model\", or any request that involves making a model available for inference on AWS. Use this even when the user is vague (e.g. \"I just want to get this running on AWS, you figure it out\"). Works for text-generation LLMs, embedding models, rerankers, classifiers, text-to-image \u002F diffusion models — picks the right serving stack and chooses between real-time and async inference. This is the entry-point skill for SageMaker deployment work — it asks clarifying questions, picks a deployment pathway, and coordinates the other deployment skills.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1434,1435,1436,1439],{"name":1375,"slug":1376,"type":14},{"name":1408,"slug":1409,"type":14},{"name":1437,"slug":1438,"type":14},"Deployment","deployment",{"name":9,"slug":13,"type":14},"2026-07-08T05:55:37.387689",{"slug":1442,"name":1442,"fn":1443,"description":1444,"org":1445,"tags":1446,"stars":1398,"repoUrl":1399,"updatedAt":1455},"hf-cloud-sagemaker-iam-preflight","configure SageMaker IAM roles","Ensure a usable SageMaker execution role exists before deploying or training. Use this skill whenever about to create a SageMaker endpoint, model, training job, or any resource that requires an execution role. Use it especially when the user has not provided a role ARN explicitly, when scripts are about to call `iam:CreateRole`, or when an AccessDenied error mentions an IAM action. Never blindly call `iam:CreateRole` — always check for existing roles first. This skill prevents the most common SageMaker deployment failure: trying to create IAM resources from an SSO principal that has no IAM write permissions.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1447,1448,1449,1452],{"name":1375,"slug":1376,"type":14},{"name":1408,"slug":1409,"type":14},{"name":1450,"slug":1451,"type":14},"Permissions","permissions",{"name":1453,"slug":1454,"type":14},"Security","security","2026-07-08T05:55:34.948771",{"slug":1457,"name":1457,"fn":1458,"description":1459,"org":1460,"tags":1461,"stars":1398,"repoUrl":1399,"updatedAt":1469},"hf-cloud-sagemaker-production-defaults","create production-ready SageMaker endpoints","Create a SageMaker endpoint (real-time or async) with autoscaling, CloudWatch alarms, and tagging enabled by default. Use this skill whenever about to create a SageMaker endpoint, write deployment code that calls `create_endpoint`, or finalize a deployment after the image URI and IAM role are known. Provides deploy.py for real-time endpoints and deploy_async.py for async endpoints (with genuine scale-to-zero support). This is the last step in the SageMaker deployment workflow. Never generate a bare `create_endpoint` call without these defaults — endpoints without autoscaling or alarms are demos, not deployments.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1462,1463,1464,1465,1466],{"name":1375,"slug":1376,"type":14},{"name":1408,"slug":1409,"type":14},{"name":1437,"slug":1438,"type":14},{"name":9,"slug":13,"type":14},{"name":1467,"slug":1468,"type":14},"Monitoring","monitoring","2026-07-08T05:55:38.664702",{"slug":1471,"name":1471,"fn":1472,"description":1473,"org":1474,"tags":1475,"stars":1398,"repoUrl":1399,"updatedAt":1479},"hf-cloud-serving-image-selection","select SageMaker serving containers","Pick the right serving container for a SageMaker model deployment and find its current image URI. Use this skill whenever about to deploy a model to a SageMaker endpoint and an image URI needs to be chosen — including when the user says \"deploy this LLM\", \"host this HuggingFace model\", \"serve this fine-tuned model\", \"deploy this embedding model\", \"host a reranker\", \"serve a sentence-transformers model\", or when about to hardcode any container URI in deployment code. HuggingFace-curated Deep Learning Containers are ALWAYS preferred: HuggingFace vLLM (LLMs and generative rerankers), HuggingFace vLLM-Omni (multimodal), TEI (embeddings\u002Fcross-encoder rerankers), HF Inference Toolkit (other transformers). Generic images (AWS vLLM, DJL-LMI, SGLang) are used only when no HuggingFace image is compatible — never merely because they carry a newer version. Never hardcode a container URI from memory and never default to TGI. Prevents stale-image failures and wrong-region URIs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1476,1477,1478],{"name":1375,"slug":1376,"type":14},{"name":1408,"slug":1409,"type":14},{"name":1437,"slug":1438,"type":14},"2026-07-08T05:55:36.173465",{"slug":1481,"name":1481,"fn":1482,"description":1483,"org":1484,"tags":1485,"stars":1398,"repoUrl":1399,"updatedAt":1492},"hf-mcp","access Hugging Face Hub via MCP","Use Hugging Face Hub via MCP server tools. Search models, datasets, Spaces, papers. Get repo details, fetch documentation, run compute jobs, and use Gradio Spaces as AI tools. Available when connected to the HF MCP server.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1486,1487,1488,1489],{"name":1394,"slug":1395,"type":14},{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},{"name":1490,"slug":1491,"type":14},"MCP","mcp","2026-04-06T18:25:50.364185",{"slug":1494,"name":1494,"fn":1495,"description":1496,"org":1497,"tags":1498,"stars":1398,"repoUrl":1399,"updatedAt":1506},"hf-mem","estimate memory for Hugging Face models","Hugging Face CLI to estimate the required memory to load Safetensors or GGUF model weights for inference from the Hugging Face Hub",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1499,1500,1501,1502,1503],{"name":1375,"slug":1376,"type":14},{"name":1391,"slug":1392,"type":14},{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},{"name":1504,"slug":1505,"type":14},"Performance","performance","2026-06-13T07:23:57.101435",{"slug":1508,"name":1508,"fn":1509,"description":1510,"org":1511,"tags":1512,"stars":1398,"repoUrl":1399,"updatedAt":1521},"huggingface-best","find and compare Hugging Face models","Use when the user asks about finding the best, top, or recommended model for a task, wants to know what AI model to use, or wants to compare models by benchmark scores. Triggers on: \"best model for X\", \"what model should I use for\", \"top models for [task]\", \"which model runs on my laptop\u002Fmachine\u002Fdevice\", \"recommend a model for\", \"what LLM should I use for\", \"compare models for\", \"what's state of the art for\", or any question about choosing an AI model for a specific use case. Always use this skill when the user wants model recommendations or comparisons, even if they don't explicitly mention HuggingFace or benchmarks.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1513,1516,1517,1518],{"name":1514,"slug":1515,"type":14},"Analytics","analytics",{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},{"name":1519,"slug":1520,"type":14},"Research","research","2026-04-24T05:09:45.870658",37]