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:
For new tables, pass name="ibm/granite-embedding-278m-multilingual". The default name is still the legacy ibm/slate-125m-english-rtrvr, so tables created with it reload with the same model. Legacy and deprecated IDs (such as ibm/slate-125m-english-rtrvr, sentence-transformers/all-minilm-l6-v2 and sentence-transformers/all-minilm-l12-v2) still work for tables whose stored metadata references them, but they aren’t listed above for new use.

Parameters

The following parameters can be passed to the create method:
You must supply exactly one of project_id or space_id (either as an argument or via its environment variable). Setting both, or neither, raises a ValueError.

Usage Example

First, the watsonx.ai library is an optional dependency, so must be installed separately:
Optionally set environment variables (if not passing credentials to create directly):
Replace the credential placeholders with your provider credentials. The registry variable keeps the API key out of stored embedding configuration. In application code, load its value from environment variables or a secrets manager.