πŸ“‹ Model Description


base_model: BAAI/bge-small-en-v1.5 inference: false language:
  • en
license: mit model_creator: BAAI model_name: bge-small-en-v1.5 model_type: bert quantized_by: ChristianAzinn library_name: sentence-transformers pipeline_tag: feature-extraction tags: - sentence-transformers - feature-extraction - sentence-similarity - transformers - mteb - bert - gguf

bge-small-en-v1.5-gguf

Model creator: BAAI

Original model: bge-small-en-v1.5

Original Description

More details please refer to our Github: FlagEmbedding.

If you are looking for a model that supports more languages, longer texts, and other retrieval methods, you can try using bge-m3.

Description

This repo contains GGUF format files for the bge-small-en-v1.5 embedding model.

These files were converted and quantized with llama.cpp PR 5500, commit 34aa045de, on a consumer RTX 4090.

This model supports up to 512 tokens of context.

Compatibility

These files are compatible with llama.cpp as of commit 4524290e8, as well as LM Studio as of version 0.2.19.

Meta-information

Explanation of quantisation methods

Click to see details The methods available are:
  • GGMLTYPEQ2K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
  • GGMLTYPEQ3K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
  • GGMLTYPEQ4K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
  • GGMLTYPEQ5K - "type-1" 5-bit quantization. Same super-block structure as GGMLTYPEQ4K resulting in 5.5 bpw
  • GGMLTYPEQ6K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw
Refer to the Provided Files table below to see what files use which methods, and how.

Provided Files

NameQuant methodBitsSizeMax RAM requiredUse case
NameQuant methodBitsSizeUse case
bge-small-en-v1.5.Q2K.ggufQ2K225.3 MBsmallest, significant quality loss - not recommended for most purposes
bge-small-en-v1.5.Q3KS.ggufQ3K_S325.3 MBvery small, high quality loss
bge-small-en-v1.5.Q3KM.ggufQ3K_M326.7 MBvery small, high quality loss
bge-small-en-v1.5.Q3KL.ggufQ3K_L327.7 MBsmall, substantial quality loss
bge-small-en-v1.5.Q40.ggufQ40426.2 MBlegacy; small, very high quality loss - prefer using Q3KM
bge-small-en-v1.5.Q4KS.ggufQ4K_S428.2 MBsmall, greater quality loss
bge-small-en-v1.5.Q4KM.ggufQ4K_M429.2 MBmedium, balanced quality - recommended
bge-small-en-v1.5.Q50.ggufQ50528.8 MBlegacy; medium, balanced quality - prefer using Q4KM
bge-small-en-v1.5.Q5KS.ggufQ5K_S529.7 MBlarge, low quality loss - recommended
bge-small-en-v1.5.Q5KM.ggufQ5K_M530.5 MBlarge, very low quality loss - recommended
bge-small-en-v1.5.Q6K.ggufQ6K635.1 MBvery large, extremely low quality loss
bge-small-en-v1.5.Q80.ggufQ80836.8 MBvery large, extremely low quality loss - recommended
bge-small-en-v1.5.Q8_0.ggufFP161667.3 MBenormous, pretty much the original model - not recommended
bge-small-en-v1.5.Q8_0.ggufFP3232134 MBenormous, pretty much the original model - not recommended

Examples

Example Usage with llama.cpp

To compute a single embedding, build llama.cpp and run:

./embedding -ngl 99 -m [filepath-to-gguf].gguf -p 'search_query: What is TSNE?'

You can also submit a batch of texts to embed, as long as the total number of tokens does not exceed the context length. Only the first three embeddings are shown by the embedding example.

texts.txt:

search_query: What is TSNE?
search_query: Who is Laurens Van der Maaten?

Compute multiple embeddings:

./embedding -ngl 99 -m [filepath-to-gguf].gguf -f texts.txt

Example Usage with LM Studio

Download the 0.2.19 beta build from here: Windows MacOS Linux

Once installed, open the app. The home should look like this:

!image/png

Search for either "ChristianAzinn" in the main search bar or go to the "Search" tab on the left menu and search the name there.

!image/png

Select your model from those that appear (this example uses bge-small-en-v1.5-gguf) and select which quantization you want to download. Since this model is pretty small, I recommend Q8_0, if not f16/32. Generally, the lower you go in the list (or the bigger the number gets), the larger the file and the better the performance.

!image/png

You will see a green checkmark and the word "Downloaded" once the model has successfully downloaded, which can take some time depending on your network speeds.

!image/png

Once this model is finished downloading, navigate to the "Local Server" tab on the left menu and open the loader for text embedding models. This loader does not appear before version 0.2.19, so ensure you downloaded the correct version.

!image/png

Select the model you just downloaded from the dropdown that appears to load it. You may need to play with configuratios in the right-side menu, such as GPU offload if it doesn't fit entirely into VRAM.

!image/png

All that's left to do is to hit the "Start Server" button:

!image/png

And if you see text like that shown below in the console, you're good to go! You can use this as a drop-in replacement for the OpenAI embeddings API in any application that requires it, or you can query the endpoint directly to test it out.

!image/png

Example curl request to the API endpoint:

curl http://localhost:1234/v1/embeddings \
-H "Content-Type: application/json" \
-d '{
"input": "Your text string goes here",
"model": "model-identifier-here"
}'

For more information, see the LM Studio text embedding documentation.

Acknowledgements

Thanks to the LM Studio team and everyone else working on open-source AI.

This README is inspired by that of nomic-ai-embed-text-v1.5-gguf, another excellent embedding model, and those of the legendary TheBloke.

πŸ“‚ GGUF File List

πŸ“ Filename πŸ“¦ Size ⚑ Download
bge-small-en-v1.5.Q2_K.gguf
LFS Q2
24.08 MB Download
bge-small-en-v1.5.Q3_K_L.gguf
LFS Q3
26.45 MB Download
bge-small-en-v1.5.Q3_K_M.gguf
LFS Q3
25.49 MB Download
bge-small-en-v1.5.Q3_K_S.gguf
LFS Q3
24.08 MB Download
bge-small-en-v1.5.Q4_0.gguf
Recommended LFS Q4
24.98 MB Download
bge-small-en-v1.5.Q4_K_M.gguf
LFS Q4
27.85 MB Download
bge-small-en-v1.5.Q4_K_S.gguf
LFS Q4
26.91 MB Download
bge-small-en-v1.5.Q5_0.gguf
LFS Q5
27.51 MB Download
bge-small-en-v1.5.Q5_K_M.gguf
LFS Q5
29.06 MB Download
bge-small-en-v1.5.Q5_K_S.gguf
LFS Q5
28.35 MB Download
bge-small-en-v1.5.Q6_K.gguf
LFS Q6
33.47 MB Download
bge-small-en-v1.5.Q8_0.gguf
LFS Q8
35.1 MB Download
bge-small-en-v1.5_fp16.gguf
LFS FP16
64.19 MB Download
bge-small-en-v1.5_fp32.gguf
LFS
127.42 MB Download