Clarifai is an AI Platform that provides the full AI lifecycle ranging from data exploration, data labeling, model training, evaluation, and inference.This example goes over how to use LangChain to interact with
Clarifai models. Text embedding models in particular can be found here.
To use Clarifai, you must have an account and a Personal Access Token (PAT) key.
Check here to get or create a PAT.
Dependencies
Imports
Here we will be setting the personal access token. You can find your PAT under settings/security in your Clarifai account.Input
Create a prompt template to be used with the LLM Chain:Setup
Set the user id and app id to the application in which the model resides. You can find a list of public models on clarifai.com/explore/models You will have to also initialize the model id and if needed, the model version id. Some models have many versions, you can choose the one appropriate for your task.Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.