← Back to Leaderboard
Copenai

openai/CLIP

CLIP dual encoders for image–text matching and zero-shot classification

View on GitHub ↗
Open-Weight ModelQuickstart ↓
Engineering Health (Methodology)
B · 55/100
Maintenance Activity
● Updated 8mo ago
Latest Release
Rolling commits (main)
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance6/35
Fork Adoption23/25
Release Cadence6/20
License Clarity20/20
Local AIGPUAPI
Total Stars
★ 34,692
24h Growth
+2
7d Growth
+30
Forks
4,068

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

openai/CLIP Star History (2021-01-04 - 2026-12-04) ALL-TIME STAR HISTORY (2021-01 – 2026-12) +34.7k in 2160d · avg +16/day 36.6k 18.3k 0 2021-01-04: ★ 12021-05-15: ★ 3,4212021-09-25: ★ 4,5772022-02-05: ★ 5,8352022-06-18: ★ 7,9272022-10-29: ★ 10,0542023-03-11: ★ 12,2102023-07-22: ★ 16,0422023-12-02: ★ 18,7142024-04-13: ★ 21,2892024-08-24: ★ 23,7152025-01-04: ★ 26,2012025-05-17: ★ 28,4662025-09-27: ★ 30,3612026-02-07: ★ 32,1432026-06-20: ★ 33,6122026-12-04: ★ 34,692 ★ 34.7k 2021-01 2023-12 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

CLIP is a contrastively trained dual encoder. The vision and text branches map their inputs independently into a shared embedding space. encode_image() and encode_text() expose the features directly, while the joint forward call returns image-to-text and text-to-image logits from scaled cosine similarity. Because the branches run independently, an application can precompute one side and encode only new inputs at query time.

The Python package lives under clip/, with setup.py, hubconf.py, notebooks/, and tests/ at the root. PyTorch runs the model, TorchVision supplies the image transform returned by the loader, and ftfy and regex support text tokenization; packaging and tqdm are also declared dependencies. The integration surface is a set of in-process Python calls, not a network protocol or plugin system.

Key Capabilities & Differentiators

clip.load() accepts a model name such as ViT-B/32 or a local checkpoint path, and clip.available_models() exposes the available names. clip.tokenize() converts one or more strings to a LongTensor with a default context length of 77 tokens. For zero-shot classification, encode prompts such as “a photo of a {class}” and rank them against the image embedding; there is no task-specific classifier to train in that workflow.

The CIFAR-100 examples cover two distinct evaluation paths: prompt-based top-k ranking and supervised logistic regression on frozen image features. The latter uses scikit-learn and calls for choosing the regularization setting on a validation split. A reported zero-shot ImageNet result matched the original ResNet-50 without using the 1.28 million labeled training examples from that benchmark. That is a benchmark-specific result, not a guarantee of accuracy on other datasets.

Trade-offs & Limitations

Independent encoders make it possible to cache prompt vectors or index image embeddings, but CLIP does not supply the retrieval storage or service around those vectors. Zero-shot rankings depend on prompt wording and the candidate set. Softmax over that set gives relative scores, not calibrated confidence or a dependable signal that none of the labels applies. The model ranks supplied text; it does not generate captions.

The original package is a direct fit for reproducing OpenAI CLIP examples or consuming a named checkpoint through a small PyTorch API. OpenCLIP offers a wider range of independently trained models, including ViT-G/14; the Hugging Face implementation is an alternative for applications already built on Transformers. Neither choice makes checkpoint swaps transparent: verify the input transforms and prompts, and regenerate cached embeddings when the model changes.

Hardware & Deployment Guide

Provision Python with a compatible PyTorch and TorchVision pair, then install the project as a Python package. PyTorch 1.7.1 or later is the documented baseline; the sample CUDA 11.0 setup is an installation example, not a requirement for every host. clip.load() defaults to the first available CUDA device or falls back to CPU; callers can select the device explicitly and opt into JIT loading.

Named checkpoints download as needed. For an offline deployment, stage the dependencies and checkpoint in advance and load the weights by local path. The API is a Python inference interface: teams that need HTTP serving or container packaging must supply them. There is no listed GitHub release to anchor reproducible installs, so pin the repository revision, checkpoint, and resolved dependencies. Benchmark peak memory and latency at the intended batch size and concurrency.

Scoring: the dual-encoder forward pass returns image-to-text and text-to-image logits based on scaled cosine similarity.
Checkpoint loading: clip.available_models() lists named models; clip.load() accepts a listed name such as ViT-B/32 or a local checkpoint path.
Input contract: the loader returns the matching TorchVision image transform, and clip.tokenize() defaults to a 77-token context.
Reusable features: encode_image() and encode_text() support independent batching and caching for similarity ranking.
Evaluation paths: CIFAR-100 examples cover prompt-based zero-shot classification and a scikit-learn logistic-regression probe on frozen features.
Runtime: local PyTorch inference supports CPU or CUDA, with optional JIT loading and non-JIT loading by default.
Best For

Local baselines for prompt-driven image classification, image–text retrieval prototypes, and frozen visual feature extraction in PyTorch.

Skip If

You need generated captions, calibrated confidence or rejection of unknown classes out of the box, or a ready-to-run serving stack.

Reviewed on 2026-12-04 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

Local AIGPUAPI
$ conda install --yes -c pytorch pytorch=1.7.1 torchvision cudatoolkit=11.0
$ pip install ftfy regex tqdm
$ pip install git+https://github.com/openai/CLIP.git

Comparison vs. Top Voice, Vision & Video Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
CLIP ★34.7k+30Jupyter NotebookMITCLIP dual encoders for image–text matching and zero-shot classification
whisper114.1k+548PythonMITLocal encoder-decoder Transformer for multilingual speech transcription and tran
lingbot-map19.5k+365PythonApache-2.0A Geometric Context Transformer for streaming 3D reconstruction from video
ChatTTS40.1k+24PythonAGPL-3.0Local autoregressive TTS for expressive Chinese and English dialogue

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/openai/CLIP.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

openai/CLIP Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about CLIP

How do I integrate CLIP without re-encoding the same prompts for every image?

Encode and normalize the text prompts once with encode_text(). For each image batch, apply the transform returned by clip.load(), run encode_image(), normalize the features, and rank candidates by dot product. If you change the checkpoint, rebuild both sets of embeddings so they remain in the same space.

Is a GPU required, and how should I size memory?

No. clip.load() supports CPU and CUDA. There is no fixed VRAM figure to plan around: benchmark the chosen checkpoint at your intended batch size and concurrency, measuring peak memory and end-to-end latency. Include preprocessing and device transfer in the test, not just the model call.

Can I self-host CLIP for commercial use?

The repository is MIT-licensed, and the loader accepts a local checkpoint path. For commercial self-hosting, retain the applicable license notices when redistributing the software and review the model card and any terms that apply to the exact checkpoint and data you use. The repository license alone does not establish rights to third-party material.

When should I choose OpenCLIP or Hugging Face Transformers instead?

Use the original package to reproduce the OpenAI CLIP examples or integrate its small PyTorch API directly. Evaluate OpenCLIP if you need a wider range of independently trained checkpoints, including ViT-G/14. Consider Hugging Face's implementation if your application already uses Transformers. Before switching checkpoints, revalidate prompts and preprocessing, and rebuild any persisted embeddings.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining openai/CLIP? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature openai/CLIP on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare