ibm-watsonx-ai 1.5.7


pip install ibm-watsonx-ai

  This release has been yanked

Released: Apr 01, 2026


Meta
Author: IBM
Maintainer: Maria Oleszkiewicz, Mateusz Szewczyk
Requires Python: <3.14,>=3.11

Classifiers

Development Status
  • 5 - Production/Stable

Natural Language
  • English

License
  • OSI Approved :: BSD License

Programming Language
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13

Operating System
  • MacOS :: MacOS X
  • POSIX :: Linux
  • Microsoft :: Windows

Intended Audience
  • Science/Research
  • Developers
  • Information Technology

Topic
  • Software Development :: Libraries
  • Software Development :: Libraries :: Python Modules
  • Scientific/Engineering :: Artificial Intelligence
  • Scientific/Engineering :: Information Analysis
  • Internet

πŸ“¦ ibm-watsonx-ai

Official IBM watsonx.ai Python SDK


IBM Python License

PyPI Downloads Docs Examples


Enterprise-grade Python client for building, tuning and deploying AI models with IBM watsonx.ai

πŸš€ Quick Start β€’ πŸ“˜ Documentation β€’ πŸ““ Examples

πŸ“Œ Overview

ibm-watsonx-ai is the official Python SDK for IBM watsonx.ai, an enterprise-grade AI platform for building, training, tuning, deploying, and operating AI models at scale.

The SDK provides a unified and production-ready Python interface to the full watsonx.ai ecosystem, including Foundation Models (within LLMs), AutoAI experiments, Retrieval-Augmented Generation (RAG), model tuning, deployment, and data integration.

With ibm-watsonx-ai, developers and data scientists can seamlessly integrate advanced AI capabilities into Python applications running on IBM watsonx.ai for IBM Cloud or IBM watsonx.ai software, while meeting enterprise requirements such as security, governance, and scalability.


🎯 What This SDK Is Used For

The ibm-watsonx-ai SDK is designed to support the entire AI lifecycle:

  • πŸ” Secure authentication and environment configuration
  • πŸ€– Inference with Foundation Models (LLMs, embeddings, time-series, audio)
  • πŸ“š Building Retrieval-Augmented Generation (RAG) systems
  • πŸ§ͺ Running and optimizing AutoAI experiments
  • βš™οΈ Fine-tuning and prompt tuning of models
  • πŸš€ Deploying models to scalable inference endpoints
  • πŸ”— Integrating enterprise data sources into AI workflows

It is suitable for research, prototyping, and production deployments.


πŸ“¦ Installation

Install from PyPI:

pip install ibm-watsonx-ai

Install with optional extras:

pip install "ibm-watsonx-ai[rag]"
Extra Description
rag Retrieval‑Augmented Generation utilities
mcp Model Context Protocol

πŸš€ Quick Start

Authentication

Set up your Credentials and create an APIClient instance:

from ibm_watsonx_ai import Credentials, APIClient

credentials = Credentials(
    url="https://us-south.ml.cloud.ibm.com",
    api_key="<your-ibm-api-key>"
)

# Initialize APIClient using a space ID (you can also use a project ID)
api_client = APIClient(credentials, space_id="<your-space-id>")

Working with ModelInference

List available chat models

list(api_client.foundation_models.ChatModels)

# Output example:
# [<ChatModels.GRANITE_3_3_8B_INSTRUCT: 'ibm/granite-3-3-8b-instruct'>,
#  <ChatModels.GRANITE_4_H_SMALL: 'ibm/granite-4-h-small'>,
#  <ChatModels.LLAMA_3_3_70B_INSTRUCT: 'meta-llama/llama-3-3-70b-instruct'>,
#  <ChatModels.GPT_OSS_120B: 'openai/gpt-oss-120b'>]

Initialize ModelInference

from ibm_watsonx_ai.foundation_models import ModelInference

# Create a `ModelInference` instance for the selected model
model = ModelInference(
    api_client=api_client,
    model_id="ibm/granite-4-h-small"
)

Chat with the model

# Prepare messages
messages = [
    {"role": "system", "content": "You are a helpful assistant that translates English to French."},
    {"role": "user", "content": "I love you for listening to Rock."}
]

