anything-llm icon indicating copy to clipboard operation
anything-llm copied to clipboard

[FEAT]: Multilingual Native Embedder

Open timothycarambat opened this issue 2 years ago • 10 comments

What would you like to see?

Currently, the built-in embedder uses the ONNX all-MiniLM-L6-v2 embedder, which does okay for most use cases and is much smaller to download.

There should be support for the larger multilingual-e5-large model (ONNX HERE) for multi-lingual support.

This should not be the default, but it should be something the user can opt to select. They may have to wait for the download to completely download for the embedder change to be saved as we cannot afford the latency to download the model at runtime.

timothycarambat avatar Jan 30 '24 17:01 timothycarambat

Also, we don't want to pre-pack the docker image with models people may not use, so we will not be doing that in the future to keep the docker image portable enough for a reasonable size.

timothycarambat avatar Jan 30 '24 17:01 timothycarambat

I would also like the option to add another local embeddings model, like for example BGE-M3. I tried adding it in the models-folder myself, but couldn't get it to work yet, unfortunately. Hopefully this feature can be added on the short term, so that we don't need to really on OpenAI's models for multilingual documents. Thanks in advance! :-)

vlbosch avatar Mar 05 '24 17:03 vlbosch

bge-m3 would be nice

oscar-7000 avatar Mar 23 '24 18:03 oscar-7000

This would be a very welcome feature. i see in this thread : https://github.com/Mintplex-Labs/anything-llm/issues/645 someone tried multilingual-e5-large and it seems to help allot.

sweco-nlmdek avatar Apr 29 '24 13:04 sweco-nlmdek

Is there a manual way to use a multilingual embedding model in the mean time ? or one from sentence-transformers?

Herz3h avatar Jan 29 '25 10:01 Herz3h

@Herz3h, yes, we support Ollama or LMStudio for embedder endpoints, where you can use any embedder you like to fit your use case.

timothycarambat avatar Jan 29 '25 18:01 timothycarambat

Thanks, however neither of ollama/lmstudio seem to support sentence-transformers, is there a way to still use them? since some of them rank very high in https://huggingface.co/spaces/mteb/leaderboard

Herz3h avatar Jan 30 '25 10:01 Herz3h

Ollama and LMstudio both support embedders - you need to use the GGUF version since they cannot run tensorflow or pytorch models.

Ollamas select is certainly more limited since it relies on their registry, but you can import HF models directly into Ollama. Example: https://huggingface.co/models?library=gguf&sort=downloads&search=embedding Click on any of those and you will see the ability to pull it in Ollama or LMStudio.

Both of which support /embedding - so it works.

Image

timothycarambat avatar Jan 30 '25 18:01 timothycarambat

Oh didn't know there was an option from huggingface to pull anymodel in ollama. Thank you very much !

Herz3h avatar Jan 31 '25 07:01 Herz3h

I opened another request for this which was closed since this one exists. Yes, a multilingual embedder would be fantastic, I love arctic snowflake l v2 which ranks fantastic but this also requires sentence transformers to unfold it's full potential. So I created my own dockerized sentence transformers embedder but cannot use it with anythingllm (which i really love!) since it doesn't seem to support this as an external embedder. Maybe someone could point me to how I can integrate this? Localai or ollama are not an option

JosefAschauer avatar Apr 17 '25 21:04 JosefAschauer