From 0d1ce96c99dd9ae08ead868f7897370021eb2c11 Mon Sep 17 00:00:00 2001 From: Oliver Hofmann Date: Fri, 8 May 2026 09:22:17 +0200 Subject: [PATCH] Expose /api/ps to show currently loaded model --- backend/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/main.py b/backend/main.py index b95c850..88a39cb 100644 --- a/backend/main.py +++ b/backend/main.py @@ -149,6 +149,12 @@ async def list_models(db: Session = Depends(get_db)): response = await proxy_request(f"{ollama_url}/api/tags", method="GET") return JSONResponse(content=response.json(), status_code=response.status_code) +@app.get("/api/ps") +async def running_models(db: Session = Depends(get_db)): + ollama_url = crud.get_setting(db, "ollama_url", os.getenv("OLLAMA_URL", "http://localhost:11434")) + response = await proxy_request(f"{ollama_url}/api/ps", method="GET") + return JSONResponse(content=response.json(), status_code=response.status_code) + @app.get("/api/versions") async def versions(db: Session = Depends(get_db)): ollama_url = crud.get_setting(db, "ollama_url", os.getenv("OLLAMA_URL", "http://localhost:11434"))