GGUF files of harims95/hobbylm-embed-140m (revision ff263c85) for
llama.cpp: a dense text-embedding model built on a sparse mixture-of-experts
architecture, 140M total / 36M active parameters, 512-d output.
| File | Type | Size |
|---|---|---|
hobbylm-embed-140m-f16.gguf |
F16 | 335 MB |
hobbylm-embed-140m-q8_0.gguf |
Q8_0 | 179 MB |
hobbylm_llamacpp_embed.py |
helper script (MIT, Python standard library only) | 4 KB |
The model runs on llama.cpp's bailingmoe2 graph (tested with release v1.0.0), with non-causal attention set in the
file.
The model averages its token vectors without the end-of-text token that the tokenizer appends. llama.cpp's built-in
mean pooling includes that token, so use --pooling none and pool on the client. The helper does this:
python3 hobbylm_llamacpp_embed.py --bin ./llama-embedding --model hobbylm-embed-140m-q8_0.gguf --mode query queries.txt
python3 hobbylm_llamacpp_embed.py --bin ./llama-embedding --model hobbylm-embed-140m-q8_0.gguf --mode passage passages.txt
--mode query / --mode passage for retrieval queries / documents; --mode none for similarity, classification and
clustering.model.max_seq_length = 2048. llama.cpp does not truncate, so shorten longer texts yourself.Full build, download and embed steps, each with its real output: RUN-LOCALLY.md.
Agreement with the PyTorch model (sentence-transformers, same revision) on 100 texts, each without a prompt and with
query: / passage: (300 inputs):
| File | Mean cosine | Min cosine |
|---|---|---|
| F16 | 0.999974 | 0.998881 |
| Q8_0 | 0.999435 | 0.995988 |
ollama pull hariharanms95/hobbylm-embed-140m (Q8_0, num_ctx 512). Ollama's pooling includes the final end-of-text token, so its vectors are close to but not identical with the reference model: on normal sentences cosine is about 0.99 and task scores stay within ±0.4, but very short texts (one or two words) differ most (cosine about 0.92-0.97). Don't mix Ollama vectors with exact vectors in one index; for exact embeddings use Sentence Transformers or the llama.cpp helper.
LM Studio and llama.cpp's own --pooling mean: not supported yet: their mean pooling includes the final end-of-text
token, which this model excludes.
Model weights: Apache-2.0. Helper script: MIT.
Hariharan M. S., Prabhurajhan R.
harims95/hobbylm-embed-140m