Skip to main content

langchain-deepinfra

This package contains the LangChain integrations for DeepInfra through their APIs.

Installation and Setup

Install the LangChain partner package

pip install -U langchain-deepinfra

Get your DeepInfra api key from the DeepInfra Dashboard and set it as an environment variable (DEEPINFRA_API_TOKEN)

export DEEPINFRA_API_TOKEN=<api_key>

Chat Completions

This package contains the ChatDeepInfra class, which is the recommended way to interface with DeepInfra chat models.

from langchain_deepinfra import ChatDeepInfra

chat = ChatDeepInfra(model="meta-llama/Meta-Llama-3.1-8B-Instruct")
chat.invoke("Who is the first president of Indonesia?")

Embeddings

DeepInfraEmbeddings class exposes the DeepInfra embedding API.

from langchain_deepinfra import DeepInfraEmbeddings

embeddings = DeepInfraEmbeddings(model="BAAI/bge-base-en-v1.5")
embeddings.embed_query("Who is the first president of Indonesia?")

LLM

DeepInfra class exposes the DeepInfra LLM API.

from langchain_deepinfra import DeepInfra

llm = DeepInfra(model="meta-llama/Meta-Llama-3.1-8B-Instruct")
llm.invoke("Who is the first president of Indonesia?")

Metadata

Release files for langchain-deepinfra 0.1.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 langchain-deepinfra 0.1.0
File Size Uploaded
langchain_deepinfra-0.1.0.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-deepinfra 0.1.0
File Interpreter ABI Platform
langchain_deepinfra-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.4 kB

Release files / langchain_deepinfra-0.1.0.tar.gz

Download URL langchain_deepinfra-0.1.0.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a694067fb0e84e11b32a2dd09208a56fc5d538142a6ef30e216026e2b2d7e489
BLAKE2b-256 checksum
How to use checksums
457dc8d74827b0b22a79ce5405dcb19a50ece9e943056ff902945e1339e638e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.12.9 Darwin/22.1.0

Release files / langchain_deepinfra-0.1.0-py3-none-any.whl

Download URL langchain_deepinfra-0.1.0-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4efad593ce033a66528ff3ca6c38313c9f4f7f5137e2c1cd13abd5ad9be92de
BLAKE2b-256 checksum
How to use checksums
8ab952dfc9fb60d2bf287d9fb5339bb64f1601fb9a95d855a7a94955f61042aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.12.9 Darwin/22.1.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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