mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
CLI: Add "photoprism vision pull" command to download AI models #2400
Labels
No labels
ai
android
api
auth
awesome
bug
bug
ci
cli
config
database
declined
deprecated
docker
docs 📚
documents
duplicate
easy
enhancement
enhancement
enhancement
epic
faces
feedback wanted
frontend
hacktoberfest
help wanted
idea
in-progress
incomplete
index
invalid
ios
labels
live
live
low-priority
macos
member-feature
metadata
mobile
nas
needs-analysis
no-coding-required
no-coding-required
observability
performance
places
please-test
plus-feature
priority
pro-feature
question
raspberry-pi
raw
released
released
released
research
resolved
security
sharing
tested
tests
third-party-issue
thumbnails
upgrade
upstream-issue
ux
vector
video
waiting
won't fix
won't fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/photoprism#2400
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lastzero on GitHub (Sep 14, 2025).
As an Admin/Developer who uses Ollama or other custom models in
vision.yml, I want a single command that automatically downloads all referenced models, so I don't need to execute commands in containers or manually search for TensorFlow model archives.Introduce a new CLI subcommand
photoprism vision pullthat automatically downloads all vision models referenced invision.yml, so admins no longer need to exec into theollamacontainer and runollama pullmanually:For additional context and examples, see:
photoprism-vision-pull-cli-draft.pdf, photoprism-vision-pull-cli-draft.md
https://docs.photoprism.app/developer-guide/vision/caption-generation/
https://docs.photoprism.app/developer-guide/vision/cli/
Default Behavior (no flags/args)
vision.ymlfile, like the other commands do (e.g.vision ls).docker compose exec ollama ollama pull …step. Re-triggering a pull is safe (idempotent).assets/models/<name>/such that each model resides in a subdirectory with the same name.Provider-specific Details
vision.ymlor a sensible default such ashttp://ollama:11434).assets/models/<name>/(or models path configured via existing CLI/env).https://dl.photoprism.app/tensorflow/models/inception-v3-tensorflow2-classification-v2.tar.gz), orProposed Flags (new)
--models name1,name2Only pull the specified models; overrides the full list from vision.yml.--dry-runPrint planned actions without performing any changes; always exit 0.--parallel NLimit concurrent downloads (default 2–4; tuneable).--timeout 5mPer-download timeout.--retries NRetry transient failures N times with backoff.--ollama-uri URLOverride Ollama base URI auto-detected from vision.yml.--tf-repo URLBase URL for TensorFlow models when no direct archive URL is given (default can be https://dl.photoprism.app/tensorflow/models/).--tf-strip-components NStrip leading path components during extraction (tar-like).--checksum SHA256Optional checksum override (also supported per-model in vision.yml).--jsonEmit machine-readable output (one object per model).--forceRe-download and overwrite existing TensorFlow model folders.UX and Output
Ollama service not reachable at <uri>,checksum mismatch,insufficient disk space).Config and Paths
--vision-yaml,--models-path) used by other vision subcommands so behavior is predictable.Security and Networking
vision.ymlor the defaults.Backward Compatibility
docker compose exec ollama …if preferred.Testing Plan (high level)
vision.yml, provider resolution, retry/backoff, checksum verification, and idempotency markers.--forceflag, and handling of checksum mismatches.Documentation Updates
photoprism vision pullcommand instead of executing the "pull" command in the Ollama container.Acceptance Criteria
photoprism vision pullthat appears inphotoprism vision --help.photoprism vision pullwith no args readsvision.ymland attempts to pull all listed models.--modelslimits the operation to the specified subset.--dry-runperforms no network or filesystem changes and exits 0 after printing the plan.--parallel Ncaps concurrent downloads to N.--ollama-urioverrides the Ollama base URI used for pulls.--tf-repooverrides the base used to resolve TensorFlow archive URLs when no direct URL is specified.--timeoutand--retriesaffect both Ollama-triggered pulls (as applicable) and TensorFlow HTTP downloads.--jsonemits structured output that includes model name, provider, action (skipped/pulled/updated), status, and error (if any).--forcere-downloads TensorFlow models even when a completion marker exists.--vision-yamland--models-pathused by other vision subcommands.assets/models/<name>/by default if no alternative models path is set.@longnguyen-tech commented on GitHub (Dec 1, 2025):
Hi, Michael,
This is Long Mau Nguyen, I am super interested in this project.
This is my portfolio.
https://portfolio-long-lemon.vercel.app/
I am looking forward to hearing from you.
Best Regards,
Long
@alexislefebvre commented on GitHub (Dec 10, 2025):
Is it still necessary?
I saw this call in the Ollama logs:
It looks like it would trigger the pull, so that
docker compose exec ollama ollama pull qwen3-vl:4b-instructorphotoprism vision pullwon’t be necessary?Update: nevermind, I deleted the models and started
docker compose exec photoprism photoprism vision run -m labels --count 1 --force, the same log didn’t appear. So I don’t know what happened.