Skip to content

[BUG] Settings model picker only lists deprecated Gemini/Gemma models; Layer 4 fails and orphans queue items to needs_attention #216

Description

@seannymurrs

What happened?

The AI-provider model picker in Settings only offers deprecated Gemini/Gemma models. The currently-selected model gemma-3-27b-it returns 404 from the Google Gemini API because Google retired the Gemma 3 lineup when Gemma 4 launched (same pattern as when Gemma 2 was retired in favor of Gemma 3). None of the currently-available models — gemma-4-26b-a4b-it, gemma-4-31b-it, gemini-2.5-flash, gemini-2.5-pro, gemini-3-flash-preview, etc. — are selectable from the UI.

Side note: the configured fallback openrouter_model is google/gemma-3n-e4b-it:free, which is also a Gemma 3 variant and likely affected by the same deprecation cycle — so switching providers via the UI doesn't necessarily route around the bug.

The downstream impact is significant. When the configured AI model 404s, Layer 4 retries the batch 3 times, makes zero progress, then dumps every unresolved item into needs_attention. On my first scan, 532 of ~550 queue items ended up flagged that way purely because the AI fallback couldn't run — they look like "books library-manager can't identify" when they're actually "books library-manager never got to try AI on."

Worth noting: the Settings page reports Gemini: connected in API Connection Status even though generateContent is broken. The connection check isn't validating that the configured model actually works — it appears to be testing API key validity only.

Expected behavior

Either:

  1. Update the hardcoded model lists (for both ai_provider: gemini and openrouter_model) to include current models, or
  2. Dynamically populate the dropdowns by calling https://generativelanguage.googleapis.com/v1beta/models?key=<KEY> for Gemini and https://openrouter.ai/api/v1/models for OpenRouter against the user's configured keys. This is the more robust option since Google retires models on a fairly regular cadence — anything hardcoded will go stale again.

Additionally:

  • The "connected" status check should call generateContent with the currently-configured model (not just validate the key) so this kind of misconfiguration is caught at the Settings page rather than at scan time.
  • When every configured AI provider 404s with Model not found, surface that as a config error in the UI rather than silently orphaning hundreds of items as needs_attention. Right now there's no signal in the web UI that the problem is the model name and not the library content.

Steps to reproduce

  1. Configure a valid Google Gemini API key in Settings → AI Providers.
  2. Verify the Settings page reports Gemini: connected ✅.
  3. Open the Gemini model dropdown — note that only legacy models (Gemma 3, older Gemini versions) are available.
  4. Leave the default gemma-3-27b-it selected.
  5. Run a deep library scan on a library with books that aren't cleanly identified by BookDB / Audnexus / OpenLibrary / Google Books / Hardcover (so Layer 4 actually gets invoked).
  6. Layer 4 fails every batch with 404 Model not found; remaining items are marked needs_attention.

Environment

  • App Version: 0.9.0-beta.134 (beta channel)
  • Python: 3.11.15
  • Platform: Docker (Podman on a Whatbox seedbox slot, Linux 6.12.40-gentoo-whatbox)
  • Library size: ~500 books (1711 audio files)

Configuration (relevant fields)

{
  "ai_provider": "gemini",
  "enable_ai_verification": true,
  "enable_api_lookups": true,
  "openrouter_model": "google/gemma-3n-e4b-it:free",
  "ollama_model": "llama3.2:3b",
  "batch_size": 10,
  "max_requests_per_hour": 200,
  "update_channel": "beta"
}

API Connection Status reported by the UI:

  • Gemini: connected (despite generateContent returning 404 — see above)
  • BookDB: connected
  • Google Books / OpenRouter / Audiobookshelf: not configured

Logs

2026-05-13 10:40:04,938 - WARNING - [PROVIDER CHAIN] All text providers failed
2026-05-13 10:40:04,939 - WARNING - No results from AI
2026-05-13 10:41:08,260 - WARNING - [PROVIDER CHAIN] All text providers failed
2026-05-13 10:41:08,261 - WARNING - No results from AI
2026-05-13 10:42:15,675 - WARNING - [PROVIDER CHAIN] All text providers failed
2026-05-13 10:42:15,676 - WARNING - No results from AI
2026-05-13 10:42:15,676 - INFO - AI providers circuit-broken (gemini) - waiting for recovery, not counting toward exhaustion

2026-05-13 10:43:18,897 - WARNING - Gemini: Model not found - the selected model may not exist
2026-05-13 10:43:18,897 - WARNING - Gemini detail: models/gemma-3-27b-it is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.
2026-05-13 10:43:18,900 - WARNING - [PROVIDER CHAIN] All text providers failed
2026-05-13 10:43:18,903 - WARNING - No items processed but 538 remain (attempt 1/3)

2026-05-13 10:44:02,487 - WARNING - Gemini: Model not found - the selected model may not exist
2026-05-13 10:44:02,487 - WARNING - Gemini detail: models/gemma-3-27b-it is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.
2026-05-13 10:44:02,491 - WARNING - No items processed but 538 remain (attempt 2/3)

2026-05-13 10:44:48,510 - WARNING - Gemini: Model not found - the selected model may not exist
2026-05-13 10:44:48,510 - WARNING - Gemini detail: models/gemma-3-27b-it is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.
2026-05-13 10:44:48,513 - WARNING - No items processed but 538 remain (attempt 3/3)
2026-05-13 10:44:48,514 - INFO - Layer 4 cannot process remaining 538 items - marking as needs_attention
2026-05-13 10:44:48,526 - INFO - Marked 532 orphaned queue items as needs_attention
2026-05-13 10:44:48,529 - INFO - Layer 4 complete: 0 items processed, 0 fixed via folder fallback
2026-05-13 10:44:48,529 - INFO - === LAYERED PROCESSING COMPLETE: 550 processed, 13 fixed ===

Screenshots

Image

References:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions