--- title: OpenCLIP sidebarTitle: OpenCLIP --- import { PyEmbeddingOpenclipSetup, PyEmbeddingOpenclipTextSearch, PyEmbeddingOpenclipImageSearch, PyEmbeddingOpenclipSiglip, } from '/snippets/integrations.mdx'; We support CLIP model embeddings using the open source alternative, [open-clip](https://github.com/mlfoundations/open_clip) which supports various customizations. It is registered as `open-clip` and supports the following customizations: | Parameter | Type | Default Value | Description | |---|---|---|---| | `name` | `str` | `"ViT-B-32"` | The name of the model. | | `pretrained` | `str` | `"laion2b_s34b_b79k"` | The name of the pretrained model to load. | | `device` | `str` | `"cpu"` | The PyTorch device to run the model on, such as `"cpu"` or `"cuda"`. | | `batch_size` | `int` | `64` | The number of images to process in a batch. | | `normalize` | `bool` | `True` | Whether to normalize the output embeddings to unit length. | This embedding function accepts image files, encoded image bytes, and URLs at ingestion. For vector search, pass text, a PIL image, or a path object such as `Path("frame.jpg")`. A string query is always treated as text. LanceDB supports ingesting images directly from accessible links. {PyEmbeddingOpenclipSetup} Now we can search using text from both the default vector column and the custom vector column {PyEmbeddingOpenclipTextSearch} Because we're using a multimodal embedding function, we can also search using images {PyEmbeddingOpenclipImageSearch} ## Search video frames with SigLIP {#search-video-frames-with-siglip} Use the [SigLIP SO400M checkpoint](https://huggingface.co/timm/ViT-SO400M-14-SigLIP-384) to generate 1,152-dimensional vectors for images and text. Install OpenCLIP and the tokenizer dependencies. ```bash pip install "lancedb[clip]" "transformers[sentencepiece]" ``` The Python example starts with an extracted frame named `frame.jpg`. LanceDB Embedded fills the vector column when you add the frame. {PyEmbeddingOpenclipSiglip} With `AsyncTable`, use `await table.search(frame, query_type="vector")` to build the image query. Use the same model and preprocessing for ingestion and search. If you switch from another embedding pipeline, regenerate the stored vectors unless you have verified compatibility.