Changesets · Branches · Tags · Compare
| Changeset | 8c51603cbd2a4fe0fb8b98c52db9e9cafca1464b58e194d1a84dc3f2d3884adb |
|---|---|
| Author | Rithik Kumar <46047011+rithikJha@users.noreply.github.com> · 2024-09-05 22:19 +05:30 |
| Committer | GitHub <noreply@github.com> · 2024-09-05 22:19 +05:30 |
| Parents | 71e843cc09dc |
3 files changed
modified docs/mkdocs.yml +7 −0
| @@ -26,6 +26,7 @@ | ||
| 26 | 26 | - content.code.copy |
| 27 | 27 | - content.tabs.link |
| 28 | 28 | - content.action.edit |
| 29 | + - content.tooltips | |
| 29 | 30 | - toc.follow |
| 30 | 31 | - navigation.top |
| 31 | 32 | - navigation.tabs |
| @@ -35,6 +36,7 @@ | ||
| 35 | 36 | - navigation.instant |
| 36 | 37 | icon: |
| 37 | 38 | repo: fontawesome/brands/github |
| 39 | + annotation: material/arrow-right-circle | |
| 38 | 40 | custom_dir: overrides |
| 39 | 41 | |
| 40 | 42 | plugins: |
| @@ -76,7 +78,12 @@ | ||
| 76 | 78 | - pymdownx.tabbed: |
| 77 | 79 | alternate_style: true |
| 78 | 80 | - md_in_html |
| 81 | + - abbr | |
| 79 | 82 | - attr_list |
| 83 | + - pymdownx.snippets | |
| 84 | + - pymdownx.emoji: | |
| 85 | + emoji_index: !!python/name:material.extensions.emoji.twemoji | |
| 86 | + emoji_generator: !!python/name:material.extensions.emoji.to_svg | |
| 80 | 87 | |
| 81 | 88 | nav: |
| 82 | 89 | - Home: |
modified docs/src/embeddings/available_embedding_models/text_embedding_functions/cohere_embedding.md +8 −7
| @@ -4,13 +4,14 @@ | ||
| 4 | 4 | You also need to set the `COHERE_API_KEY` environment variable to use the Cohere API. |
| 5 | 5 | |
| 6 | 6 | Supported models are: |
| 7 | -* embed-english-v3.0 | |
| 8 | -* embed-multilingual-v3.0 | |
| 9 | -* embed-english-light-v3.0 | |
| 10 | -* embed-multilingual-light-v3.0 | |
| 11 | -* embed-english-v2.0 | |
| 12 | -* embed-english-light-v2.0 | |
| 13 | -* embed-multilingual-v2.0 | |
| 7 | + | |
| 8 | +- embed-english-v3.0 | |
| 9 | +- embed-multilingual-v3.0 | |
| 10 | +- embed-english-light-v3.0 | |
| 11 | +- embed-multilingual-light-v3.0 | |
| 12 | +- embed-english-v2.0 | |
| 13 | +- embed-english-light-v2.0 | |
| 14 | +- embed-multilingual-v2.0 | |
| 14 | 15 | |
| 15 | 16 | |
| 16 | 17 | Supported parameters (to be passed in `create` method) are: |
modified docs/src/embeddings/default_embedding_functions.md +76 −22
| @@ -1,30 +1,84 @@ | ||
| 1 | -There are various embedding functions available out of the box with LanceDB to manage your embeddings implicitly. We're actively working on adding other popular embedding APIs and models. | |
| 1 | +# 📚 Available Embedding Models | |
| 2 | 2 | |
| 3 | -## Text embedding functions | |
| 4 | -Contains the text embedding functions registered by default. | |
| 3 | +There are various embedding functions available out of the box with LanceDB to manage your embeddings implicitly. We're actively working on adding other popular embedding APIs and models. 🚀 | |
| 5 | 4 | |
| 6 | -* Embedding functions have an inbuilt rate limit handler wrapper for source and query embedding function calls that retry with exponential backoff. | |
| 7 | -* Each `EmbeddingFunction` implementation automatically takes `max_retries` as an argument which has the default value of 7. | |
| 5 | +Before jumping on the list of available models, let's understand how to get an embedding model initialized and configured to use in our code: | |
| 8 | 6 | |
| 9 | -**Available Text Embeddings**: | |
| 7 | +!!! example "Example usage" | |
| 8 | + ```python | |
| 9 | + model = get_registry() | |
| 10 | + .get("openai") | |
| 11 | + .create(name="text-embedding-ada-002") | |
| 12 | + ``` | |
| 10 | 13 | |
| 11 | -- [Sentence Transformers](available_embedding_models/text_embedding_functions/sentence_transformers.md) | |
| 12 | -- [Huggingface Embedding Models](available_embedding_models/text_embedding_functions/huggingface_embedding.md) | |
| 13 | -- [Ollama Embeddings](available_embedding_models/text_embedding_functions/ollama_embedding.md) | |
| 14 | -- [OpenAI Embeddings](available_embedding_models/text_embedding_functions/openai_embedding.md) | |
| 15 | -- [Instructor Embeddings](available_embedding_models/text_embedding_functions/instructor_embedding.md) | |
| 16 | -- [Gemini Embeddings](available_embedding_models/text_embedding_functions/gemini_embedding.md) | |
| 17 | -- [Cohere Embeddings](available_embedding_models/text_embedding_functions/cohere_embedding.md) | |
| 18 | -- [Jina Embeddings](available_embedding_models/text_embedding_functions/jina_embedding.md) | |
| 19 | -- [AWS Bedrock Text Embedding Functions](available_embedding_models/text_embedding_functions/aws_bedrock_embedding.md) | |
| 20 | -- [IBM Watsonx.ai Embeddings](available_embedding_models/text_embedding_functions/ibm_watsonx_ai_embedding.md) | |
| 14 | +Now let's understand the above syntax: | |
| 15 | +```python | |
| 16 | +model = get_registry().get("model_id").create(...params) | |
| 17 | +``` | |
| 18 | +**This👆 line effectively creates a configured instance of an `embedding function` with `model` of choice that is ready for use.** | |
| 21 | 19 | |
| 20 | +- `get_registry()` : This function call returns an instance of a `EmbeddingFunctionRegistry` object. This registry manages the registration and retrieval of embedding functions. | |
| 22 | 21 | |
| 23 | -## Multi-modal embedding functions | |
| 24 | -Multi-modal embedding functions allow you to query your table using both images and text. | |
| 22 | +- `.get("model_id")` : This method call on the registry object and retrieves the **embedding models functions** associated with the `"model_id"` (1) . | |
| 23 | + { .annotate } | |
| 25 | 24 | |
| 26 | -**Available Multi-modal Embeddings** : | |
| 25 | + 1. Hover over the names in table below to find out the `model_id` of different embedding functions. | |
| 27 | 26 | |
| 28 | -- [OpenClip Embeddings](available_embedding_models/multimodal_embedding_functions/openclip_embedding.md) | |
| 29 | -- [Imagebind Embeddings](available_embedding_models/multimodal_embedding_functions/imagebind_embedding.md) | |
| 30 | -- [Jina Embeddings](available_embedding_models/multimodal_embedding_functions/jina_multimodal_embedding.md) | |
| No newline at the end of the file | ||
| 27 | +- `.create(...params)` : This method call is on the object returned by the `get` method. It instantiates an embedding model function using the **specified parameters**. | |
| 28 | + | |
| 29 | +??? question "What parameters does the `.create(...params)` method accepts?" | |
| 30 | + **Checkout the documentation of specific embedding models (links in the table below👇) to know what parameters it takes**. | |
| 31 | + | |
| 32 | +!!! tip "Moving on" | |
| 33 | + Now that we know how to get the **desired embedding model** and use it in our code, let's explore the comprehensive **list** of embedding models **supported by LanceDB**, in the tables below. | |
| 34 | + | |
| 35 | +## Text Embedding Functions 📝 | |
| 36 | +These functions are registered by default to handle text embeddings. | |
| 37 | + | |
| 38 | +- 🔄 **Embedding functions** have an inbuilt rate limit handler wrapper for source and query embedding function calls that retry with **exponential backoff**. | |
| 39 | + | |
| 40 | +- 🌕 Each `EmbeddingFunction` implementation automatically takes `max_retries` as an argument which has the default value of 7. | |
| 41 | + | |
| 42 | +🌟 **Available Text Embeddings** | |
| 43 | + | |
| 44 | +| **Embedding** :material-information-outline:{ title="Hover over the name to find out the model_id" } | **Description** | **Documentation** | | |
| 45 | +|-----------|-------------|---------------| | |
| 46 | +| [**Sentence Transformers**](available_embedding_models/text_embedding_functions/sentence_transformers.md "sentence-transformers") | 🧠 **SentenceTransformers** is a Python framework for state-of-the-art sentence, text, and image embeddings. | [<img src="https://raw.githubusercontent.com/lancedb/assets/main/docs/assets/logos/sbert_2.png" alt="Sentence Transformers Icon" width="90" height="35">](available_embedding_models/text_embedding_functions/sentence_transformers.md)| | |
| 47 | +| [**Huggingface Models**](available_embedding_models/text_embedding_functions/huggingface_embedding.md "huggingface") |🤗 We offer support for all **Huggingface** models. The default model is `colbert-ir/colbertv2.0`. | [<img src="https://raw.githubusercontent.com/lancedb/assets/main/docs/assets/logos/hugging_face.png" alt="Huggingface Icon" width="130" height="35">](available_embedding_models/text_embedding_functions/huggingface_embedding.md) | | |
| 48 | +| [**Ollama Embeddings**](available_embedding_models/text_embedding_functions/ollama_embedding.md "ollama") | 🔍 Generate embeddings via the **Ollama** python library. Ollama supports embedding models, making it possible to build RAG apps. | [<img src="https://raw.githubusercontent.com/lancedb/assets/main/docs/assets/logos/Ollama.png" alt="Ollama Icon" width="110" height="35">](available_embedding_models/text_embedding_functions/ollama_embedding.md)| | |
| 49 | +| [**OpenAI Embeddings**](available_embedding_models/text_embedding_functions/openai_embedding.md "openai")| 🔑 **OpenAI’s** text embeddings measure the relatedness of text strings. **LanceDB** supports state-of-the-art embeddings from OpenAI. | [<img src="https://raw.githubusercontent.com/lancedb/assets/main/docs/assets/logos/openai.png" alt="OpenAI Icon" width="100" height="35">](available_embedding_models/text_embedding_functions/openai_embedding.md)| | |
| 50 | +| [**Instructor Embeddings**](available_embedding_models/text_embedding_functions/instructor_embedding.md "instructor") | 📚 **Instructor**: An instruction-finetuned text embedding model that can generate text embeddings tailored to any task and domains by simply providing the task instruction, without any finetuning. | [<img src="https://raw.githubusercontent.com/lancedb/assets/main/docs/assets/logos/instructor_embedding.png" alt="Instructor Embedding Icon" width="140" height="35">](available_embedding_models/text_embedding_functions/instructor_embedding.md) | | |
| 51 | +| [**Gemini Embeddings**](available_embedding_models/text_embedding_functions/gemini_embedding.md "gemini-text") | 🌌 Google’s Gemini API generates state-of-the-art embeddings for words, phrases, and sentences. | [<img src="https://raw.githubusercontent.com/lancedb/assets/main/docs/assets/logos/gemini.png" alt="Gemini Icon" width="95" height="35">](available_embedding_models/text_embedding_functions/gemini_embedding.md) | | |
| 52 | +| [**Cohere Embeddings**](available_embedding_models/text_embedding_functions/cohere_embedding.md "cohere") | 💬 This will help you get started with **Cohere** embedding models using LanceDB. Using cohere API requires cohere package. Install it via `pip`. | [<img src="https://raw.githubusercontent.com/lancedb/assets/main/docs/assets/logos/cohere.png" alt="Cohere Icon" width="140" height="35">](available_embedding_models/text_embedding_functions/cohere_embedding.md) | | |
| 53 | +| [**Jina Embeddings**](available_embedding_models/text_embedding_functions/jina_embedding.md "jina") | 🔗 World-class embedding models to improve your search and RAG systems. You will need **jina api key**. | [<img src="https://raw.githubusercontent.com/lancedb/assets/main/docs/assets/logos/jina.png" alt="Jina Icon" width="90" height="35">](available_embedding_models/text_embedding_functions/jina_embedding.md) | | |
| 54 | +| [ **AWS Bedrock Functions**](available_embedding_models/text_embedding_functions/aws_bedrock_embedding.md "bedrock-text") | ☁️ AWS Bedrock supports multiple base models for generating text embeddings. You need to setup the AWS credentials to use this embedding function. | [<img src="https://raw.githubusercontent.com/lancedb/assets/main/docs/assets/logos/aws_bedrock.png" alt="AWS Bedrock Icon" width="120" height="35">](available_embedding_models/text_embedding_functions/aws_bedrock_embedding.md) | | |
| 55 | +| [**IBM Watsonx.ai**](available_embedding_models/text_embedding_functions/ibm_watsonx_ai_embedding.md "watsonx") | 💡 Generate text embeddings using IBM's watsonx.ai platform. **Note**: watsonx.ai library is an optional dependency. | [<img src="https://raw.githubusercontent.com/lancedb/assets/main/docs/assets/logos/watsonx.png" alt="Watsonx Icon" width="140" height="35">](available_embedding_models/text_embedding_functions/ibm_watsonx_ai_embedding.md) | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | +[st-key]: "sentence-transformers" | |
| 60 | +[hf-key]: "huggingface" | |
| 61 | +[ollama-key]: "ollama" | |
| 62 | +[openai-key]: "openai" | |
| 63 | +[instructor-key]: "instructor" | |
| 64 | +[gemini-key]: "gemini-text" | |
| 65 | +[cohere-key]: "cohere" | |
| 66 | +[jina-key]: "jina" | |
| 67 | +[aws-key]: "bedrock-text" | |
| 68 | +[watsonx-key]: "watsonx" | |
| 69 | + | |
| 70 | + | |
| 71 | +## Multi-modal Embedding Functions🖼️ | |
| 72 | + | |
| 73 | +Multi-modal embedding functions allow you to query your table using both images and text. 💬🖼️ | |
| 74 | + | |
| 75 | +🌐 **Available Multi-modal Embeddings** | |
| 76 | + | |
| 77 | +| Embedding :material-information-outline:{ title="Hover over the name to find out the model_id" } | Description | Documentation | | |
| 78 | +|-----------|-------------|---------------| | |
| 79 | +| [**OpenClip Embeddings**](available_embedding_models/multimodal_embedding_functions/openclip_embedding.md "open-clip") | 🎨 We support CLIP model embeddings using the open source alternative, **open-clip** which supports various customizations. | [<img src="https://raw.githubusercontent.com/lancedb/assets/main/docs/assets/logos/openclip_github.png" alt="openclip Icon" width="150" height="35">](available_embedding_models/multimodal_embedding_functions/openclip_embedding.md) | | |
| 80 | +| [**Imagebind Embeddings**](available_embedding_models/multimodal_embedding_functions/imagebind_embedding.md "imageind") | 🌌 We have support for **imagebind model embeddings**. You can download our version of the packaged model via - `pip install imagebind-packaged==0.1.2`. | [<img src="https://raw.githubusercontent.com/lancedb/assets/main/docs/assets/logos/imagebind_meta.png" alt="imagebind Icon" width="150" height="35">](available_embedding_models/multimodal_embedding_functions/imagebind_embedding.md)| | |
| 81 | +| [**Jina Multi-modal Embeddings**](available_embedding_models/multimodal_embedding_functions/jina_multimodal_embedding.md "jina") | 🔗 **Jina embeddings** can also be used to embed both **text** and **image** data, only some of the models support image data and you can check the detailed documentation. 👉 | [<img src="https://raw.githubusercontent.com/lancedb/assets/main/docs/assets/logos/jina.png" alt="jina Icon" width="90" height="35">](available_embedding_models/multimodal_embedding_functions/jina_multimodal_embedding.md) | | |
| 82 | + | |
| 83 | +!!! note | |
| 84 | + If you'd like to request support for additional **embedding functions**, please feel free to open an issue on our LanceDB [GitHub issue page](https://github.com/lancedb/lancedb/issues). | |
| No newline at the end of the file |