The Clarifai Python SDK provides a client library for interacting with the Clarifai platform, enabling developers to build and deploy AI models for computer vision, natural language processing, and multimodal applications. The current version is 12.4.0, and it maintains a rapid release cadence with frequent updates.
pip install clarifaiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the Clarifai client, load a public image recognition model, and perform a prediction using an image URL. It emphasizes using environment variables for authentication and shows how to process the prediction results.
Migrate all `from clarifai.rest import ClarifaiApp` imports and related usage to `from clarifai.client import ClarifaiClient`. Client initialization and method calls have significantly changed.
Always use a Personal Access Token (PAT) for new applications. Set it as an environment variable (`CLARIFAI_PAT`) or pass it directly when initializing `ClarifaiClient(pat='YOUR_PAT')`. Ensure the PAT has the necessary scopes for your operations.
Before calling a model's `predict` method, construct an `Input` object (e.g., `Input(url='...')`, `Input(base64='...')`, `Input(file_bytes=...)`) and pass a list of these objects: `model.predict(inputs=[input_obj_1, input_obj_2])`.
No dependency data recorded yet.