Python SDK Notebook Examples | Clarifai Docs

Learn how to use the Clarifai Python SDK

Here are comprehensive step-by-step walkthroughs within Jupyter or Colab notebooks that showcase how to harness the power of the Clarifai SDKs.

Notebook Description Open in Colab
Basics Create, manage, update, and delete Clarifai resources, including apps, datasets, inputs, and models
CLI Clarifai provides a user-friendly command line interface (CLI) that simplifies various tasks
Compute Orchestration Use our Compute Orchestration system to create, get, list, and delete compute clusters, nodepools, and model deployments.
Data Utils Get a range of multimedia data utilities designed to streamline your data management and processing operations.
- Image annotation loader — A comprehensive framework for loading, exporting, and analyzing different annotated datasets.
- Data ingestion pipelines — Load text files (PDF, DOC, etc.), transform and chunk the content, and upload it to the Clarifai platform.
- Multimodal dataloader
- Ready-to-use foundational pipelines
RAG Use Retrieval Augmented Generation (RAG) to improve Large Language Models (LLMs)
Concept management Establish a hierarchical relationship between concepts using concept relations
Datasets basics Merge datasets and list inputs of a dataset
Dataset export Export datasets from a Clarifai app
Dataset upload Upload datasets into a Clarifai app
Inputs upload Upload inputs with various types of data, such as metadata, geo info, or bounding box annotations, into a Clarifai app
Models predict (inference) Get predictions with text, image, video, and audio inputs with different types of models
Evaluation for embedding classification Evaluate the performance of embedding classifier models
Evaluation for text classification Evaluate the performance of text classifier models
Evaluation for visual classification Evaluate the performance of visual classifier models
Evaluation for visual detection Evaluate the performance of visual detector models
Training for image classification Train image classifier models
Training for image detection Train image detector models
Training for image segmentation Train image segmentation models
Training for text classification Train text classifier models
Training for transfer learn Train transfer learn models
Model upload - Upload image classifiers
- Upload image detectors
- Upload LLMs
- Upload speech recognition models
Cross-modal search Perform vector search over your own data
Create workflows Create various types of workflows
Export workflows Download a YAML file representing your workflow
Patch workflows Perform patch operations by merging, removing, or overwriting data

Integration Examples

Notebook Description Open in Colab
LangChain
Agent: Doc-retrieval using ReAct Docstore
Agent: Retrieval QA using Clarifai vector store with conversation memory
Chains: Using PostgreSQL database with LangChain
Chains: Prompt templates and chains
Chains: Retrieval QA Chain with Clarifai vector store
Chains: Router Chain with Clarifai SDK prompt templates
Unstructured.io
S3 data ingestion
GitHub data ingestion
DropBox data ingestion