alt.freeweights.embed / all-MiniLM-L6-v2
From: unsloth <huggingface.co/unsloth>Newsgroups: alt.freeweights.embedSubject:

all-MiniLM-L6-v2

Date: 2026-11-15Commit: 0f79ca3Signed: 2DC28CC7B26A283B ✓

Sentence similarity model with 23M parameters. Onnx and openvino and safetensors weights, 977 MB in all. Published by unsloth under Apache-2.0.

23M params977MBall-MiniLM-L6-v2onnx openvino safetensorspermissive
FactsParams23MSize977 MBFormatsonnx, openvino, safetensorsTasksentence similarityLicenseApache-2.0From sourcepermissive
$ fw get unsloth/all-MiniLM-L6-v2
# manifest sha256 5919a5b7cd9c… · 977 MB · 30 files
$ fw verify ./all-MiniLM-L6-v2 unsloth/all-MiniLM-L6-v2
From sourceHosted (signed)unsloth/all-MiniLM-L6-v2Last check: 2026-11-15 03:34 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Evaluate with

Overview

Size
977 MB
Weights
90.9 MB (safetensors)
Parameters
23M
Formats
onnx, openvino, safetensors
Task
sentence similarity
License
Apache-2.0 (permissive)
Files
30, each with a sha256
Publisher
unsloth
Added
2026-11-15
Section
alt.freeweights.embed
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 03:34 UTCpassed

Model card

From the publisher at commit 0f79ca3. Shown as plain text with links; images open at the publisher.

all-MiniLM-L6-v2#

This is a sentence-transformers model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search.

Usage (Sentence-Transformers)#

Using this model becomes easy when you have sentence-transformers installed:

pip install -U sentence-transformers

Then you can use the model like this:

from sentence_transformers import SentenceTransformer
sentences = ["This is an example sentence", "Each sentence is converted"]

model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
embeddings = model.encode(sentences)
print(embeddings)

Usage (HuggingFace Transformers)#

Without sentence-transformers, you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.

from transformers import AutoTokenizer, AutoModel
import torch
import torch.nn.functional as F

#Mean Pooling - Take attention mask into account for correct averaging
def mean_pooling(model_output, attention_mask):
    token_embeddings = model_output[0] #First element of model_output contains all token embeddings
    input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
    return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)


# Sentences we want sentence embeddings for
sentences = ['This is an example sentence', 'Each sentence is converted']

# Load model from HuggingFace Hub
tokenizer = AutoTokenizer.from_pretrained('sentence-transformers/all-MiniLM-L6-v2')
model = AutoModel.from_pretrained('sentence-transformers/all-MiniLM-L6-v2')

# Tokenize sentences
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')

# Compute token embeddings
with torch.no_grad():
    model_output = model(**encoded_input)

# Perform pooling
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])

# Normalize embeddings
sentence_embeddings = F.normalize(sentence_embeddings, p=2, dim=1)

print("Sentence embeddings:")
print(sentence_embeddings)

Background#

The project aims to train sentence embedding models on very large sentence level datasets using a self-supervised contrastive learning objective. We used the pretrained nreimers/MiniLM-L6-H384-uncased model and fine-tuned in on a 1B sentence pairs dataset. We use a contrastive learning objective: given a sentence from the pair, the model should predict which out of a set of randomly sampled other sentences, was actually paired with it in our dataset.

We developed this model during the Community week using JAX/Flax for NLP & CV, organized by Hugging Face. We developed this model as part of the project: Train the Best Sentence Embedding Model Ever with 1B Training Pairs. We benefited from efficient hardware infrastructure to run the project: 7 TPUs v3-8, as well as intervention from Googles Flax, JAX, and Cloud team member about efficient deep learning frameworks.

Intended uses#

Our model is intended to be used as a sentence and short paragraph encoder. Given an input text, it outputs a vector which captures the semantic information. The sentence vector may be used for information retrieval, clustering or sentence similarity tasks.

By default, input text longer than 256 word pieces is truncated.

Training procedure#

Pre-training#

We use the pretrained nreimers/MiniLM-L6-H384-uncased model. Please refer to the model card for more detailed information about the pre-training procedure.

Fine-tuning#

We fine-tune the model using a contrastive objective. Formally, we compute the cosine similarity from each possible sentence pairs from the batch. We then apply the cross entropy loss by comparing with true pairs.

Hyper parameters#

We trained our model on a TPU v3-8. We train the model during 100k steps using a batch size of 1024 (128 per TPU core). We use a learning rate warm up of 500. The sequence length was limited to 128 tokens. We used the AdamW optimizer with a 2e-5 learning rate. The full training script is accessible in this current repository: train_script.py.

