RepoClarifaiClarifaipublished Aug 23, 2023seen 5d

Clarifai/examples

Jupyter Notebook

Open original ↗

Captured source

source ↗
published Aug 23, 2023seen 5dcaptured 13hhttp 200method plain

Clarifai/examples

Description: Examples for Clarifai Python SDK and Integrations. Give the repo a star ⭐

Language: Jupyter Notebook

License: NOASSERTION

Stars: 20

Forks: 5

Open issues: 1

Created: 2023-08-23T19:35:37Z

Pushed: 2026-05-07T14:16:59Z

Default branch: main

Fork: no

Archived: no

README: !image

Clarifai Python SDK and Integrations Examples

This is a collection of examples for the clarifai-python SDK and Integrations done with Clarifai SDK. Use these examples to learn Clarifai and build your own robust and scalable AI applications.

Experience the power of Clarifai in building Computer Vision , Natual Language processsing , Generative AI applications.

Website | Schedule Demo | Signup for a Free Account | API Docs | Clarifai Community | Python SDK Docs | Examples | Colab Notebooks | Discord

Setup

  • Sign up for a free account at clarifai and set your PAT key.
  • You can generate PAT key in the Personal settings -> Security section
  • Export your PAT as an environment variable.
export CLARIFAI_PAT={your personal access token}
  • Explore and run the examples in this repo.

Usage

The examples are organized into several folders based on their category. A quick example below,

from clarifai.client.dataset import Dataset
dataset = Dataset(user_id="user_id", app_id="app_id", dataset_id="dataset_id")
dataset.upload_dataset(task="text_clf", split="train", module_dir="path_to_imdb_reviews_module")

Compute Orchestration and Agentic Examples

| Function | Link | Description | Link to Docs | | ----------- | ----------- | ----------- | ----------- | | Basics | [Basics](basics/basics.ipynb) | Basic Functionalities (create, list, patch, delete) of SDK App, Dataset, Input & Model Classes | ![Open in Colab](https://colab.research.google.com/github/Clarifai/examples/blob/main/basics/basics.ipynb) | | Compute Orchestration | [CRUD Operations](ComputeOrchestration/crud_operations.ipynb) | Basic Functionalities (create, list, get, delete) of Compute Orchestration Classes - ComputeCluster, Nodepool, Deployment | ![Open in Colab](https://colab.research.google.com/github/Clarifai/examples/blob/main/ComputeOrchestration/crud_operations.ipynb) | | Model Predict | [Predict](models/model_predict/README.md) | Call predict of any model in a [Python native way](models/model_predict/clarifai_llm.py) with our SDK. See many more examples [here](models/model_predict/) | Docs for Python/Javascript | | | [Using OpenAI Client](models/model_predict/openai_llm.py) | Use the openAI client to call openAI-compatible models in Clarifai. See many more examples [here](models/model_predict/). | Docs for Pyhon/Typescript | | | [Using OpenAI Client on Node.js](nodejs/openai/getTextResponse.js) | Use the OpenAI node client to call OpenAI-compatible models in Clarifai. See many more examples [here](nodejs/openai/) | Docs for Typescript | | | [Using Vercel AI SDK on Node.js](nodejs/vercel-ai-sdk/getTextResponse.js) | Use the Vercel AI SDK with OpenAI provider to call OpenAI-compatible models in Clarifai. See many more examples [here](nodejs/vercel-ai-sdk/) | Docs for Typescript | | | [Using LiteLLM](models/model_predict/litellm_llm.py) | Use Litellm to call openAI-compatible models in Clarifai. See many more examples [here](models/model_predict/) | | | | Legacy Models | Call predict of any model not uploaded to compute orchestration with our SDK | Docs | | Model Upload | Model Upload | Upload custom models, MCP tools, or any python function you want. See our new runner examples repo for compute orchestration with many examples covered! | | | MCP Tools | MCP Tool Examples | Upload custom MCP tools and have them fully hosted in Clarifai to use with any MCP client. | | | Agent Toolkits | CrewAI Examples | Build agents with CrewAI toolkits on top of Clarifai LLMs and MCP tools. | Video | | | Google ADK | Create agetns with Google ADK leveraging LLMs and tools powered by Clarifai | | | | LLM + MCP Examples | Simple python native examples of building agents covering function calls, JSON parsing and more | |

SDK Notebooks

| Function | Notebook | Description | Open in Colab | | ----------- | ----------- | ----------- | ----------- | | Basics | [Basics](basics/basics.ipynb) | Basic Functionalities (create, list, patch, delete) of SDK App, Dataset, Input & Model Classes | ![Open in Colab](https://colab.research.google.com/github/Clarifai/examples/blob/main/basics/basics.ipynb) | | Compute Orchestration | [CRUD Operations](ComputeOrchestration/crud_operations.ipynb) | Basic Functionalities (create, list, get, delete) of Compute Orchestration Classes - ComputeCluster, Nodepool, Deployment | ![Open in Colab](https://colab.research.google.com/github/Clarifai/examples/blob/main/ComputeOrchestration/crud_operations.ipynb) | | Concepts | [Concept Management](concepts/concept_management.ipynb) | Basic Functionalities (add,…

Excerpt shown — open the source for the full document.