Skip to main content

A simple, unified interface for generating embeddings from various providers.

Project description

Embedding Suite

PyPI

GitHub last commit

A simple, unified interface for generating text embeddings from various providers. (This is heavily modeled on Andrew Ng's AI Suite, which does the same thing for Large Language Models.)

This is a work-in-progress, though is fully functional as described below. On the roadmap are new providers, an easier way to optionally also install providers' packages, perhaps use of HTTP endpoints in lieu of providers' packages, perhaps multimodal embeddings...

Installation

(You'll need to install the provider's SDK separately.)

Pip

pip install embedding-suite

Poetry

poetry add embedding-suite

UV (recommended)

uv add embedding-suite

Example Usage

inputs = ["First sentence", "Second sentence"]

You can serve API keys from your .env or explicitly add them as in the below examples.

OpenAI

from embedding_suite import EmbeddingSuiteClient

client = EmbeddingSuiteClient(provider_configs={"openai": {
    "api_key": "XXX"}})

embeddings = client.generate_embeddings(
    model="openai:text-embedding-3-large", inputs=inputs)

Cohere

from embedding_suite import EmbeddingSuiteClient

client = EmbeddingSuiteClient(provider_configs={"cohere": {
    "api_key": "XXX"}})

embeddings = client.generate_embeddings(
    model="cohere:embed-english-v3.0", inputs=inputs)

VoyageAI

from embedding_suite import EmbeddingSuiteClient

client = EmbeddingSuiteClient(provider_configs={"voyageai": {
    "api_key": "XXX"}})

embeddings = client.generate_embeddings(
    model="voyage:voyage-3", inputs=inputs)

Sentence Transformers

from embedding_suite import EmbeddingSuiteClient

client = EmbeddingSuiteClient(provider_configs={"sentencetransformers": {}})

embeddings = client.generate_embeddings(
    model="sentencetransformers:all-mpnet-base-v2", inputs=inputs)

Huggingface

from embedding_suite import EmbeddingSuiteClient

client = EmbeddingSuiteClient(provider_configs={"huggingface": {
    "api_key": "XXX"}})

embeddings = client.generate_embeddings(
    model="huggingface:sentence-transformers/sentence-t5-large", inputs=inputs)

Mistral

from embedding_suite import EmbeddingSuiteClient

client = EmbeddingSuiteClient(provider_configs={"mistral": {
    "api_key": "XXX"}})

embeddings = client.generate_embeddings(
    model="mistral:mistral-embed", inputs=inputs)

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

embedding_suite-0.1.7.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

embedding_suite-0.1.7-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file embedding_suite-0.1.7.tar.gz.

File metadata

  • Download URL: embedding_suite-0.1.7.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.18

File hashes

Hashes for embedding_suite-0.1.7.tar.gz
Algorithm Hash digest
SHA256 b538b85e8b8dafb9ea933cb4e80621d89e6378369ac166f5122ae71fab2fb8e1
MD5 7d4007eafd12926508bce0762de121a0
BLAKE2b-256 8672e9213997987d3dcc2d6696df33adcdfcbf09dbce9bedb80355ceb21dbc8e

See more details on using hashes here.

File details

Details for the file embedding_suite-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for embedding_suite-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d9de1d94ec03253ff1239aa44f181998c551627a32a06051e40562a78264fb89
MD5 4df55cb23d66e1768b9b3e32a4968068
BLAKE2b-256 08efeed6d34e03984186354f95e91355fe58fe8f67f57322a8e18b4eccc890f4

See more details on using hashes here.

Supported by

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