Fix xterm package versions and make models endpoint resilient
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -399,9 +399,10 @@ async def list_models():
|
|||||||
async with httpx.AsyncClient(timeout=10) as client:
|
async with httpx.AsyncClient(timeout=10) as client:
|
||||||
resp = await client.get(f"{OLLAMA_URL}/api/tags")
|
resp = await client.get(f"{OLLAMA_URL}/api/tags")
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
return {"models": resp.json().get("models", [])}
|
return {"models": resp.json().get("models", []), "error": None}
|
||||||
except Exception as exc:
|
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")
|
@app.websocket("/api/models/pull")
|
||||||
@@ -447,4 +448,4 @@ async def delete_model(model_name: str):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
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
3326
frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -11,9 +11,9 @@
|
|||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"axios": "^1.6.7",
|
"axios": "^1.6.7",
|
||||||
"@xterm/xterm": "^5.3.0",
|
"@xterm/xterm": "^6.0.0",
|
||||||
"@xterm/addon-fit": "^0.8.0",
|
"@xterm/addon-fit": "^0.11.0",
|
||||||
"@xterm/addon-web-links": "^0.9.0",
|
"@xterm/addon-web-links": "^0.12.0",
|
||||||
"recharts": "^2.10.3",
|
"recharts": "^2.10.3",
|
||||||
"react-dropzone": "^14.2.3",
|
"react-dropzone": "^14.2.3",
|
||||||
"lucide-react": "^0.344.0"
|
"lucide-react": "^0.344.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user