Expose /api/ps to show currently loaded model
This commit is contained in:
parent
b16b3af44d
commit
0d1ce96c99
@ -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"))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user