Spaces:
Running
Running
Rachit-Mangawa commited on
Commit ·
a219be1
1
Parent(s): 7580459
fix: sanitize health check schema and relocate model status to metadata
Browse files
app.py
CHANGED
|
@@ -143,9 +143,24 @@ async def healthz():
|
|
| 143 |
async with httpx.AsyncClient() as client:
|
| 144 |
try:
|
| 145 |
res = await client.get("http://127.0.0.1:11434/api/tags")
|
| 146 |
-
if "llama3.2" in res.text: return {"status": "ok"
|
| 147 |
except: pass
|
| 148 |
-
return {"status": "starting"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
@app.post("/v1/context")
|
| 151 |
def push_context(data: ContextPayload):
|
|
|
|
| 143 |
async with httpx.AsyncClient() as client:
|
| 144 |
try:
|
| 145 |
res = await client.get("http://127.0.0.1:11434/api/tags")
|
| 146 |
+
if "llama3.2" in res.text: return {"status": "ok"}
|
| 147 |
except: pass
|
| 148 |
+
return {"status": "starting"}
|
| 149 |
+
|
| 150 |
+
@app.get("/v1/metadata")
|
| 151 |
+
async def metadata():
|
| 152 |
+
model_status = "unready"
|
| 153 |
+
async with httpx.AsyncClient() as client:
|
| 154 |
+
try:
|
| 155 |
+
res = await client.get("http://127.0.0.1:11434/api/tags")
|
| 156 |
+
if "llama3.2" in res.text: model_status = "ready"
|
| 157 |
+
except: pass
|
| 158 |
+
return {
|
| 159 |
+
"team_name": "Vera Lead Solver",
|
| 160 |
+
"version": "4.0",
|
| 161 |
+
"engine": "Llama-3.2-3B-Autonomous",
|
| 162 |
+
"local_model": model_status
|
| 163 |
+
}
|
| 164 |
|
| 165 |
@app.post("/v1/context")
|
| 166 |
def push_context(data: ContextPayload):
|