bge small en v1.5

Providermichaelfeil
Categoryfeature-extraction
Licensemit
Downloads2.3M
Stars0

Overview

The bge-small-en-v1.5 is a lightweight embedding model optimized for efficiency and retrieval performance. Designed for developers building RAG (Retrieval-Augmented Generation) pipelines, it transforms text into dense vectors that maintain high semantic similarity accuracy without the computational overhead of larger models. It is particularly effective for semantic search, clustering, and document ranking where low latency and small memory footprints are critical. Compared to larger BERT-based encoders, it offers a superior balance of speed and precision, making it ideal for deployment in edge environments or high-throughput production APIs. Integration is straightforward via standard sentence-transformer libraries, allowing for rapid deployment into existing vector databases.

Highlights

  • Optimized for low-latency semantic search and RAG pipelines
  • Small memory footprint ideal for edge deployment
  • High retrieval accuracy relative to its parameter size
  • Easy integration via standard sentence-transformer frameworks
  • Permissive MIT license for flexible commercial use

Usage

Install
# Install Hugging Face transformers
pip install transformers torch
SDK Usage
# Load model with transformers
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("michaelfeil/bge-small-en-v1.5")
tokenizer = AutoTokenizer.from_pretrained("michaelfeil/bge-small-en-v1.5")

Hugging Face Download

We recommend downloading the model via the Hugging Face CLI or Hub SDK.

Guidance:Before downloading, install huggingface_hub with:

Guidance
pip install -U huggingface_hub

CLI Download

Download the full repository

Download the full repository
huggingface-cli download michaelfeil/bge-small-en-v1.5

Download a single file to a local folder (e.g. config.json into ./dir)

Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download michaelfeil/bge-small-en-v1.5 config.json --local-dir ./dir

See the official docs for more CLI options

SDK Download

SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('michaelfeil/bge-small-en-v1.5')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://huggingface.co/michaelfeil/bge-small-en-v1.5

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/michaelfeil/bge-small-en-v1.5

Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.

PyTorch / Transformers Usage

Install Transformers

Install Transformers
pip install -U transformers torch

Load the model and run inference

Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('michaelfeil/bge-small-en-v1.5')
tokenizer = AutoTokenizer.from_pretrained('michaelfeil/bge-small-en-v1.5')

Full Documentation

来源: HuggingFace

---
tags:

  • sentence-transformers

  • feature-extraction

  • sentence-similarity

  • transformers

license: mit
language:
  • en

---

<h1 align="center">Infinity Embedding Model</h1>

This is the stable default model for infinity.

bash
pip install infinity_emb[all]

More details about the infinity inference project please refer to the Github: Infinity.

Usage for Embedding Model via infinity in Python

To deploy files with the infinity_emb pip package.
Recommended is device="cuda", engine="torch" with flash attention on gpu, and device="cpu", engine="optimum" for onnx inference.

python
import asyncio
from infinity_emb import AsyncEmbeddingEngine, EngineArgs

sentences = ["Embed this is sentence via Infinity.", "Paris is in France."]
engine = AsyncEmbeddingEngine.from_args(
EngineArgs(
model_name_or_path = "michaelfeil/bge-small-en-v1.5",
device="cuda",
# or device="cpu"
engine="torch",
# or engine="optimum"
compile=True # enable torch.compile
))

async def main():
async with engine:
embeddings, usage = await engine.embed(sentences=sentences)
asyncio.run(main())

CLI interface

The same args

bash
pip install infinity_emb
infinity_emb --model-name-or-path michaelfeil/bge-small-en-v1.5 --port 7997

Contact

If you have any question or suggestion related to this project, feel free to open an issue or pull request. You also can email Michael Feil (infinity at michaelfeil.eu).

Citation

If you find this repository useful, please consider giving a star :star: and citation

code
@software{Feil_Infinity_2023,
author = {Feil, Michael},
month = oct,
title = {{Infinity - To Embeddings and Beyond}},
url = {https://github.com/michaelfeil/infinity},
year = {2023}
}

License

Infinity is licensed under the MIT License.
Join our Telegram