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
, andquery
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
-
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 totrue
for normalized embeddings.
-
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
- Download URL: llama_index_embeddings_alephalpha-0.3.0.tar.gz
- Upload date:
- Size: 4.2 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 | ddf93c1fd37992282efc2623bb22b32c61e894eb095f3f7236910ba2ee10851b |
|
MD5 | 0fb54237704ad7557287e6bb10736753 |
|
BLAKE2b-256 | bb123b94a8bd70830444dfbc49784862f07ccfce3196512b80c9e5fa203db376 |
File details
Details for the file llama_index_embeddings_alephalpha-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_embeddings_alephalpha-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.5 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 | 12e6921676ae78a8b78980708e1349bba8bcdb99c32b9e503e4a2bd15c663c25 |
|
MD5 | 0da044ce3ff0b897d1485aeee26c5616 |
|
BLAKE2b-256 | 0c50fa66d598d48d117f29c668593e67a9e0ee813e111411726ad3c61b798233 |