Fix xterm package versions and make models endpoint resilient

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
tocmo0nlord
2026-04-12 16:02:32 -04:00
parent 90a6ee6fbf
commit d68a557de8
3 changed files with 3333 additions and 6 deletions

View File

@@ -399,9 +399,10 @@ async def list_models():
async with httpx.AsyncClient(timeout=10) as client:
resp = await client.get(f"{OLLAMA_URL}/api/tags")
resp.raise_for_status()
return {"models": resp.json().get("models", [])}
return {"models": resp.json().get("models", []), "error": None}
except Exception as exc:
raise HTTPException(status_code=500, detail=str(exc))
# Return empty list instead of crashing — Ollama may not be reachable yet
return {"models": [], "error": str(exc)}
@app.websocket("/api/models/pull")
@@ -447,4 +448,4 @@ async def delete_model(model_name: str):
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8080, reload=True)
uvicorn.run("main:app", host="0.0.0.0", port=8080, reload=True)

3326
frontend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -11,9 +11,9 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"axios": "^1.6.7",
"@xterm/xterm": "^5.3.0",
"@xterm/addon-fit": "^0.8.0",
"@xterm/addon-web-links": "^0.9.0",
"@xterm/xterm": "^6.0.0",
"@xterm/addon-fit": "^0.11.0",
"@xterm/addon-web-links": "^0.12.0",
"recharts": "^2.10.3",
"react-dropzone": "^14.2.3",
"lucide-react": "^0.344.0"