Skip to content

Auto-tagging silently fails with Gemini: logprobs is always requested, but Gemini rejects it #143

Description

@Mikrdk

Hi! First off — thanks for wardrowbe, it's a great project and I have it running happily on a Synology NAS.

What happened: I connected wardrowbe to Google's Gemini (the free tier, via their OpenAI-compatible endpoint). Uploaded items got a nice AI description, but all the structured tags (type, colors, material, etc.) stayed empty, and nothing in the UI explained why.

What's going on: the tags request in ai_service.py always asks the AI for logprobs + top_logprobs (used for the confidence score). Gemini says no to that, in both ways you can reach it:

  • OpenAI-compat endpoint: 400 — Unknown name "logprobs": Cannot find field
  • Native endpoint (via a proxy): 400 — Logprobs is not enabled (not available on the free tier)

So the tags call fails all its retries, while the separate description call (which doesn't ask for logprobs) succeeds — that's why you end up with a description but no tags.

Suggestion: make logprobs optional — e.g. an env switch like AI_REQUEST_LOGPROBS=false, or even nicer: retry once without logprobs when the provider returns a 400 mentioning them, and just skip the logprobs-based confidence in that case. Happy to test a fix against my Gemini setup.

Workaround for others hitting this: put a LiteLLM proxy in front with additional_drop_params: ["logprobs", "top_logprobs"] — works, but it's an extra container that shouldn't be necessary.

Transparency: this issue was written AI-assisted (Claude), based on a real debugging session on my own instance — the error messages above are from my worker logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions