Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,22 +1,55 @@
|
|
| 1 |
---
|
| 2 |
-
title: Hannah
|
| 3 |
-
|
| 4 |
-
colorFrom: gray
|
| 5 |
-
colorTo: gray
|
| 6 |
sdk: docker
|
| 7 |
-
pinned: false
|
| 8 |
-
license: mit
|
| 9 |
app_port: 7860
|
| 10 |
---
|
| 11 |
|
| 12 |
-
# Hannah
|
| 13 |
|
| 14 |
-
This
|
| 15 |
|
| 16 |
-
##
|
| 17 |
-
1. This backend hosts the GGUF model files.
|
| 18 |
-
2. It provides an API endpoint at `/api/chat` and `/api/models`.
|
| 19 |
-
3. The frontend (hosted on GitHub or elsewhere) connects to this API via CORS.
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Hannah-Pilot-Interface
|
| 3 |
+
duplicate_from: null
|
|
|
|
|
|
|
| 4 |
sdk: docker
|
|
|
|
|
|
|
| 5 |
app_port: 7860
|
| 6 |
---
|
| 7 |
|
| 8 |
+
# Hannah Pilot Interface (Docker Space)
|
| 9 |
|
| 10 |
+
This HuggingFace Space serves a FastAPI backend for the Hannah web UI.
|
| 11 |
|
| 12 |
+
## ✅ Endpoints
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
- `GET /api/models` – lists available `.gguf` models in the repo
|
| 15 |
+
- `GET /api/status` – lightweight health/status (RAM + CPU)
|
| 16 |
+
- `POST /api/gen_title` – generates a short chat title
|
| 17 |
+
- `POST /api/chat` – **streams NDJSON** responses (`application/x-ndjson`)
|
| 18 |
+
|
| 19 |
+
## Frontend Setup
|
| 20 |
+
|
| 21 |
+
In your HTML frontend, set:
|
| 22 |
+
|
| 23 |
+
```js
|
| 24 |
+
const API_BASE = "https://fugthchat-hannah-pilot-interface.hf.space";
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
Your frontend should call:
|
| 28 |
+
- `POST ${API_BASE}/api/chat`
|
| 29 |
+
- `GET ${API_BASE}/api/models`
|
| 30 |
+
- `GET ${API_BASE}/api/status`
|
| 31 |
+
|
| 32 |
+
## Models
|
| 33 |
+
|
| 34 |
+
Upload your model files into the Space repo root:
|
| 35 |
+
|
| 36 |
+
- `qwen2.5-0.5b-instruct-q2_k.gguf` (Light)
|
| 37 |
+
- `qwen2.5-0.5b-instruct-q4_k_m.gguf` (Heavy)
|
| 38 |
+
|
| 39 |
+
The backend auto-detects all `*.gguf` files.
|
| 40 |
+
|
| 41 |
+
## Avoiding Build Loops
|
| 42 |
+
|
| 43 |
+
This Space uses:
|
| 44 |
+
- Docker listening on `0.0.0.0:7860`
|
| 45 |
+
- `app_port: 7860` in the README header
|
| 46 |
+
|
| 47 |
+
If your Space keeps restarting:
|
| 48 |
+
1. Confirm the app listens on port `7860`.
|
| 49 |
+
2. Confirm `CMD` runs `uvicorn app:app --host 0.0.0.0 --port 7860`.
|
| 50 |
+
3. Check the Space logs for dependency install failures.
|
| 51 |
+
|
| 52 |
+
## Notes
|
| 53 |
+
|
| 54 |
+
- This is CPU-friendly config (`n_threads=2`) for HuggingFace free tier.
|
| 55 |
+
- Response streaming is NDJSON (one JSON per line: `{ "text": "..." }`).
|