Skip to main content

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.1.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_embeddings_textembed-0.1.0.tar.gz
Algorithm Hash digest
SHA256 130ad0395252f2dd19332139f7da61591e06f14d00359e9631dc8b91b213985c
MD5 9eb73f300208fd30ac4f5bd949ec3fc5
BLAKE2b-256 4c8d9385957cd04f47b5f46c37d5d38b620ecc2af855a5a5c14c0567bc1466c7

See more details on using hashes here.

File details

Details for the file llama_index_embeddings_textembed-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_embeddings_textembed-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be2461ba2ea50ba8533a93ebde735ec0bceaf57358e14fe56e61ab6f2500bc18
MD5 81978e22a6db38dd529356ffd908337c
BLAKE2b-256 6a4f0439564d8695a30c8f248b64a040b5dbfc866a770d2d62b2cfb5b7d8ce42

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page