llama-index-embeddings-alephalpha


Namellama-index-embeddings-alephalpha JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
Summaryllama-index embeddings alephalpha integration
upload_time2024-09-13 19:51:17
maintainerNone
docs_urlNone
authorYour Name
requires_python<4.0,>=3.8.1
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```bash
pip install llama-index-embeddings-alephalpha
```

## Usage

```python
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](../../../docs/examples/embeddings/alephalpha.ipynb) 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](https://docs.aleph-alpha.com/api/semantic-embed/).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-embeddings-alephalpha",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": null,
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/69/87/5f02a1f35cce1862a29dbda9d5ff97167c576634439a4a34b06cb01e64d4/llama_index_embeddings_alephalpha-0.2.1.tar.gz",
    "platform": null,
    "description": "# LlamaIndex Embeddings Integration: Aleph Alpha\n\nThis 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.\n\n## Features\n\n- **Semantic Embeddings:** Generate embeddings for text prompts using Aleph Alpha models.\n- **Model Selection:** Utilize the latest version of specified models for generating embeddings.\n- **Representation Types:** Choose from `symmetric`, `document`, and `query` embeddings based on your use case.\n- **Compression:** Option to compress embeddings to 128 dimensions for faster comparison.\n- **Normalization:** Retrieve normalized embeddings to optimize cosine similarity calculations.\n\n## Installation\n\n```bash\npip install llama-index-embeddings-alephalpha\n```\n\n## Usage\n\n```python\nfrom llama_index.embeddings.alephalpha import AlephAlphaEmbedding\n```\n\n1. **Request Parameters:**\n\n   - `model`: Model name (e.g., `luminous-base`). The latest model version is used.\n   - `representation`: Type of embedding (`symmetric`, `document`, `query`).\n   - `prompt`: Text or multimodal prompt to embed. Supports text strings or an array of multimodal items.\n   - `compress_to_size`: Optional compression to 128 dimensions.\n   - `normalize`: Set to `true` for normalized embeddings.\n\n2. **Advanced Parameters:**\n   - `hosting`: Datacenter processing option (`aleph-alpha` for maximal data privacy).\n   - `contextual_control_threshold`, `control_log_additive`: Control attention parameters for advanced use cases.\n\n## Response Structure\n\n- `model_version`: Model name and version used for inference.\n- `embedding`: List of floats representing the generated embedding.\n- `num_tokens_prompt_total`: Total number of tokens in the input prompt.\n\n## Example\n\nSee the [example notebook](../../../docs/examples/embeddings/alephalpha.ipynb) for a detailed walkthrough of using Aleph Alpha embeddings with LlamaIndex.\n\n## API Documentation\n\nFor more detailed API documentation and available models, visit [Aleph Alpha's API Docs](https://docs.aleph-alpha.com/api/semantic-embed/).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index embeddings alephalpha integration",
    "version": "0.2.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ed9991b21d58afea58ad791fd38726589cc4b3c60d69a5fdfd113a6c347e2239",
                "md5": "c3a9b199a5ddbd4ef2a92165193ffac8",
                "sha256": "28864d64eeeba4dbe75c5e7f56a758c70b1f49e8253a140a586c7ad9446b6274"
            },
            "downloads": -1,
            "filename": "llama_index_embeddings_alephalpha-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c3a9b199a5ddbd4ef2a92165193ffac8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8.1",
            "size": 4482,
            "upload_time": "2024-09-13T19:51:16",
            "upload_time_iso_8601": "2024-09-13T19:51:16.407789Z",
            "url": "https://files.pythonhosted.org/packages/ed/99/91b21d58afea58ad791fd38726589cc4b3c60d69a5fdfd113a6c347e2239/llama_index_embeddings_alephalpha-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "69875f02a1f35cce1862a29dbda9d5ff97167c576634439a4a34b06cb01e64d4",
                "md5": "5fe9256818ea823f910af24816502a73",
                "sha256": "ed83c3fa1b7bf8462f0b14b176b41fc711e42e8842cf3636d5d50786c182daa9"
            },
            "downloads": -1,
            "filename": "llama_index_embeddings_alephalpha-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "5fe9256818ea823f910af24816502a73",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8.1",
            "size": 4109,
            "upload_time": "2024-09-13T19:51:17",
            "upload_time_iso_8601": "2024-09-13T19:51:17.653886Z",
            "url": "https://files.pythonhosted.org/packages/69/87/5f02a1f35cce1862a29dbda9d5ff97167c576634439a4a34b06cb01e64d4/llama_index_embeddings_alephalpha-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-13 19:51:17",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-embeddings-alephalpha"
}
        
Elapsed time: 1.28037s