Clarifai 11.4: Faster Model Deployment & Inference with Python SDK | Clarifai Blog

This blog post focuses on new features and improvements. For a comprehensive list, including bug fixes, please see the release notes.

A new Python-based method for model uploading and inference

We have completely revamped the way models are uploaded and used for inference with a new Python-based method that prioritizes simplicity, speed, and developer experience.

Built with a Python-first, user-centric design, this flexible approach simplifies the process of working with models. It allows users to focus more on building and iterating, and less on navigating API mechanics. The new method streamlines inference, accelerates development, and significantly improves overall usability.

Model Upload

The Clarifai Python SDK now makes it even easier to upload custom models. Whether you're using a pre-trained model from Hugging Face or OpenAI, or one you've developed from scratch, integration is seamless. Once uploaded, your model can immediately take advantage of Clarifai's robust platform features.

After import, your model is automatically deployed and ready for use. You can evaluate it, connect it with other models and agent operators in a workflow, or serve inference requests directly.

As part of this release, we’ve significantly simplified how you define the model.py file for custom model uploads. The new ModelClass pattern allows you to implement predict, generate, and streaming methods without the need for extra abstraction or boilerplate. You can get started in just a few lines of code.

Here’s a quick example: a simple method that appends “Hello World” to any input text, with built-in support for different types of streaming responses. Check out the full documentation here.

Inference

The new inference approach offers an efficient, scalable, and simplified way to run predictions with your models.

Designed with a Python-first, developer-friendly focus, it reduces complexity so you can spend more time building and iterating, and less time dealing with low-level API details.

Below is an example of how to make a client-side predict call that corresponds to the predict method defined in the previous section. Checkout the docs here.

New Published Models

Enhanced the Playground experience

Enhanced the Control Center

Improved the Community platform

Additional Changes

Ready to start building?

With this Python-first release, uploading and running inference on your custom models is now faster, simpler, and more intuitive than ever. Whether you're integrating a pre-trained model or deploying one you've built from scratch, the Clarifai Python SDK gives you the tools to move from prototype to production with minimal overhead.

Explore the documentation and start building today.