🚀 Check out our new v3-small model, trained for improved inference speed, lighter footprint, and better semantic matching for caching.
Redis semantic caching embedding model based on Alibaba-NLP/gte-modernbert-base
This is a sentence-transformers model finetuned from Alibaba-NLP/gte-modernbert-base on the Quora dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity for the purpose of semantic caching.
1from sentence_transformers import SentenceTransformer
23# Download from the 🤗 Hub4model = SentenceTransformer("redis/langcache-embed-v1")5# Run inference6sentences =[7'Will the value of Indian rupee increase after the ban of 500 and 1000 rupee notes?',8'What will be the implications of banning 500 and 1000 rupees currency notes on Indian economy?',9"Are Danish Sait's prank calls fake?",10]11embeddings = model.encode(sentences)12print(embeddings.shape)13# [3, 768]1415# Get the similarity scores for the embeddings16similarities = model.similarity(embeddings, embeddings)17print(similarities.shape)18
1@inproceedings{langcache-embed-v1,
2 title = "Advancing Semantic Caching for LLMs with Domain-Specific Embeddings and Synthetic Data",
3 author = "Gill, Cechmanek, Hutcherson, Rajamohan, Agarwal, Gulzar, Singh, Dion",
4 month = "04",
5 year = "2025",
6 url = "https://arxiv.org/abs/2504.02268",
7}
Sentence Transformers
bibtex
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}