Training data#

We use the concatenation from multiple datasets to fine-tune our model. The total number of sentence pairs is above 1 billion sentences. We sampled each dataset given a weighted probability which configuration is detailed in the data_config.json file.

DatasetPaperNumber of training tuples
Reddit comments (2015-2018)paper726,484,430
S2ORC Citation pairs (Abstracts)paper116,288,806
WikiAnswers Duplicate question pairspaper77,427,422
PAQ (Question, Answer) pairspaper64,371,441
S2ORC Citation pairs (Titles)paper52,603,982
S2ORC (Title, Abstract)paper41,769,185
Stack Exchange (Title, Body) pairs-25,316,456
Stack Exchange (Title+Body, Answer) pairs-21,396,559
Stack Exchange (Title, Answer) pairs-21,396,559
MS MARCO tripletspaper9,144,553
GOOAQ: Open Question Answering with Diverse Answer Typespaper3,012,496
Yahoo Answers (Title, Answer)paper1,198,260
Code Search-1,151,414
COCO Image captionspaper828,395
SPECTER citation tripletspaper684,100
Yahoo Answers (Question, Answer)paper681,164
Yahoo Answers (Title, Question)paper659,896
SearchQApaper582,261
Eli5paper325,475
Flickr 30kpaper317,695
Stack Exchange Duplicate questions (titles)304,525
AllNLI (SNLI and MultiNLIpaper SNLI, paper MultiNLI277,230
Stack Exchange Duplicate questions (bodies)250,519
Stack Exchange Duplicate questions (titles+bodies)250,460
Sentence Compressionpaper180,000
Wikihowpaper128,542
Altlexpaper112,696
Quora Question Triplets-103,663
Simple Wikipediapaper102,225
Natural Questions (NQ)paper100,231
SQuAD2.0paper87,599
TriviaQA-73,346
Total1,170,060,424

Files

30 files · 977 MBWeights 90.9 MB (safetensors). Sizes and sha256 from the signed manifest.
Show all 30 files with their sha256
FileSizesha256
.gitattributes1.23 KB98ccb431c012ebfe976280fbd45aea4cec7409935868ccecf3954370f96732a1
1_Pooling/config.json190 B4be450dde3b0273bb9787637cfbd28fe04a7ba6ab9d36ac48e92b11e350ffc23
README.md10.5 KB7dfc82496ec33f906b5b0d6750c1e2397da6530c74d1ae3568c55bc2739125e7
config.json612 B953f9c0d463486b10a6871cc2fd59f223b2c70184f49815e7efbcab5d8908b41
config_sentence_transformers.json116 B061ca9d39661d6c6d6de5ba27f79a1cd5770ea247f8d46412a68a498dc5ac9f3
data_config.json39.3 KB32edcb108fc2516b920734a862ae0692bcae1c5d45d5f8d972cb0d53434a4c54
model.safetensors90.9 MB53aa51172d142c89d9012cce15ae4d6cc0ca6895895114379cacb4fab128d9db
modules.json349 B84e40c8e006c9b1d6c122e02cba9b02458120b5fb0c87b746c41e0207cf642cf
onnx/model.onnx90.4 MB6fd5d72fe4589f189f8ebc006442dbb529bb7ce38f8082112682524616046452
onnx/model_O1.onnx90.4 MB1391c6fc20b5530250bc15cbe1f47578ffeca55ab0551d335cc668b6299a88ec
onnx/model_O2.onnx90.3 MB1de3905029190b398c7d300b530e320cf4b5e7d3dfb9af1429ebd73fd9a16faf
onnx/model_O3.onnx90.3 MBa44f671e364dddbac31f203f07b91be6b0a35e51936e5ebfab65b6d9538b83ff
onnx/model_O4.onnx45.2 MB1667d7f3ba669048b13a96ee3a44456d5e42c8f44588ae8b603430e16160c485
onnx/model_qint8_arm64.onnx23.0 MB4278337fd0ff3c68bfb6291042cad8ab363e1d9fbc43dcb499fe91c871902474
onnx/model_qint8_avx512.onnx23.0 MB4278337fd0ff3c68bfb6291042cad8ab363e1d9fbc43dcb499fe91c871902474
onnx/model_qint8_avx512_vnni.onnx23.0 MB4278337fd0ff3c68bfb6291042cad8ab363e1d9fbc43dcb499fe91c871902474
onnx/model_quint8_avx2.onnx23.0 MBb941bf19f1f1283680f449fa6a7336bb5600bdcd5f84d10ddc5cd72218a0fd21
openvino/openvino_model.bin90.3 MB8b86cab4722e2aefab310cf96d4d5a9eb3b187f7d9670a082afc55c7fa0d392a
openvino/openvino_model.xml211 KBf87dd1482b2a745f8c699b81ddd9cbcad666a193be4693abcea44b7ac8c67c1e
openvino/openvino_model_qint8_quantized.bin22.9 MBc92ea4af3c6bc7b4a0f3b3d61b147c850f4dbdd7c9e7beee0c0c70dc12da289b
openvino/openvino_model_qint8_quantized.xml368 KBa19425e3f56f7736f752923f0a0b5a8d61c7878017f02e1fc9086615391105dd
pytorch_model.bin90.9 MBc3a85f238711653950f6a79ece63eb0ea93d76f6a6284be04019c53733baf256
rust_model.ot90.9 MB2d98d96d278348988f2744e6445b8bc16d921c3f6e17c667362f3cb353007aea
sentence_bert_config.json53 Bfc1993fde0a95c24ec6c022539d41cf6e2f7c9721e5415d6fb6897472a9cd4b7
special_tokens_map.json112 B303df45a03609e4ead04bc3dc1536d0ab19b5358db685b6f3da123d05ec200e3
tf_model.h591.0 MB24c06a7429b843d46e40c6b167122053921bf94dce2e5550ea5c07fabc597646
tokenizer.json466 KBbe50c3628f2bf5bb5e3a7f17b1f74611b2561a3a27eeab05e5aa30f411572037
tokenizer_config.json350 Bacb92769e8195aabd29b7b2137a9e6d6e25c476a4f15aa4355c233426c61576b
train_script.py13.2 KBf9b98b9d203d728cbf93ccdbae84131ab926541b56196f11d1385fed0b4d1a07
vocab.txt232 KB07eced375cec144d27c900241f3e339478dec958f92fddbc551f295c992038a3
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
0f79ca30c0 pinned now2026-11-15 03:34 UTC30 files · 977 MB

Use it

$ fw get unsloth/all-MiniLM-L6-v2
# manifest sha256 5919a5b7cd9c… · 977 MB · 30 files
$ fw verify ./all-MiniLM-L6-v2 unsloth/all-MiniLM-L6-v2
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/unsloth/all-MiniLM-L6-v2.json --dir ./all-MiniLM-L6-v2 $ python3 fw.py verify ./all-MiniLM-L6-v2 ./unsloth__all-MiniLM-L6-v2.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download unsloth/all-MiniLM-L6-v2 --revision 0f79ca30c044e92859f5852d3a29fb6e976741cd --local-dir ./all-MiniLM-L6-v2
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModel, AutoTokenizer tok = AutoTokenizer.from_pretrained("unsloth/all-MiniLM-L6-v2", revision="0f79ca30c044e92859f5852d3a29fb6e976741cd") model = AutoModel.from_pretrained("unsloth/all-MiniLM-L6-v2", revision="0f79ca30c044e92859f5852d3a29fb6e976741cd", device_map="auto")
sentence-transformersEmbed text with sentence-transformers.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from sentence_transformers import SentenceTransformer model = SentenceTransformer("unsloth/all-MiniLM-L6-v2", revision="0f79ca30c044e92859f5852d3a29fb6e976741cd") vectors = model.encode(["Hello"])

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
7dfc82496ec33f906b5b0d6750c1e2397da6530c74d1ae3568c55bc2739125e7
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: unsloth <huggingface.co/unsloth>Newsgroups: alt.freeweights.embedSubject: all-MiniLM-L6-v2Date: 2026-11-15Commit: 0f79ca3Signed: 2DC28CC7B26A283B ✓
Upstream
unsloth/all-MiniLM-L6-v2
Pinned commit
0f79ca30c044e92859f5852d3a29fb6e976741cd
Manifest
all-MiniLM-L6-v2.json · .minisig
Manifest sha256
5919a5b7cd9c391697f080c74182f2c43442cf4cde678e694d9746e9de483785
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 03:34 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/unsloth/all-MiniLM-L6-v2.json $ curl -O https://freeweights.allternit.com/manifests/unsloth/all-MiniLM-L6-v2.json.minisig $ minisign -Vm all-MiniLM-L6-v2.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

No related models in this catalog.Nothing here lists this model as its parent, and it names no parent.
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download unsloth/all-MiniLM-L6-v2
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. all-MiniLM-L6-v2.json. Provenance. Takedown history: none.
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-MiniLM-L6-v1
From: mlx-community <huggingface.co/mlx-community>Subject: all-MiniLM-L6-v2-4bit
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-mpnet-base-v1
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: allenai-specter
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: bert-base-nli-max-tokens
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: bert-base-nli-stsb-mean-tokens