Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 1.8.0 instead.

📦 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)

Metadata

Release files for ibm-watsonx-ai 1.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ibm-watsonx-ai 1.7.3
File Size Uploaded
ibm_watsonx_ai-1.7.3.tar.gz 739.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ibm-watsonx-ai 1.7.3
File Interpreter ABI Platform
ibm_watsonx_ai-1.7.3-py3-none-any.whl Python 3 none any Details

Total release size: 1.9 MB

Release files / ibm_watsonx_ai-1.7.3.tar.gz

Download URL ibm_watsonx_ai-1.7.3.tar.gz
Size 739.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6eed380414ffe9b3276be1a356f87fca33348aaefd0dae0ede9fe7e909977425
BLAKE2b-256 checksum
How to use checksums
869f53224292fee620a8a3a80d93449964324b3880157a304543705f8d3a6cd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / ibm_watsonx_ai-1.7.3-py3-none-any.whl

Download URL ibm_watsonx_ai-1.7.3-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e2d59d8792e6782cb4f8fe1d99042608f16eecb6bc0bff4a448bbf282c7c2808
BLAKE2b-256 checksum
How to use checksums
909a53b25afe30dc26d1c607f2a1d650308b9f94a2e197a194d417c2dfe56e2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

1.8.0

2 release files

This release

1.7.3 This release

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.6.3

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.14

2 release files

1.5.12

2 release files

1.5.11

2 release files

1.5.10

2 release files

1.5.9

2 release files

1.5.8

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.9

2 release files

1.4.7

2 release files

1.4.6

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.40

2 release files

1.3.39

2 release files

1.3.38

2 release files

1.3.36

2 release files

1.3.34

2 release files

1.3.33

2 release files

1.3.32

2 release files

1.3.31

2 release files

1.3.26

2 release files

1.3.25

2 release files

1.3.23

2 release files

1.3.20

2 release files

1.3.19

2 release files

1.3.18

2 release files

1.3.13

2 release files

1.3.12

2 release files

1.3.11

2 release files

1.3.8

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.3

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.2

2 release files

1.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page