clip.cpp
A dependency-free C and C++ implementation of OpenAI's CLIP model for image and text embeddings, built on GGML with 4-bit, 5-bit and 8-bit quantization support.
clip.cpp is a from-scratch C and C++ implementation of CLIP, the OpenAI model used for tasks such as semantic image search and zero-shot image labeling. It is built on GGML and has no other dependencies, and supports 4-bit, 5-bit and 8-bit quantized models; a 4-bit quantized model can be as small as about 86 MB.
The library supports text-only, vision-only and two-tower model variants of CLIP models from both OpenAI and LAION, so a single modality can be used where that is all an application needs, such as inside an encoder for a larger multimodal model. Its short startup time compared to larger machine-learning frameworks makes it suited to serverless deployments where cold starts matter.
It also includes a dependency-free Python binding that needs nothing beyond the Python standard library, without requiring NumPy, TensorFlow, PyTorch or ONNX.