LlamaIndex¶
IBM integration with LlamaIndex is available under IBM and LlamaIndex LLM integration documentation, while for embedding integration you may visit IBM and LlamaIndex Embedding integration documentation.
Note
The llama-index-llms-ibm==0.2.x package relies on version 0.11.x of the llama-index-core package and ibm_watsonx_ai in version >=1.1.x.
Installation and Setup¶
Install the integration package with
pip install -qU llama-index-llms-ibm
Get an IBM watsonx.ai api key and set it as an environment variable (WATSONX_APIKEY)
import os
os.environ["WATSONX_APIKEY"] = watsonx_api_key
LLMs¶
See detailed example how to load a model in the following link
from llama_index.llms.ibm import WatsonxLLM
Embedding Models¶
Install the integration package with
pip install -qU llama-index-embeddings-ibm
Note
The llama-index-embeddings-ibm==0.1.x package relies on version 0.11.x of the llama-index-core package and ibm_watsonx_ai in version >=1.0.x.
Usage example:
from llama_index.embeddings.ibm import WatsonxEmbeddings
More details can be found here
API reference¶
For detailed documentation of all IBM watsonx.ai features and configurations head to the API reference