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

llama_index_embeddings_alephalpha-0.5.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_embeddings_alephalpha-0.5.0.tar.gz.

File metadata

  • Download URL: llama_index_embeddings_alephalpha-0.5.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_embeddings_alephalpha-0.5.0.tar.gz
Algorithm Hash digest
SHA256 add0c7525cfbc1333bf1d89cec24954ff0f9598361f3e930aa84f1bfd8fe41c7
MD5 b182bc09734cba103704a92b95236d32
BLAKE2b-256 b02488a3b5c20c1fada7b2e84044daca6c11aacf2a3cabf60a5123e9b759f846

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llama_index_embeddings_alephalpha-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_embeddings_alephalpha-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f919a751029298e1d9171b8974ec52cdab9e8f44c0b63e06cc87bc4ea51d463
MD5 1af3cadf4b4db863ae750c13ecdcae64
BLAKE2b-256 6a3022ecdd689d4d4d8d30d00258850ca64def96a14fb6423f20fc9b5ae07970

See more details on using hashes here.

Supported by

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