Skip to content

Vision: Keep colons in OpenAI-compatible model IDs #5863 - #5872

Merged
lastzero merged 2 commits into
photoprism:developfrom
somaz94:fix/5863-openai-model-id
Oct 3, 2026
Merged

lastzero merged 2 commits into
photoprism:developfrom
somaz94:fix/5863-openai-model-id

Conversation

@somaz94

@somaz94 somaz94 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Description

With Engine: openai, GetModel split the configured identifier on the first colon and sent only the part before it. IDs like unsloth/Qwen3.5-9B-GGUF:Q4_K_M or OpenAI fine-tunes (ft:gpt-4o-mini-...) reached the server truncated, so every request failed with model not found.

OpenAI-compatible servers match the ID verbatim, so GetModel now returns it unchanged for that engine. Ollama and the other engines still split name:version as before. I added two cases to TestModel_GetModel and updated the vision README.

I tested this in the photoprism/develop:260921-resolute image after make dep-models. go test ./internal/ai/vision/... and go test ./internal/commands -run Vision pass, gofmt and goimports are clean, and golangci-lint reports nothing on the changed lines. With the vision.yml from the issue, photoprism vision ls now lists the model as unsloth/Qwen3.5-9B-GGUF:Q4_K_M.

One thing I left alone: openai.IsCloudModel does not look past the ft: prefix, so a fine-tuned GPT model still gets the self-hosted defaults. Happy to follow up if you want that handled too.

Related Issues

Fixes #5863

Acceptance Criteria

  • New features or enhancements are fully implemented and do not break existing functionality, so that they can be released at any time without requiring additional work
  • Automated unit and/or acceptance tests are included to ensure that changes work as expected and to reduce repetitive manual work
  • Documentation has been / will be updated, especially as it relates to new configuration options or potentially disruptive changes

somaz94 added a commit to somaz94/somaz94 that referenced this pull request Oct 1, 2026
@CLAassistant

CLAassistant commented Oct 3, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@lastzero
lastzero merged commit a75a360 into photoprism:develop Oct 3, 2026
1 check passed
@lastzero lastzero added please-test Ready for manual testing & feedback ai Artificial Intelligence, Machine Learning (ML) labels Oct 3, 2026
@lastzero

lastzero commented Oct 3, 2026

Copy link
Copy Markdown
Member

Thank you, @somaz94! Your fix is merged and part of the latest development build. Model IDs with colons, such as quant tags, ft: fine-tunes, Ollama /v1 tags, and OpenRouter :free variants, now reach OpenAI-compatible services unchanged.

While testing it, we made a few related refinements on top:

  • Models without an Engine: A model that only sets RequestFormat: openai now gets the same treatment, so its ID is also sent unchanged, along with any configured Org, Project, and Tier values.
  • Ollama tags: Models that set RequestFormat: ollama without an Engine now send name:version, e.g. gemma3:27b instead of falling back to gemma3:latest.
  • Long IDs: Model IDs are still limited to 64 characters, and a warning is now logged when one has to be shortened.
  • Logging: Failed Ollama requests and invalid labels are now logged once per model until a request succeeds, instead of once per picture.

An explicit Engine setting still takes precedence over RequestFormat. Thanks again for the clear report and the clean patch!

@graciousgrey graciousgrey added released Available in a stable release and removed please-test Ready for manual testing & feedback labels Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Artificial Intelligence, Machine Learning (ML) released Available in a stable release

Projects

Status: Release 🌈

Development

Successfully merging this pull request may close these issues.

Bug: Llama-Server models with a colon (or quant in the name) cannot be called

4 participants