--- 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.