skillfed

langchain-ibm

An integration package connecting IBM watsonx.ai and LangChain

langchain-ibm v1.1.0 716.2K downloads/30d#5,246 on PyPI37
Permissive license MIT Active released

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-ibm

uv

uv add langchain-ibm

poetry

poetry add langchain-ibm

Installing 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

IBM watsonx LangChain integrationIBM foundation models LangChainwatsonx chat embeddings rerankingIBM AI models LangChainlangchain IBM watsonx connector
llm-integrationibm-watsonxrag

More Artificial Intelligence packages

litellm

LiteLLM provides a unified Python interface to…

permissive · top 100 on PyPI

huggingface-hub

Client library and CLI tool for downloading,…

permissive · top 100 on PyPI

langchain

LangChain provides a framework for building…

permissive · top 1,000 on PyPI

hf-xet

hf-xet provides chunk-based deduplication and…

permissive · top 1,000 on PyPI

tokenizers

Tokenizers converts raw text into token…

permissive · top 1,000 on PyPI

transformers

Transformers provides a unified framework for…

permissive · top 1,000 on PyPI

llama-index-embeddings-ibm

Integrates IBM watsonx.ai embedding models with…

permissive · top 15,000 on PyPI

qianfan

Python SDK for Baidu Qianfan large language…

permissive · top 15,000 on PyPI

ibm-watsonx-ai

Official Python SDK for IBM watsonx.ai that…

permissive · top 5,000 on PyPI

langchain-oci

Integrates LangChain with Oracle Cloud…

unclear · top 15,000 on PyPI

llama-index-llms-ibm

Integrates IBM watsonx.ai foundation models…

permissive · top 15,000 on PyPI

langchain-cohere

Connects LangChain applications to Cohere's…

permissive · top 5,000 on PyPI

langchain-google-genai

Integrates Google's Gemini AI models (chat,…

permissive · top 5,000 on PyPI

langchain-baseten

Integrates Baseten's chat models and embeddings…

permissive · top 15,000 on PyPI

langchain-elasticsearch

Integrates Elasticsearch with LangChain to…

permissive · top 15,000 on PyPI

unique-toolkit

Provides high-level abstractions and services…

unclear · top 15,000 on PyPI