Skip to content

[Feature Request] Prune stale / "ghost" models from offline upstreams that are hidden from the UI #81

Description

@xyonium

Is your feature request related to a problem? Please describe.
Yes. When an upstream LLM provider (like an offline Ollama instance or a deprecated OpenAI-compatible API) is removed, the related model data often remains permanently cached or stuck in the Open WebUI database.

The biggest pain point is that these "ghost models" do not appear in the Workspace -> Models management UI, which means users have absolutely no way to manually delete them. However, they still linger in the system, polluting search indexes, autocomplete suggestions, and backend queries. It is extremely frustrating.

Describe the solution you'd like
Since these ghost models are invisible in the UI, we need a backend way to clean them up. It would be amazing if the Prune Plugin could introduce a feature to bulk-clean these stale/offline model configurations from the database using rule-based filtering:

  1. Prefix / Keyword matching (Deletion list): Allow users to specify prefixes or keywords to explicitly target hidden models for deletion (e.g., delete_model_prefixes=["test-", "offline_"] or delete_model_keywords=["deprecated"]).
  2. Time-based filtering: Purge models created or last updated before a certain time (e.g., --models-older-than 30d), which helps clean up old dead models.
  3. Prefix / Keyword matching (Keep/Protect list): Allow users to protect specific active models from being pruned based on their names (e.g., keep_model_prefixes=["gpt-4", "production-"]).
  4. "Active" bypass: If there is any flag in the DB indicating a model is currently "active" or recently used in active chats, bypass them.

Describe alternatives you've considered
Currently, because the WebUI completely hides these models from the Workspace management interface, the only alternative is to manually open the SQLite/PostgreSQL database and execute raw SQL DELETE commands. This is extremely dangerous, inconvenient for average users, and prone to breaking database integrity.

Additional context
I understand that the plugin currently handles "orphaned models" (custom models whose creators were deleted). Expanding this to handle "invisible/stale upstream models" via string matching and timestamps would fix a major blind spot in Open WebUI's data management. Thank you for your great work!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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