langchain-ibm
An integration package connecting IBM watsonx.ai and LangChain
What it is and what it does
langchain-ibm is a LangChain integration package that bridges LangChain applications to IBM watsonx.ai foundation models. It exposes four main model classes—ChatWatsonx for chat interactions, WatsonxLLM for text generation, WatsonxEmbeddings for semantic embeddings, and WatsonxRerank for relevance reranking—each wrapping IBM's models through the ibm-watsonx-ai SDK.
The package handles authentication via IBM Cloud API keys, parameter configuration through model-specific schema classes, and toolkit utilities for agent-based workflows. It depends on langchain-core for the base LangChain abstractions and json-repair for robustness. Setup requires an IBM Cloud account, API key, and a watsonx.ai project or space; once configured, you instantiate a model class with your credentials and invoke it like any other LangChain model.
Use it for:
- Build LangChain chat applications using IBM's Granite or other watsonx.ai foundation models without writing custom SDK wrappers.
- Add semantic search to LangChain RAG pipelines using WatsonxEmbeddings for document indexing and retrieval.
- Create multi-step LLM workflows in LangChain that call IBM text generation models for content synthesis or summarization.
- Implement reranking stages in LangChain retrieval chains to improve relevance of search results using WatsonxRerank.
- Deploy LangChain agents with WatsonxToolkit to orchestrate IBM watsonx.ai capabilities in autonomous workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates IBM watsonx.ai models with LangChain, providing chat, embedding, text generation, and reranking capabilities through a unified interface.
Yes, if you are already using LangChain and need to integrate IBM watsonx.ai models. The package is actively maintained, has low install friction, carries no known vulnerabilities, and is MIT-licensed. Requires IBM Cloud credentials and familiarity with LangChain's model abstraction layer; not suitable if you do not have access to IBM watsonx.ai or prefer other model providers.
Install
langchain-ibm on PyPI
pip
pip install langchain-ibmuv
uv add langchain-ibmpoetry
poetry add langchain-ibmInstalling langchain-ibm
Before you install
Low install friction with a pure Python wheel. Actively maintained with recent commits; last release 72 days ago. Depends on langchain-core, ibm-watsonx-ai, and json-repair.
License in practice
MIT license is permissive; you may use, modify, and distribute this package with minimal restrictions.
Quickstart
pip install langchain-ibm
from langchain_ibm import ChatWatsonx
from ibm_watsonx_ai.foundation_models.schema import TextChatParameters
params = TextChatParameters(temperature=0.5, max_completion_tokens=1024)
model = ChatWatsonx(
model_id="ibm/granite-4-h-small",
url="https://us-south.ml.cloud.ibm.com",
project_id="YOUR_PROJECT_ID",
params=params
)
model.invoke("Sing a ballad of LangChain.")
Requires IBM Cloud API key set as WATSONX_API_KEY environment variable; also requires project_id or space_id from IBM watsonx.ai service.
Verify before relying
- Whether all four model classes (ChatWatsonx, WatsonxLLM, WatsonxEmbeddings, WatsonxRerank) are production-ready or still experimental.
- Performance characteristics and latency expectations when calling IBM watsonx.ai endpoints.
- Support scope for different IBM Cloud regions and Cloud Pak for Data deployments.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — langchain-core, ibm-watsonx-ai, json-repair |
| Maintenance | actively maintained — 72 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 716,196/month — #5,246 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: langchain_ibm-1.1.0-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
llama-index-embeddings-ibmIntegrates IBM watsonx.ai embedding models with…
permissive · top 15,000 on PyPI
qianfanPython SDK for Baidu Qianfan large language…
permissive · top 15,000 on PyPI
ibm-watsonx-aiOfficial Python SDK for IBM watsonx.ai that…
permissive · top 5,000 on PyPI
langchain-ociIntegrates LangChain with Oracle Cloud…
unclear · top 15,000 on PyPI
llama-index-llms-ibmIntegrates IBM watsonx.ai foundation models…
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-basetenIntegrates Baseten's chat models and embeddings…
permissive · top 15,000 on PyPI
langchain-elasticsearchIntegrates Elasticsearch with LangChain to…
permissive · top 15,000 on PyPI
unique-toolkitProvides high-level abstractions and services…
unclear · top 15,000 on PyPI