Offline Usage
To enable LibrePhotos to run its machine learning features offline, you can manually download and place the required models by following the steps outlined below. This guide assumes that you have access to the Internet initially to download the models and then configure LibrePhotos to run in an offline environment.
Step 1: Download the Models Manuallyโ
Manually download the necessary models from their respective URLs. Below is a list of models used by LibrePhotos, along with their download links:
- clip_vit_b32 (Semantic search)
- Vision model:
https://huggingface.co/Xenova/clip-vit-base-patch32/resolve/main/onnx/vision_model.onnx - Text model:
https://huggingface.co/Xenova/clip-vit-base-patch32/resolve/main/onnx/text_model.onnx - Tokenizer:
https://huggingface.co/Xenova/clip-vit-base-patch32/resolve/main/tokenizer.json
- Vision model:
- mobileclip_s2 (Tagging โ default model)
- Vision model:
https://huggingface.co/Xenova/mobileclip_s2/resolve/main/onnx/vision_model.onnx - Text model:
https://huggingface.co/Xenova/mobileclip_s2/resolve/main/onnx/text_model.onnx - Tokenizer:
https://huggingface.co/Xenova/mobileclip_s2/resolve/main/tokenizer.json
- Vision model:
- lfm2_vl_450m (Captioning)
https://huggingface.co/onnx-community/LFM2.5-VL-450M-ONNX/resolve/main/onnx/vision_encoder_q4.onnxhttps://huggingface.co/onnx-community/LFM2.5-VL-450M-ONNX/resolve/main/onnx/vision_encoder_q4.onnx_datahttps://huggingface.co/onnx-community/LFM2.5-VL-450M-ONNX/resolve/main/onnx/embed_tokens_q4.onnxhttps://huggingface.co/onnx-community/LFM2.5-VL-450M-ONNX/resolve/main/onnx/embed_tokens_q4.onnx_datahttps://huggingface.co/onnx-community/LFM2.5-VL-450M-ONNX/resolve/main/onnx/decoder_model_merged_q4.onnxhttps://huggingface.co/onnx-community/LFM2.5-VL-450M-ONNX/resolve/main/onnx/decoder_model_merged_q4.onnx_data- Tokenizer:
https://huggingface.co/onnx-community/LFM2.5-VL-450M-ONNX/resolve/main/tokenizer.json
- siglip2 (Tagging) (optional โ only if using SigLIP 2 tagging model)
- Vision model:
https://huggingface.co/onnx-community/siglip2-base-patch16-384-ONNX/resolve/main/onnx/vision_model.onnx - Text model:
https://huggingface.co/onnx-community/siglip2-base-patch16-384-ONNX/resolve/main/onnx/text_model.onnx - Tokenizer:
https://huggingface.co/onnx-community/siglip2-base-patch16-384-ONNX/resolve/main/tokenizer.model
- Vision model:
- buffalo_sc (Face recognition โ default model)
- URL:
https://github.com/deepinsight/insightface/releases/download/v0.7/buffalo_sc.zip - Only download the model selected in Site Settings โ Face Recognition Model. The other options use the same release, e.g.
buffalo_s.zip,buffalo_m.zip,buffalo_l.zip,antelopev2.zip.
- URL:
Step 2: Place the Models in the Correct Locationโ
Once the models are downloaded, place them in the following directory:
<LibrePhotos Media Root Directory>/data_models/
MEDIA_ROOT is not something you set directly โ it is derived from BASE_DATA (default /), so inside the container it is always /protected_media. On the host it is whichever directory you mounted to /protected_media. With the standard docker-compose install that is ${data}/protected_media, which defaults to ./librephotos/data/protected_media/, so the models go in ./librephotos/data/protected_media/data_models/.
- clip_vit_b32 files -> Place as
<MEDIA_ROOT>/data_models/clip_vit_b32/vision_model.onnx,.../text_model.onnxand.../tokenizer.json - mobileclip_s2 files -> Place as
<MEDIA_ROOT>/data_models/mobileclip_s2/vision_model.onnx,.../text_model.onnxand.../tokenizer.json - lfm2_vl_450m files -> Place all seven in
<MEDIA_ROOT>/data_models/lfm2_vl_450m/under their own names. The.onnx_datafiles hold the weights the small.onnxgraphs point at, so the names must not change. - siglip2 vision_model.onnx -> Place as
<MEDIA_ROOT>/data_models/siglip2/vision_model.onnx - siglip2 text_model.onnx -> Place as
<MEDIA_ROOT>/data_models/siglip2/text_model.onnx - siglip2 tokenizer.model -> Place as
<MEDIA_ROOT>/data_models/siglip2/tokenizer.model - buffalo_sc.zip -> Unpack into
<MEDIA_ROOT>/data_models/face_recognition/models/buffalo_sc/(the folder should contain the.onnxfiles)
Step 3: Verify Model Placementโ
Ensure that all models are correctly placed and unpacked in their respective directories. The structure should look something like this:
data_models/
โโโ clip_vit_b32/
โ โโโ vision_model.onnx
โ โโโ text_model.onnx
โ โโโ tokenizer.json
โโโ mobileclip_s2/
โ โโโ vision_model.onnx
โ โโโ text_model.onnx
โ โโโ tokenizer.json
โโโ lfm2_vl_450m/
โ โโโ vision_encoder_q4.onnx
โ โโโ vision_encoder_q4.onnx_data
โ โโโ embed_tokens_q4.onnx
โ โโโ embed_tokens_q4.onnx_data
โ โโโ decoder_model_merged_q4.onnx
โ โโโ decoder_model_merged_q4.onnx_data
โ โโโ tokenizer.json
โโโ siglip2/
โ โโโ vision_model.onnx
โ โโโ text_model.onnx
โ โโโ tokenizer.model
โโโ face_recognition/
โโโ models/
โโโ buffalo_sc/
Step 4: Turn Off the Online Map Servicesโ
Even with every model stored locally, two settings still reach the Internet by default:
- Site Settings โ Map Tiles defaults to PhotoPrism (default), which loads the map background from
https://cdn.photoprism.app/maps/default.jsonevery time a map is shown. The OpenStreetMap option is not an offline alternative either โ it fetches tiles fromtile.openstreetmap.organd fonts fromfonts.openmaptiles.org. On an offline install, select None (hide map), which turns off map rendering and makes no external requests. - Site Settings โ Map Provider (reverse geocoding) defaults to Nominatim (OpenStreetMap) and calls the public Nominatim service during scans to turn GPS coordinates into place names. Without Internet access these calls fail and are only logged as a warning, so photos keep their coordinates but get no place names and the Places albums stay empty. There is no offline geocoding provider, so this feature is unavailable offline.
Step 5: Run LibrePhotosโ
You can now run LibrePhotos without an active Internet connection for the machine learning features. The application will use the models you manually downloaded and placed in the data_models directory.