Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_empiriolabs-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

langchain_empiriolabs-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

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

Hashes for langchain_empiriolabs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dbab8bf1a7ec646c31efc5675b9509340765a4607297561e2ec8309542dd17ea
MD5 96267a902f8ebda5e1f092564d096074
BLAKE2b-256 4cf4b7270d23505442de63049407837fb136f1253f6e46dee48105ccdb634603

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_empiriolabs-0.1.0.tar.gz:

Publisher: publish.yml on EmpirioLabs-ai/langchain-empiriolabs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_empiriolabs-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_empiriolabs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7868d577a2caaa15aafd39abad680dc36ddede5c80bf0cc6b282c6042078913a
MD5 ff2fef9e65a1c6c15527c91cd8dc7085
BLAKE2b-256 7f78228df31364678c6e4ff4d0cc0a2ed2abc770e1298c6c19f863ca7c542ee2

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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