Skip to main content

Embed anything at lightning speed

Project description

Downloads Open in Colab license package discord

Supercharge your embedding pipeline with minimalist and lightening fast framework built in rust 🦀
Explore the docs »

View Demo · Examples · Request Feature . Search in Audio Space

EmbedAnything is a minimalist yet highly performant, lightweight, lightening fast, multisource, multimodal and local embedding pipeline, built in rust. Whether you're working with text, images, audio, PDFs, websites, or other media, EmbedAnything simplifies the process of generating embeddings from various sources and storing them in a vector database.

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. How to add custom model and chunk size

🚀 Key Features

  • Local Embedding : Works with local embedding models like BERT and JINA
  • Cloud Embedding Models:: Supports OpenAI. Mistral and Cohere Support coming soon.
  • MultiModality : Works with text sources like PDFs, txt, md, Images JPG and Audio, .WAV
  • Rust : All the file processing is done in rust for speed and efficiency
  • Candle : We have taken care of hardware acceleration as well, with Candle.
  • Python Interface: Packaged as a Python library for seamless integration into your existing projects.
  • Scalable: Store embeddings in a vector database for easy retrieval and scalability.

🦀 Why Embed Anything

➡️Faster execution.
➡️Memory Management: Rust enforces memory management simultaneously, preventing memory leaks and crashes that can plague other languages
➡️True multithreading
➡️Running language models or embedding models locally and efficiently
➡️Candle allows inferences on CUDA-enabled GPUs right out of the box.
➡️Decrease the memory usage of EmbedAnything.

⭐ Supported Models

We support a range of models, that can be supported by Candle, We have given a set of tested models but if you have specific usecase do mention it in the issue.

How to add custom model and Chunk Size.

jina_config = JinaConfig(
    model_id="Custom link given below", revision="main", chunk_size=100
)
embed_config = EmbedConfig(jina=jina_config)
Model Custom link
Jina jinaai/jina-embeddings-v2-base-en
jinaai/jina-embeddings-v2-small-en
Bert sentence-transformers/all-MiniLM-L6-v2
sentence-transformers/all-MiniLM-L12-v2
sentence-transformers/paraphrase-MiniLM-L6-v2
Clip openai/clip-vit-base-patch32
Whisper Most OpenAI Whisper from huggingface supported.

🧑‍🚀 Getting Started

💚 Installation

pip install embed-anything

Usage

To use local embedding: we support Bert and Jina

import embed_anything
data = embed_anything.embed_file("file_path.pdf", embeder= "Bert")
embeddings = np.array([data.embedding for data in data])

For multimodal embedding: we support CLIP

Requirements Directory with pictures you want to search for example we have test_files with images of cat, dogs etc

import embed_anything
data = embed_anything.embed_directory("directory_path", embeder= "Clip")
embeddings = np.array([data.embedding for data in data])

query = ["photo of a dog"]
query_embedding = np.array(embed_anything.embed_query(query, embeder= "Clip")[0].embedding)
similarities = np.dot(embeddings, query_embedding)
max_index = np.argmax(similarities)
Image.open(data[max_index].text).show()

Audio Embedding using Whisper

requirements: Audio .wav files.

import embed_anything
from embed_anything import JinaConfig, EmbedConfig, AudioDecoderConfig
import time

start_time = time.time()

# choose any whisper or distilwhisper model from https://huggingface.co/distil-whisper or https://huggingface.co/collections/openai/whisper-release-6501bba2cf999715fd953013
audio_decoder_config = AudioDecoderConfig(
    decoder_model_id="openai/whisper-tiny.en",
    decoder_revision="main",
    model_type="tiny-en",
    quantized=False,
)
jina_config = JinaConfig(
    model_id="jinaai/jina-embeddings-v2-small-en", revision="main", chunk_size=100
)

config = EmbedConfig(jina=jina_config, audio_decoder=audio_decoder_config)
data = embed_anything.embed_file(
    "test_files/audio/samples_hp0.wav", embeder="Audio", config=config
)
print(data[0].metadata)
end_time = time.time()
print("Time taken: ", end_time - start_time)

🚧 Contributing to EmbedAnything

First of all, thank you for taking the time to contribute to this project. We truly appreciate your contributions, whether it's bug reports, feature suggestions, or pull requests. Your time and effort are highly valued in this project. 🚀

This document provides guidelines and best practices to help you to contribute effectively. These are meant to serve as guidelines, not strict rules. We encourage you to use your best judgment and feel comfortable proposing changes to this document through a pull request.

  • Roadmap
  • Quick Start
  • Guidelines
  • RoadMap

    One of the aims of EmbedAnything is to allow AI engineers to easily use state of the art embedding models on typical files and documents. A lot has already been accomplished here and these are the formats that we support right now and a few more have to be done.
    ✅ Markdown, PDFs, and Website
    ✅ WAV File
    ✅ JPG, PNG, webp
    ✅Add whisper for audio embeddings
    ✅Custom model upload, anything that is available in candle
    ✅Custom chunk size
    ✅Pinecone Adapter, to directly save it on it.
    ✅Zero-shot application

    Yet to do be done
    ☑️Vector Database: Add functionalities to integrate with any Vector Database
    ☑️Graph embedding -- build deepwalks embeddings depth first and word to vec

    ✔️ Code of Conduct:

    Please read our [Code of Conduct] to understand the expectations we have for all contributors participating in this project. By participating, you agree to abide by our Code of Conduct.

    Quick Start

    You can quickly get started with contributing by searching for issues with the labels "Good First Issue" or "Help Needed" in the [Issues Section]. If you think you can contribute, comment on the issue and we will assign it to you.

    To set up your development environment, please follow the steps mentioned below :

    1. Fork the repository from dev, We don't allow direct contribution to main

    Contributing Guidelines

    🔍 Reporting Bugs

    1. Title describing the issue clearly and concisely with relevant labels
    2. Provide a detailed description of the problem and the necessary steps to reproduce the issue.
    3. Include any relevant logs, screenshots, or other helpful information supporting the issue.

    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

    embed_anything-0.2.1.tar.gz (868.6 kB view details)

    Uploaded Source

    Built Distributions

    embed_anything-0.2.1-cp312-none-win_amd64.whl (10.9 MB view details)

    Uploaded CPython 3.12 Windows x86-64

    embed_anything-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl (14.3 MB view details)

    Uploaded CPython 3.12 manylinux: glibc 2.34+ x86-64

    embed_anything-0.2.1-cp312-cp312-macosx_11_0_arm64.whl (7.3 MB view details)

    Uploaded CPython 3.12 macOS 11.0+ ARM64

    embed_anything-0.2.1-cp312-cp312-macosx_10_12_x86_64.whl (7.5 MB view details)

    Uploaded CPython 3.12 macOS 10.12+ x86-64

    embed_anything-0.2.1-cp311-none-win_amd64.whl (10.9 MB view details)

    Uploaded CPython 3.11 Windows x86-64

    embed_anything-0.2.1-cp311-cp311-manylinux_2_34_x86_64.whl (14.3 MB view details)

    Uploaded CPython 3.11 manylinux: glibc 2.34+ x86-64

    embed_anything-0.2.1-cp311-cp311-macosx_11_0_arm64.whl (7.3 MB view details)

    Uploaded CPython 3.11 macOS 11.0+ ARM64

    embed_anything-0.2.1-cp311-cp311-macosx_10_12_x86_64.whl (7.5 MB view details)

    Uploaded CPython 3.11 macOS 10.12+ x86-64

    embed_anything-0.2.1-cp310-none-win_amd64.whl (10.9 MB view details)

    Uploaded CPython 3.10 Windows x86-64

    embed_anything-0.2.1-cp310-cp310-manylinux_2_34_x86_64.whl (14.3 MB view details)

    Uploaded CPython 3.10 manylinux: glibc 2.34+ x86-64

    embed_anything-0.2.1-cp310-cp310-macosx_11_0_arm64.whl (7.3 MB view details)

    Uploaded CPython 3.10 macOS 11.0+ ARM64

    embed_anything-0.2.1-cp39-none-win_amd64.whl (10.9 MB view details)

    Uploaded CPython 3.9 Windows x86-64

    embed_anything-0.2.1-cp39-cp39-manylinux_2_34_x86_64.whl (14.3 MB view details)

    Uploaded CPython 3.9 manylinux: glibc 2.34+ x86-64

    embed_anything-0.2.1-cp39-cp39-macosx_11_0_arm64.whl (7.3 MB view details)

    Uploaded CPython 3.9 macOS 11.0+ ARM64

    embed_anything-0.2.1-cp38-none-win_amd64.whl (10.9 MB view details)

    Uploaded CPython 3.8 Windows x86-64

    File details

    Details for the file embed_anything-0.2.1.tar.gz.

    File metadata

    • Download URL: embed_anything-0.2.1.tar.gz
    • Upload date:
    • Size: 868.6 kB
    • Tags: Source
    • Uploaded using Trusted Publishing? Yes
    • Uploaded via: maturin/1.7.0

    File hashes

    Hashes for embed_anything-0.2.1.tar.gz
    Algorithm Hash digest
    SHA256 52bfbb7346706abd654e9d2d6b1a467513d7f20544adfea24df54b6c1935020b
    MD5 1dfdd36f5d5e7b3974333027083a3482
    BLAKE2b-256 cb65c6d08140688ba21cbe4711fcb0e8147b5e73f13c03e2ea3c4c2baf1a0982

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp312-none-win_amd64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp312-none-win_amd64.whl
    Algorithm Hash digest
    SHA256 21e08575f604a43c17538f915df87978143fca61e42166a817f4a5d3641dfac0
    MD5 5c28776cd1ec9bc164d8c79730ad9c32
    BLAKE2b-256 0930935feb1428bf1ead4c5763cadad246e7a9dd4f5bafbbb56cdf9f1866520b

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl
    Algorithm Hash digest
    SHA256 12def1270fe2586c0f2670cd0a92b84a6a972725ea201dbdc292265cf8abb4e4
    MD5 a42bec1503c22bb0c1b73932fbac6247
    BLAKE2b-256 a10f93139c23d097374c0c9026811e523c2c8de603aebe6a145004842aba1a44

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp312-cp312-macosx_11_0_arm64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp312-cp312-macosx_11_0_arm64.whl
    Algorithm Hash digest
    SHA256 68ff59dd33de49b4b802ad041c66a2387d5733d8fd7f1cb27b4ed83e2025610b
    MD5 b0a876ffe1a398121cf4b4daf326648b
    BLAKE2b-256 68d5b87f892c5bdb13e4cf7574230b15667e0a2229475302f4e91475d40a7cf6

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp312-cp312-macosx_10_12_x86_64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp312-cp312-macosx_10_12_x86_64.whl
    Algorithm Hash digest
    SHA256 0876dfaf739b6f2edd2851c02632db2292e34742550a65065b49a5466d97984c
    MD5 229e5ff0b00101eeb08c1bd993b0859c
    BLAKE2b-256 95ec6e04d921c03a90c35dd1d8422a8d7180850ad3bde21b13b6ba13e33d8ccb

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp311-none-win_amd64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp311-none-win_amd64.whl
    Algorithm Hash digest
    SHA256 370781fc7ab0b67a6aeab7cd938401bf0777a16e4f09c12c3614a4bc0cfe4952
    MD5 9cf641acbb47c005d3cf53ff8c3a99f2
    BLAKE2b-256 41a93b9c8a4d2087d529784ae072ee2a5661235dd0e465ad71d3fccd07673052

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp311-cp311-manylinux_2_34_x86_64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp311-cp311-manylinux_2_34_x86_64.whl
    Algorithm Hash digest
    SHA256 94f32786489ec6230155bf15e4475fe5ba7999a917555729619d72edce8ee4de
    MD5 29aecb71e97686b13c5ba177a296911d
    BLAKE2b-256 d796894d8a3da58a280d55912150b4834c2eed73fa6489a8b64f576ece2db0ae

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp311-cp311-macosx_11_0_arm64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp311-cp311-macosx_11_0_arm64.whl
    Algorithm Hash digest
    SHA256 0e89388b563fd4dd75e81ccaa503d98c31487247f3f621965a680b10d59e518f
    MD5 075862c0c7c5792509f0d430d90d1bfd
    BLAKE2b-256 2ffdab2c2c8c623762367fe550f19fb93552413a677a0a6ed3db3d0fa0390c59

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp311-cp311-macosx_10_12_x86_64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp311-cp311-macosx_10_12_x86_64.whl
    Algorithm Hash digest
    SHA256 8d302cf73b3010fc84997d2c4aee18f00bdf0c73fe416d2c63109f5a7d42d3dc
    MD5 ab35e455feebf0d86a0293f7c9970a07
    BLAKE2b-256 03bf675f54f8211e1a0f0840967435424a1296a793a002d18fc7525e4f1a4531

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp310-none-win_amd64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp310-none-win_amd64.whl
    Algorithm Hash digest
    SHA256 22893ae4a6ecb80129f066f3e6dbed49ce9171a3bd182fbb35adef882f58838c
    MD5 6662695a791f492f6f2a3af10f443464
    BLAKE2b-256 b0932d04aeaa95a466d836ef579e02150bbae542f36424c0b314aee4dd796ecb

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp310-cp310-manylinux_2_34_x86_64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp310-cp310-manylinux_2_34_x86_64.whl
    Algorithm Hash digest
    SHA256 acf7376614cafa1f091b2741a0dabd370d5eae6217043c9cdf39374d4c7a6f79
    MD5 76f8a1edcb2672a5805ce201963fa8fd
    BLAKE2b-256 b51a5544118ef0bc269dc21c32e07735ac0baac5eeda56e21280e72a2e1d33e5

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp310-cp310-macosx_11_0_arm64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
    Algorithm Hash digest
    SHA256 bd5438ee5a902a14a9e8d2b14b446cdb3deb2f864296f1a974853f5456b560d8
    MD5 ac1151b5c8cda31f652ec92deebae6b4
    BLAKE2b-256 a6795c36c564168debc6f0085c6e2efa96720f1de40a042b4525adb8a070d174

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp39-none-win_amd64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp39-none-win_amd64.whl
    Algorithm Hash digest
    SHA256 4595d8460de8c17800a5c1959d0bdb5516c401264072a84437023528249a0dae
    MD5 ae0774ea342d25eac10894811d402bf9
    BLAKE2b-256 c33054e6e33cadf8e8979f24861dad4c29979b29da1e9f542e74b2432686ccfe

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp39-cp39-manylinux_2_34_x86_64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp39-cp39-manylinux_2_34_x86_64.whl
    Algorithm Hash digest
    SHA256 a62e06aa04828cc9b0cb0d100bc944faa65670368f1251b2f6f116148192726a
    MD5 86ad17d37794c4c0842abdd08096f23d
    BLAKE2b-256 66731374bd77e41bcdea2488ab88874c07b367d92333e272f72ec16b762c2b8a

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp39-cp39-macosx_11_0_arm64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp39-cp39-macosx_11_0_arm64.whl
    Algorithm Hash digest
    SHA256 1d05da16d2a5d4419af9a954bcaa083f0b1c2d3c65728d4ba667ade2087d794f
    MD5 7c4b428a9f1d1a8a307169114e022286
    BLAKE2b-256 59ee1d24630eeae9f8b3681d2450e2e446d83aa5e7265d0c487c0d362d9aef41

    See more details on using hashes here.

    File details

    Details for the file embed_anything-0.2.1-cp38-none-win_amd64.whl.

    File metadata

    File hashes

    Hashes for embed_anything-0.2.1-cp38-none-win_amd64.whl
    Algorithm Hash digest
    SHA256 62a8b4235674c4e695c726be277525e09d3404846c629d413ca9e70deee02573
    MD5 febde5d00363a00a17e6fec6dc7bca02
    BLAKE2b-256 a7760c82cb27ca4d2a86193cc4cd2edac142176049b5b8a2ff03b33937f55113

    See more details on using hashes here.

    Supported by

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