Skip to main content

LlamaIndex Embeddings Integration: Deepinfra

With this integration, you can use the Deepinfra embeddings model to get embeddings for your text data. Here is the link to the embeddings models.

First, you need to sign up on the Deepinfra website and get the API token. You can copy model_ids over the model cards and start using them in your code.

Installation

pip install llama-index llama-index-embeddings-deepinfra

Usage

from dotenv import load_dotenv, find_dotenv
from llama_index.embeddings.deepinfra import DeepInfraEmbeddingModel

# Load environment variables
_ = load_dotenv(find_dotenv())

# Initialize model with optional configuration
model = DeepInfraEmbeddingModel(
    model_id="BAAI/bge-large-en-v1.5",  # Use custom model ID
    api_token="YOUR_API_TOKEN",  # Optionally provide token here
    normalize=True,  # Optional normalization
    text_prefix="text: ",  # Optional text prefix
    query_prefix="query: ",  # Optional query prefix
)

# Example usage
response = model.get_text_embedding("hello world")

# Batch requests
texts = ["hello world", "goodbye world"]
response = model.get_text_embedding_batch(texts)

# Query requests
response = model.get_query_embedding("hello world")


# Asynchronous requests
async def main():
    text = "hello world"
    response = await model.aget_text_embedding(text)


if __name__ == "__main__":
    import asyncio

    asyncio.run(main())

Metadata

Release files for llama-index-embeddings-deepinfra 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-embeddings-deepinfra 0.6.0
File Size Uploaded Provenance Actions
llama_index_embeddings_deepinfra-0.6.0.tar.gz 5.4 kB Without provenance Details for llama_index_embeddings_deepinfra-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-embeddings-deepinfra 0.6.0
File Interpreter ABI Platform Actions
llama_index_embeddings_deepinfra-0.6.0-py3-none-any.whl Python 3 none any Details for llama_index_embeddings_deepinfra-0.6.0-py3-none-any.whl

Total release size: 10.5 kB

Release files / llama_index_embeddings_deepinfra-0.6.0.tar.gz

Download URL llama_index_embeddings_deepinfra-0.6.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5a1c81d5e09f03219a7ddfdff0d8fd96c981262aa0c8e67481841ce0ea076c06
BLAKE2b-256 checksum
How to use checksums
77a2e18b19ac220ce05f039b66f25a2857c8411ac1d3037464aa438cfca87ee0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llama_index_embeddings_deepinfra-0.6.0-py3-none-any.whl

Download URL llama_index_embeddings_deepinfra-0.6.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1003d0e50a283a81c1291da9ab6a179d0d4f49848a8a1e95d332c2b346b2ac3d
BLAKE2b-256 checksum
How to use checksums
ddb99cb7a42b50e68cc30e917177e40dd65ca20921078009f7e7b42c1b5768ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for llama-index-embeddings-deepinfra 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page