feat: add model management endpoints and admin interface for cache status

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-29 15:52:02 +02:00
parent 6ef8816736
commit df24a07cd8
4 changed files with 219 additions and 19 deletions
+9
View File
@@ -198,3 +198,12 @@ def get_model_output_modalities(
return json.loads(row[0])
except (json.JSONDecodeError, TypeError):
return []
def get_cache_status(conn: duckdb.DuckDBPyConnection) -> dict[str, Any]:
"""Return cache last update time and model count."""
row = conn.execute(
"SELECT MAX(fetched_at), COUNT(*) FROM models_cache"
).fetchone()
last_updated, model_count = (row[0], row[1]) if row else (None, 0)
return {"last_updated": last_updated, "model_count": model_count}