Skip to main content
Generate text embeddings using IBM’s watsonx.ai platform.

Supported Models

You can find a list of supported models at IBM watsonx.ai Documentation. The currently supported model names are:
  • ibm/slate-125m-english-rtrvr
  • ibm/slate-30m-english-rtrvr
  • sentence-transformers/all-minilm-l12-v2
  • intfloat/multilingual-e5-large

Parameters

The following parameters can be passed to the create method:
ParameterTypeDefault ValueDescription
namestr”ibm/slate-125m-english-rtrvr”The model ID of the watsonx.ai model to use
api_keystrNoneOptional IBM Cloud API key (or set WATSONX_API_KEY)
project_idstrNoneOptional watsonx project ID (or set WATSONX_PROJECT_ID)
urlstrNoneOptional custom URL for the watsonx.ai instance
paramsdictNoneOptional additional parameters for the embedding model

Usage Example

First, the watsonx.ai library is an optional dependency, so must be installed seperately:
pip install ibm-watsonx-ai
Optionally set environment variables (if not passing credentials to create directly):
export WATSONX_API_KEY="YOUR_WATSONX_API_KEY"
export WATSONX_PROJECT_ID="YOUR_WATSONX_PROJECT_ID"