Michel-OpenWebUI / README.md
Plutarch01
Deploy OpenWebUI update from local
2ff8e37
|
Raw History Blame Contribute Delete
3.53 kB
---
title: Montaigne OpenWebUI
emoji: 🪶
colorFrom: yellow
colorTo: gray
sdk: docker
app_port: 8080
pinned: false
---
# Montaigne OpenWebUI
**This Space is the production user interface of the Montaigne chatbot.**
`https://ask-montaigne.pages.dev` redirects here; the admin dashboard (backend
user management) lives at `https://ask-montaigne.pages.dev/admin.html` and uses
its own cookie/CSRF auth.
The Space connects to the Montaigne FastAPI backend through an
OpenAI-compatible API exposed at `/v1`.
## Auth Model
OpenWebUI runs with authentication **disabled** (guest-only, `features.auth=false`):
- Anonymous visitors are mapped to per-IP backend guest accounts with a
**5-message limit** per IP.
- At the limit, the UI patch shows a "Create free account" modal
(`POST /auth/claim-guest`), which creates a backend account and sets its
password at claim time.
- The account token rides on `/v1` requests as `variables.montaigne_token`;
conversation continuity is keyed by `X-OpenWebUI-Chat-Id` / browser
fingerprint.
- There are **no OpenWebUI accounts, no billing, no conversation sharing, and
no OAuth buttons** in the UI. The backend `/auth/profile` and `/billing/*`
endpoints stay dormant.
## UI Policy (Minimal Consumer Interface)
Standard users see a stripped-down chat-only interface. The model selector,
Controls panel, advanced parameters, voice input/output, Settings menu,
and all power-user surfaces are hidden. Only admins retain full access.
This is enforced in two layers:
1. **Persistent config** — the container entrypoint syncs
`config/ui_policy.json` into OpenWebUI's database on every boot,
ensuring permissions and feature flags always match the repo state.
2. **Runtime DOM patch** — `config/minimal_ui_patch.js` is copied into the
built OpenWebUI app and injected into `index.html` at container startup.
It hides the model selector, settings entry, archived chats, keyboard
shortcuts, and other power-user affordances from the public UI, and
implements the guest-limit claim modal.
### Updating the policy
Edit `config/ui_policy.json` and redeploy. The entrypoint handles first
boot (bootstrap `config.json`) and subsequent boots (update the `config`
row in `webui.db`).
Key fields:
| Key | Purpose |
|-----|---------|
| `default_models` | Model pre-selected for every new chat |
| `default_pinned_models` | Model pinned in the selector |
| `permissions.chat.*` | Per-user chat capabilities |
| `permissions.features.*` | Per-user feature access |
| `permissions.workspace.*` | Per-user workspace access |
| `features.*` | Global OpenWebUI feature toggles |
### Minimal UI patch
`config/minimal_ui_patch.js` is intentionally lightweight: it uses a small
MutationObserver-based DOM patch instead of rebuilding OpenWebUI from source.
That keeps the Space repo small, avoids binary asset issues on Hugging Face,
and still removes the public-facing controls we do not want to expose.
If you upgrade OpenWebUI and the selectors stop matching, adjust only
`config/minimal_ui_patch.js` and redeploy.
## Conversation Starters
Configured in `config/prompt_suggestions.json`. These Montaigne-style
prompts appear on the empty chat screen.
## Environment Variables
| Variable | Description |
|----------|-------------|
| `OPENAI_API_KEY` | Your API key for the backend LLM provider |
| `OPENAI_API_BASE` | Backend URL: `https://tgrumb-michel.hf.space/v1` |
| `DEFAULT_PROMPT_SUGGESTIONS` | Optional override for the repo-managed prompt suggestions |