An integration package connecting EmpirioLabs and LangChain
Project description
langchain-empiriolabs
This package contains the LangChain integration for EmpirioLabs.
EmpirioLabs serves frontier open models (Qwen3, DeepSeek V4, GLM-5.1, Kimi K2.7 Code, MiniMax M3, and more) through one OpenAI-compatible API. Browse the full model catalog at docs.empiriolabs.ai.
Installation
pip install -U langchain-empiriolabs
Set your API key as an environment variable:
export EMPIRIOLABS_API_KEY="your-api-key"
You can create a key from the EmpirioLabs dashboard.
Chat models
ChatEmpirioLabs wraps the EmpirioLabs chat completions API.
from langchain_empiriolabs import ChatEmpirioLabs
llm = ChatEmpirioLabs(model="qwen3-7-plus")
response = llm.invoke("Explain backpropagation in one paragraph.")
print(response.content)
Streaming:
for chunk in llm.stream("Write a haiku about the sea."):
print(chunk.content, end="", flush=True)
Tool calling:
from pydantic import BaseModel, Field
class GetWeather(BaseModel):
"""Get the current weather in a given location."""
location: str = Field(..., description="The city and state, e.g. San Francisco, CA")
llm_with_tools = llm.bind_tools([GetWeather])
print(llm_with_tools.invoke("What is the weather in SF?").tool_calls)
Available models
Any model slug from the EmpirioLabs catalog works. Some popular chat slugs:
| Slug | Notes |
|---|---|
qwen3-7-plus |
General-purpose chat (default) |
qwen3-7-max |
Highest-capability Qwen3 |
deepseek-v4-pro |
Reasoning model |
deepseek-v4-flash |
Fast, low-cost |
glm-5-1 |
GLM-5.1 |
kimi-k2-7-code |
Coding-focused, reasoning |
minimax-m3 |
MiniMax M3 |
Reasoning models place their chain-of-thought in response.additional_kwargs["reasoning_content"].
The live list is always available from GET https://api.empiriolabs.ai/v1/models.
Embeddings
EmpirioLabsEmbeddings wraps the EmpirioLabs embeddings API.
from langchain_empiriolabs import EmpirioLabsEmbeddings
embeddings = EmpirioLabsEmbeddings(model="text-embedding-v4")
vector = embeddings.embed_query("Hello, world!")
print(len(vector))
Configuration
| Argument | Environment variable | Default |
|---|---|---|
api_key |
EMPIRIOLABS_API_KEY |
(required) |
base_url |
EMPIRIOLABS_API_BASE |
https://api.empiriolabs.ai/v1 |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_empiriolabs-0.1.0.tar.gz.
File metadata
- Download URL: langchain_empiriolabs-0.1.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbab8bf1a7ec646c31efc5675b9509340765a4607297561e2ec8309542dd17ea
|
|
| MD5 |
96267a902f8ebda5e1f092564d096074
|
|
| BLAKE2b-256 |
4cf4b7270d23505442de63049407837fb136f1253f6e46dee48105ccdb634603
|
Provenance
The following attestation bundles were made for langchain_empiriolabs-0.1.0.tar.gz:
Publisher:
publish.yml on EmpirioLabs-ai/langchain-empiriolabs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_empiriolabs-0.1.0.tar.gz -
Subject digest:
dbab8bf1a7ec646c31efc5675b9509340765a4607297561e2ec8309542dd17ea - Sigstore transparency entry: 1807610048
- Sigstore integration time:
-
Permalink:
EmpirioLabs-ai/langchain-empiriolabs@70086284726ce031e5cb222e3edba7cf227856a8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/EmpirioLabs-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@70086284726ce031e5cb222e3edba7cf227856a8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file langchain_empiriolabs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_empiriolabs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7868d577a2caaa15aafd39abad680dc36ddede5c80bf0cc6b282c6042078913a
|
|
| MD5 |
ff2fef9e65a1c6c15527c91cd8dc7085
|
|
| BLAKE2b-256 |
7f78228df31364678c6e4ff4d0cc0a2ed2abc770e1298c6c19f863ca7c542ee2
|
Provenance
The following attestation bundles were made for langchain_empiriolabs-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on EmpirioLabs-ai/langchain-empiriolabs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_empiriolabs-0.1.0-py3-none-any.whl -
Subject digest:
7868d577a2caaa15aafd39abad680dc36ddede5c80bf0cc6b282c6042078913a - Sigstore transparency entry: 1807610080
- Sigstore integration time:
-
Permalink:
EmpirioLabs-ai/langchain-empiriolabs@70086284726ce031e5cb222e3edba7cf227856a8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/EmpirioLabs-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@70086284726ce031e5cb222e3edba7cf227856a8 -
Trigger Event:
workflow_dispatch
-
Statement type: