Spaces:
Sleeping
Sleeping
| title: Hannah-Pilot-Interface | |
| duplicate_from: null | |
| sdk: docker | |
| app_port: 7860 | |
| # Hannah Pilot Interface (Docker Space) | |
| This HuggingFace Space serves a FastAPI backend for the Hannah web UI. | |
| ## β Endpoints | |
| - `GET /api/models` β lists available `.gguf` models in the repo | |
| - `GET /api/status` β lightweight health/status (RAM + CPU) | |
| - `POST /api/gen_title` β generates a short chat title | |
| - `POST /api/chat` β **streams NDJSON** responses (`application/x-ndjson`) | |
| ## Frontend Setup | |
| In your HTML frontend, set: | |
| ```js | |
| const API_BASE = "https://fugthchat-hannah-pilot-interface.hf.space"; | |
| ``` | |
| Your frontend should call: | |
| - `POST ${API_BASE}/api/chat` | |
| - `GET ${API_BASE}/api/models` | |
| - `GET ${API_BASE}/api/status` | |
| ## Models | |
| Upload your model files into the Space repo root: | |
| - `qwen2.5-0.5b-instruct-q2_k.gguf` (Light) | |
| - `qwen2.5-0.5b-instruct-q4_k_m.gguf` (Heavy) | |
| The backend auto-detects all `*.gguf` files. | |
| ## Avoiding Build Loops | |
| This Space uses: | |
| - Docker listening on `0.0.0.0:7860` | |
| - `app_port: 7860` in the README header | |
| If your Space keeps restarting: | |
| 1. Confirm the app listens on port `7860`. | |
| 2. Confirm `CMD` runs `uvicorn app:app --host 0.0.0.0 --port 7860`. | |
| 3. Check the Space logs for dependency install failures. | |
| ## Notes | |
| - This is CPU-friendly config (`n_threads=2`) for HuggingFace free tier. | |
| - Response streaming is NDJSON (one JSON per line: `{ "text": "..." }`). | |