Skip to main content

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.

Release files for llama-index-embeddings-alephalpha 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-embeddings-alephalpha 0.6.0
File Size Uploaded
llama_index_embeddings_alephalpha-0.6.0.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-embeddings-alephalpha 0.6.0
File Interpreter ABI Platform
llama_index_embeddings_alephalpha-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.9 kB

Release files / llama_index_embeddings_alephalpha-0.6.0.tar.gz

Download URL llama_index_embeddings_alephalpha-0.6.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f91c76d522b770296631b200f171f8b9fad365e1d031f19d76d81e5a30b74aee
BLAKE2b-256 checksum
How to use checksums
625fade81a4e6041ca320c5524727500512d524694d8d745c1df0795c74963a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","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}

Release files / llama_index_embeddings_alephalpha-0.6.0-py3-none-any.whl

Download URL llama_index_embeddings_alephalpha-0.6.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4de67e91514b737ab1c42d3d2b05e9821f11e11e4689b85bad0ff2cd82560afa
BLAKE2b-256 checksum
How to use checksums
c9df7d26dd6262de83351ac4da2517d642cab57026213a459730c010189c38ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","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}

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page