--- id: clarifai-protocol version: "0.0.62" license: Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) license_treatment: permissive maintenance: active --- # clarifai-protocol — Clarifai Python Runner Protocol License: permissive · Maintenance: active · Downloads: 135.6K/mo ## What it is and what it does clarifai-protocol is the internal communication protocol layer for Clarifai's Python runner infrastructure. It handles serialization and deserialization of requests and responses between runner models and the Clarifai API, built on gRPC foundations. The package also provides request lifecycle management, including the ability to track and cancel in-flight requests when users abort operations. The protocol supports request ID tracking and abort callbacks, allowing custom models to register handlers that fire when requests are cancelled or connections drop. This is particularly useful when models call external inference servers—they can pass the request ID to those servers and abort them cleanly when the user cancels. The package is designed to be thread-safe and runs abort callbacks in background threads to avoid blocking the main protocol flow. Use it for: - Building custom Clarifai models that need to handle request cancellation when calling external inference servers - Integrating with Clarifai runners to enable graceful abort of long-running inference tasks - Tracking request IDs for debugging and monitoring model execution within the Clarifai platform - Implementing idempotent cleanup logic when requests are cancelled or connections are lost - Coordinating cancellation between Clarifai and downstream inference services like sglang or similar ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides the protocol layer for Clarifai's Python runners to communicate with the Clarifai API, including request cancellation support and optional auto-annotation features. Yes, if you are building models for the Clarifai platform or using clarifai SDK. The package is actively maintained, carries no known vulnerabilities, and uses a permissive Apache 2.0 license. Install friction is moderate due to compiled wheels, but platform coverage is broad. If you are not building Clarifai runners, this is likely a transitive dependency and not a direct choice. ## Install pip install clarifai-protocol uv add clarifai-protocol poetry add clarifai-protocol ## Installing clarifai-protocol Before you install: Medium install friction due to compiled wheels across multiple Python versions and platforms. Actively maintained with recent release activity. Depends on clarifai, clarifai-grpc, and psutil. License in practice: Apache License 2.0 (permissive) allows free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects. Quickstart: pip install clarifai-protocol from clarifai_protocol import get_request_id, register_abort_callback register_abort_callback(lambda req_id: print(f"Cancelled: {req_id}")) req_id = get_request_id() Requires Python 3.9 or later. Optional auto-annotation extra requires av and shapely dependencies. Verify before relying: - Whether the package is intended for direct use or only as a transitive dependency of clarifai SDK - Performance characteristics and latency overhead of request cancellation callbacks - Thread-safety guarantees under high-concurrency workloads ## Package facts - License: Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 135.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags clarifai runner protocol, clarifai api communication, request cancellation callbacks, clarifai inference server, model request handling, clarifai grpc protocol, abort request handling, grpc-protocol, request-cancellation, clarifai-ecosystem [View on SkillFed](https://skillfed.io/packages/clarifai-protocol) · [View on PyPI](https://pypi.org/project/clarifai-protocol/)