Integration of TextEmbed with llama-index for embeddings.
Project description
TextEmbed - Embedding Inference Server
Maintained by Keval Dekivadiya, TextEmbed is licensed under the Apache-2.0 License.
TextEmbed is a high-throughput, low-latency REST API designed for serving vector embeddings. It supports a wide range of sentence-transformer models and frameworks, making it suitable for various applications in natural language processing.
Features
- High Throughput & Low Latency: Designed to handle a large number of requests efficiently.
- Flexible Model Support: Works with various sentence-transformer models.
- Scalable: Easily integrates into larger systems and scales with demand.
- Batch Processing: Supports batch processing for better and faster inference.
- OpenAI Compatible REST API Endpoint: Provides an OpenAI compatible REST API endpoint.
- Single Line Command Deployment: Deploy multiple models via a single command for efficient deployment.
- Support for Embedding Formats: Supports binary, float16, and float32 embeddings formats for faster retrieval.
Getting Started
Prerequisites
Ensure you have Python 3.10 or higher installed. You will also need to install the required dependencies.
Installation via PyPI
Install the required dependencies:
pip install -U textembed
Start the TextEmbed Server
Start the TextEmbed server with your desired models:
python -m textembed.server --models sentence-transformers/all-MiniLM-L12-v2 --workers 4 --api-key TextEmbed
Example Usage with llama-index
Here's a simple example to get you started with llama-index:
from llama_index.embeddings.textembed import TextEmbedEmbedding
# Initialize the TextEmbedEmbedding class
embed = TextEmbedEmbedding(
model_name="sentence-transformers/all-MiniLM-L12-v2",
base_url="http://0.0.0.0:8000/v1",
auth_token="TextEmbed",
)
# Get embeddings for a batch of texts
embeddings = embed.get_text_embedding_batch(
[
"It is raining cats and dogs here!",
"India has a diverse cultural heritage.",
]
)
print(embeddings)
For more information, please read the documentation.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file llama_index_embeddings_textembed-0.2.0.tar.gz
.
File metadata
- Download URL: llama_index_embeddings_textembed-0.2.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 478e5d264981593bccaf80ff367ff8828ea40d1d3f6cd7bf976129073581ba79 |
|
MD5 | adae78338bfb540447b900d488f8dd55 |
|
BLAKE2b-256 | 60f93d3c3b228880a5ce502575df65241e739e917eca6f553f6bda227ae4738b |
File details
Details for the file llama_index_embeddings_textembed-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_embeddings_textembed-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e2c2b327fff0aaca1ba1542b07b2fe2b95a9ee6682a1dbac759cdb9822f50ec |
|
MD5 | 9ab8e15af175f2ce757f52357a42865f |
|
BLAKE2b-256 | 67b136af2160c614bf7fb09318d1a3cabd2c3989cb82e81f286293bbc260ccb9 |