| --- |
| title: doc-to-lora UI |
| emoji: πͺ |
| colorFrom: indigo |
| colorTo: blue |
| sdk: docker |
| app_port: 7860 |
| suggested_hardware: cpu-basic |
| pinned: false |
| --- |
| |
| # Etiya doc-to-lora β Web UI |
|
|
| Companion frontend for [`Etiya/d2l-api`](https://huggingface.co/spaces/Etiya/d2l-api). |
|
|
| ## Architecture |
|
|
| ``` |
| Browser |
| β |
| βΌ |
| Etiya/d2l-ui (this Space β Docker SDK, CPU basic, Next.js) |
| β |
| β /api/proxy/* β server-side, adds Authorization: Bearer ${HF_TOKEN} |
| βΌ |
| Etiya/d2l-api (backend Space β A100, doc-to-lora + Gemma-2-2b-it) |
| ``` |
|
|
| The frontend calls the backend Space using a server-side proxy. The HF token is set as a Space Secret on this UI Space and never reaches the browser. |
|
|
| ## Pages |
|
|
| - `/` β hero + quick ask |
| - `/ask` β chat interface with advanced parameter sliders |
| - `/documents` β CRUD for the 1,166 BSS document corpus |
| - `/system` β health, GPU, latency, re-index controls |
|
|
| ## Required Space secret |
|
|
| Set on this Space's `Settings β Variables and secrets β New secret`: |
|
|
| | Name | Type | Value | |
| |---|---|---| |
| | `HF_TOKEN` | Secret | An HF write token with read access to `Etiya/d2l-api` | |
|
|
| Optional: |
|
|
| | Name | Type | Default | |
| |---|---|---| |
| | `D2L_API_URL` | Variable | `https://etiya-d2l-api.hf.space` | |
|
|
| ## Local development |
|
|
| This Space is a regular Next.js 14 app. To work on it locally: |
|
|
| ```bash |
| git clone https://huggingface.co/spaces/Etiya/d2l-ui |
| cd d2l-ui |
| npm install |
| cp .env.example .env.local # add HF_TOKEN |
| npm run dev # http://localhost:3000 |
| ``` |
|
|
| Or via Docker: |
|
|
| ```bash |
| docker compose up --build # http://localhost:3000 |
| ``` |
|
|
| ## Hardware |
|
|
| This Space runs on `cpu-basic` (free) β Next.js is light. The heavy lifting (GPU inference) happens on the backend Space. |
|
|