mirror of
https://github.com/photoprism/photoprism.git
synced 2026-03-02 22:57:18 -05:00
AI: Add support for OLLAMA_API_KEY and OLLAMA_BASE_URL to configure Ollama #2447
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#2447
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 (Dec 3, 2025).
Originally assigned to: @graciousgrey, @omerdduran on GitHub.
As an Ollama Cloud user, I want to be able to set my API key via
OLLAMA_API_KEYand the service base URL viaOLLAMA_BASE_URL, rather than having to set them manually in myvision.ymlfile.👉 https://docs.ollama.com/cloud#cli
@lastzero commented on GitHub (Dec 4, 2025):
@graciousgrey @omerdduran These changes should ensure that the built-in
captionmodel default/example only runs manually and isn't flagged as a default model. This is to prevent the standard vision config from always sending requests tohttp://ollama:11434/api/generateduring or after indexing, since most users either won't have an Ollama instance, or if they have one, it might use a different URL. Please make sure to double-check that this works! Alternatively, we can remove the built-in caption model default/example.@lastzero commented on GitHub (Dec 10, 2025):
My last commit includes the following changes and improvements:
OLLAMA_BASE_URLvar expansion: Ollama engine now resolves${OLLAMA_BASE_URL:-http://ollama:11434}/api/generate, trims trailing slashes, and only switches to cloud defaults whenOLLAMA_BASE_URL=https://ollama.com. An API key alone no longer forces cloud usage.initEnvUrl()/ensureEnv(), so placeholders expand reliably and unset values get the local default instead of leaking${…}into requests.Updated docker images to seedOLLAMA_BASE_URL="http://ollama:11434"for convenience; vision tests and fixtures now use the placeholder form.${OLLAMA_BASE_URL}/api/generate.@lastzero commented on GitHub (Dec 11, 2025):
You can use our preview build to test this: