--- id: langchain-ibm version: "1.1.0" license: MIT license_treatment: permissive maintenance: active --- # langchain-ibm — An integration package connecting IBM watsonx.ai and LangChain License: permissive · Maintenance: active · Downloads: 716.2K/mo ## 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 above — 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 pip install langchain-ibm uv add langchain-ibm 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_current - Install friction: low - Maintenance: active - Downloads: 716.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags IBM watsonx LangChain integration, IBM foundation models LangChain, watsonx chat embeddings reranking, IBM AI models LangChain, langchain IBM watsonx connector, llm-integration, ibm-watsonx, rag [View on SkillFed](https://skillfed.io/packages/langchain-ibm) · [View on PyPI](https://pypi.org/project/langchain-ibm/)