langchain-baseten
Integration package connecting Baseten and LangChain
What it is and what it does
langchain-baseten bridges Baseten's hosted language models and embeddings into LangChain's ecosystem. It provides two main classes: ChatBaseten for conversational models and BasetenEmbeddings for vector generation. Both support Baseten's Model APIs (using model slugs on shared infrastructure) and dedicated deployment URLs for custom or performance-optimized models.
The package handles authentication via API key and environment variables, manages HTTP communication with Baseten's endpoints, and wraps responses in LangChain's standard message and embedding formats. It depends on langchain-core for the base interfaces, langchain-openai for OpenAI-compatible protocol handling, and baseten-performance-client for optimized embedding operations.
Use it for:
- Build a chatbot using Baseten-hosted models (e.g., GLM-5.2) within a LangChain application without custom API code.
- Generate embeddings for semantic search or RAG pipelines using Baseten's dedicated embedding deployments.
- Switch between shared Model APIs and custom dedicated deployments without changing application code.
- Integrate Baseten models into LangChain chains and agents that already use other LangChain providers.
- Use environment variables to manage Baseten credentials across development and production deployments.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates Baseten's chat models and embeddings into LangChain applications, enabling use of Baseten-hosted models through LangChain's standard interfaces.
Yes. The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and provides straightforward integration for developers already using LangChain who want to use Baseten models. Install friction is low and Python version support is current. Suitable for production use if you have a Baseten account and models deployed.
Install
langchain-baseten on PyPI
pip
pip install langchain-basetenuv
uv add langchain-basetenpoetry
poetry add langchain-basetenInstalling langchain-baseten
Before you install
Low friction installation with three runtime dependencies. Package is actively maintained with a recent release (18 days old) and no known vulnerabilities.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects.
Quickstart
pip install langchain-baseten
from langchain_baseten import ChatBaseten
model = ChatBaseten(
model="zai-org/GLM-5.2",
api_key="your-api-key"
)
response = model.invoke("Hello, how are you?")
Requires Python 3.10 or later and a valid Baseten API key (set via BASETEN_API_KEY environment variable or passed directly).
Verify before relying
- Whether Baseten's Performance Client dependency introduces any system-level requirements or compilation steps.
- Specific latency or throughput characteristics when using Model APIs vs. dedicated deployment URLs.
- Whether custom models deployed to Baseten require additional configuration beyond model URL and API key.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0.0,>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — baseten-performance-client, langchain-core, langchain-openai |
| Maintenance | actively maintained — 18 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 116,100/month — #12,218 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: langchain_baseten-0.2.3-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
baseten-performance-clientA high-performance Python HTTP client for…
unclear · top 15,000 on PyPI
langchain-sambanovaConnects LangChain applications to SambaNova's…
permissive · top 15,000 on PyPI
unique-toolkitProvides high-level abstractions and services…
unclear · top 15,000 on PyPI
langchain-elasticsearchIntegrates Elasticsearch with LangChain to…
permissive · top 15,000 on PyPI
llama-index-embeddings-langchainIntegrates Langchain embedding models with…
permissive · top 15,000 on PyPI
langchain-togetherConnects LangChain applications to Together…
permissive · top 15,000 on PyPI
langchain-cohereConnects LangChain applications to Cohere's…
permissive · top 5,000 on PyPI
langchain-google-genaiIntegrates Google's Gemini AI models (chat,…
permissive · top 5,000 on PyPI
langchain-openaiProvides LangChain integrations for OpenAI's…
permissive · top 1,000 on PyPI
langchain-ibmIntegrates IBM watsonx.ai models with…
permissive · top 15,000 on PyPI