# Get model response
response = model.chat(messages=messages)
print(response)
1.5.7 Apr 01, 2026
1.5.5 Mar 25, 2026
1.5.4 Mar 17, 2026
1.5.3 Feb 26, 2026
1.5.2 Feb 12, 2026
1.5.1 Jan 29, 2026
1.5.0 Jan 14, 2026
1.4.11 Dec 08, 2025
1.4.9 Dec 05, 2025
1.4.8 Nov 18, 2025
1.4.7 Nov 18, 2025
1.4.6 Nov 13, 2025
1.4.5 Nov 05, 2025
1.4.4 Oct 29, 2025
1.4.3 Oct 29, 2025
1.4.2 Oct 22, 2025
1.4.1 Oct 15, 2025
1.4.0 Oct 08, 2025
1.3.42 Oct 01, 2025
1.3.40 Sep 24, 2025
1.3.39 Sep 24, 2025
1.3.38 Sep 11, 2025
1.3.37 Sep 04, 2025
1.3.36 Aug 28, 2025
1.3.34 Aug 13, 2025
1.3.33 Jul 23, 2025
1.3.32 Jul 23, 2025
1.3.31 Jul 16, 2025
1.3.30 Jul 07, 2025
1.3.28 Jul 02, 2025
1.3.26 Jun 12, 2025
1.3.25 Jun 12, 2025
1.3.24 Jun 06, 2025
1.3.23 May 28, 2025
1.3.20 May 16, 2025
1.3.19 May 22, 2025
1.3.18 May 15, 2025
1.3.17 May 07, 2025
1.3.16 May 06, 2025
1.3.13 Apr 24, 2025
1.3.12 Apr 23, 2025
1.3.11 Apr 23, 2025
1.3.8 Apr 16, 2025
1.3.6 Apr 09, 2025
1.3.5 Apr 02, 2025
1.3.3 Mar 26, 2025
1.3.1 Mar 19, 2025
1.3.0 Mar 12, 2025
1.2.10 Mar 04, 2025
1.2.9 Feb 26, 2025
1.2.8 Feb 19, 2025
1.2.7 Feb 12, 2025
1.2.6 Jan 31, 2025
1.2.5 Jan 29, 2025
1.2.4 Jan 29, 2025
1.2.2 Jan 22, 2025
1.2.1 Jan 13, 2025
1.1.26.post1 May 12, 2025
1.1.26 Dec 12, 2024
1.1.25 Dec 05, 2024
1.1.24 Nov 18, 2024
1.1.23 Nov 05, 2024
1.1.22 Oct 31, 2024
1.1.21 Oct 29, 2024
1.1.20 Oct 25, 2024
1.1.17 Oct 28, 2024
1.1.16 Oct 21, 2024
1.1.15 Oct 16, 2024
1.1.14 Oct 08, 2024
1.1.11 Sep 23, 2024
1.1.9 Sep 16, 2024
1.1.8 Sep 02, 2024
1.1.7 Aug 27, 2024
1.1.6.post1 Apr 14, 2025
1.1.6 Aug 14, 2024
1.1.5 Aug 06, 2024
1.1.2 Jul 24, 2024
1.0.12 Jul 31, 2024
1.0.11 Jul 08, 2024
1.0.10 Jul 01, 2024
1.0.9 Jun 21, 2024
1.0.8 Jun 13, 2024
1.0.6 Jun 06, 2024
1.0.5 May 31, 2024
1.0.4 May 17, 2024
1.0.2 May 07, 2024
1.0.1 Apr 29, 2024
0.2.6 Apr 19, 2024
0.2.4 Apr 05, 2024
0.2.3 Mar 21, 2024
0.2.2 Mar 06, 2024
0.2.0 Feb 28, 2024
0.1.8 Feb 15, 2024
0.1.7 Feb 07, 2024
0.1.6 Feb 01, 2024
0.1.5 Jan 25, 2024
0.1.4 Jan 18, 2024
0.1.2 Dec 13, 2023
0.1.1 Dec 07, 2023
0.0.5 Nov 27, 2023
Extras:
Dependencies:
requests
httpx (<0.29,>=0.27)
urllib3
pandas (<2.4.0,>=0.24.2)
certifi
lomond
tabulate
packaging
ibm-cos-sdk (<2.15.0,>=2.12.0)
cachetools