Update README with new features and API
#7
by luguog - opened
README.md
CHANGED
|
@@ -1,10 +1,66 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
|
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: LocalSpace Deployer
|
| 3 |
+
emoji: π¦
|
| 4 |
+
colorFrom: gray
|
| 5 |
+
colorTo: indigo
|
| 6 |
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# LocalSpace Deployer
|
| 12 |
+
|
| 13 |
+
Drag a DMG, GGUF, or ZIP. It gets opened on the server: extracted, inspected,
|
| 14 |
+
and served. Pure FastAPI + HTML/JS. No Gradio, no Streamlit, no API keys.
|
| 15 |
+
|
| 16 |
+
## Features
|
| 17 |
+
|
| 18 |
+
- **DMG upload & extraction** β 7z-based server-side extraction
|
| 19 |
+
- **App bundle inspection** β reads Info.plist, lists files, finds icons
|
| 20 |
+
- **GGUF model inspection** β parses GGUF header, tensor count, metadata KV pairs
|
| 21 |
+
- **GGUF inference** β OpenAI-compatible chat/completion via llama-cpp-python (optional)
|
| 22 |
+
- **Tiny Netlify** β upload a static site ZIP, get a hosted URL with base-tag injection
|
| 23 |
+
- **ChatGPT export β dApp** β upload conversations.json, get a browsable dApp with search
|
| 24 |
+
- **iframe preview** β auto-discovers HTML files and serves them in a full-page viewer
|
| 25 |
+
- **Web App β DMG** β paste a URL, get back a macOS .app bundle wrapper
|
| 26 |
+
- **Persistent storage** β auto-detects /data mount on HF Spaces
|
| 27 |
+
- **SHA-256 hashing** β every upload is hash-verified
|
| 28 |
+
|
| 29 |
+
## API
|
| 30 |
+
|
| 31 |
+
| Endpoint | Method | Description |
|
| 32 |
+
|---|---|---|
|
| 33 |
+
| `/` | GET | Landing page + deployer UI |
|
| 34 |
+
| `/api/upload` | POST | Upload DMG or GGUF (multipart file) |
|
| 35 |
+
| `/api/deploy-site` | POST | Deploy static site from ZIP |
|
| 36 |
+
| `/api/import/chatgpt` | POST | Import ChatGPT export (JSON or ZIP) |
|
| 37 |
+
| `/api/apps` | GET | List all artifacts |
|
| 38 |
+
| `/api/apps/{id}` | GET | Get single artifact metadata |
|
| 39 |
+
| `/api/apps/{id}` | DELETE | Delete artifact |
|
| 40 |
+
| `/app/{id}` | GET | Full-page iframe preview (DMG) |
|
| 41 |
+
| `/site/{id}/` | GET | Visit deployed static site |
|
| 42 |
+
| `/site/{id}/{path}` | GET | Serve file from deployed site |
|
| 43 |
+
| `/dapp/{id}/` | GET | Visit ChatGPT dApp |
|
| 44 |
+
| `/api/preview/{id}/{path}` | GET | Serve extracted DMG file |
|
| 45 |
+
| `/api/browse/{id}/{path}` | GET | Browse extracted file tree |
|
| 46 |
+
| `/api/download/{id}` | GET | Download original uploaded file |
|
| 47 |
+
| `/api/create-webapp` | POST | Create .app from URL |
|
| 48 |
+
| `/api/storage/status` | GET | Check persistent storage status |
|
| 49 |
+
| `/api/inference/status` | GET | Check inference availability |
|
| 50 |
+
| `/api/inference/load/{id}` | POST | Load GGUF model into memory |
|
| 51 |
+
| `/api/inference/chat/{id}` | POST | OpenAI-compatible chat completion |
|
| 52 |
+
| `/api/inference/completion/{id}` | POST | Text completion |
|
| 53 |
+
|
| 54 |
+
## Enable GGUF Inference
|
| 55 |
+
|
| 56 |
+
Uncomment `llama-cpp-python` in `requirements.txt` and rebuild the Space.
|
| 57 |
+
For GPU acceleration, use `llama-cpp-python[cuda]` and set the Space hardware to GPU.
|
| 58 |
+
|
| 59 |
+
## Run locally
|
| 60 |
+
|
| 61 |
+
```bash
|
| 62 |
+
pip install -r requirements.txt
|
| 63 |
+
uvicorn app:app --host 0.0.0.0 --port 7860
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
Requires `7z` (p7zip-full) for DMG extraction.
|