Skip to main content

llama-index embeddings alephalpha integration

Project description

LlamaIndex Embeddings Integration: Aleph Alpha

This README provides an overview of integrating Aleph Alpha's semantic embeddings with LlamaIndex. Aleph Alpha's API enables the generation of semantic embeddings from text, which can be used for downstream tasks such as semantic similarity and models like classifiers.

Features

  • Semantic Embeddings: Generate embeddings for text prompts using Aleph Alpha models.
  • Model Selection: Utilize the latest version of specified models for generating embeddings.
  • Representation Types: Choose from symmetric, document, and query embeddings based on your use case.
  • Compression: Option to compress embeddings to 128 dimensions for faster comparison.
  • Normalization: Retrieve normalized embeddings to optimize cosine similarity calculations.

Installation

pip install llama-index-embeddings-alephalpha

Usage

from llama_index.embeddings.alephalpha import AlephAlphaEmbedding
  1. Request Parameters:

    • model: Model name (e.g., luminous-base). The latest model version is used.
    • representation: Type of embedding (symmetric, document, query).
    • prompt: Text or multimodal prompt to embed. Supports text strings or an array of multimodal items.
    • compress_to_size: Optional compression to 128 dimensions.
    • normalize: Set to true for normalized embeddings.
  2. Advanced Parameters:

    • hosting: Datacenter processing option (aleph-alpha for maximal data privacy).
    • contextual_control_threshold, control_log_additive: Control attention parameters for advanced use cases.

Response Structure

  • model_version: Model name and version used for inference.
  • embedding: List of floats representing the generated embedding.
  • num_tokens_prompt_total: Total number of tokens in the input prompt.

Example

See the example notebook for a detailed walkthrough of using Aleph Alpha embeddings with LlamaIndex.

API Documentation

For more detailed API documentation and available models, visit Aleph Alpha's API Docs.

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_alephalpha-0.3.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_embeddings_alephalpha-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ddf93c1fd37992282efc2623bb22b32c61e894eb095f3f7236910ba2ee10851b
MD5 0fb54237704ad7557287e6bb10736753
BLAKE2b-256 bb123b94a8bd70830444dfbc49784862f07ccfce3196512b80c9e5fa203db376

See more details on using hashes here.

File details

Details for the file llama_index_embeddings_alephalpha-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_embeddings_alephalpha-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12e6921676ae78a8b78980708e1349bba8bcdb99c32b9e503e4a2bd15c663c25
MD5 0da044ce3ff0b897d1485aeee26c5616
BLAKE2b-256 0c50fa66d598d48d117f29c668593e67a9e0ee813e111411726ad3c61b798233

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