Self-hosted chat for the models your gateway exposes: knowledge bases, artifacts, Python in the browser, and coding agents on your own machines. A fork of Hugging Face chat-ui.
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗A self-hosted chat for any OpenAI-compatible endpoint, with knowledge bases, artifacts, Python in the browser, and coding agents on your own machines.
The name. Cerea is a Turinese modo di dire: a historic, affectionate greeting that means both buongiorno and arrivederci.
Cerea is one half of a pair. Each half solves a different problem, and each runs on its own:
Cerea alone runs against any OpenAI-compatible endpoint with one shared key.
Pystino alone serves any OpenAI or Anthropic client. Together they are the
intended setup: the chat calls Pystino's /v1 with each person's own sign-in
token, so spend, quotas and model access follow the person, and the gateway
adds web search, a local document reader and metered coding agents. Below, the
gateway means Pystino. The deploy kit in this repository (kit/) runs both
together, or the chat alone.
Unmarked features work against any endpoint; those marked (Pystino) need the gateway.
.doc too), images
and text, read once at upload. With Pystino, extraction goes through the
gateway and can stay inside your deployment; without it, PDFs and images
go to an OCR endpoint you name (CHAT_OCR_BASE_URL). Scanned PDFs reach a
model that sees images as page images./chats, and accent and background palettes
(docs/chat.md)./code agents panel: coding agents on your own machines through
galopin, with a file explorer, scheduled actions (a prompt sent to a
session on a timetable) and, off by default, a browser terminal. With
Pystino the agents' model calls are metered like the chat's; without it
they use opencode's own providers.The deploy kit, the kit/ directory of this repository, runs the full
stack by default: the chat, Pystino and its console, a bundled identity
provider, a TLS proxy and the add-ons. It is one compose.yaml, a documented
.env.example, and a ./configure script. Its installer fetches only that
directory:
curl -fsSL https://raw.githubusercontent.com/paoloviviani/Cerea/stable/kit/get-kit.sh | sh
cd cerea/kit
./configure
docker compose up -d
It also covers a chat-only install, against a central Pystino
(--preset satellite) or any OpenAI-compatible endpoint without Pystino
(--preset generic). What each shape gives and lacks is in
docs/deploy.md; the chat also runs without the kit.
Cerea reads its settings from the environment. The ones that matter most:
| Variable | What |
|---|---|
OPENAI_BASE_URL | the OpenAI-compatible API the chat calls (Pystino's /v1, or any endpoint) |
USE_USER_TOKEN | true with Pystino: each call carries the signed-in person's own token |
OPENAI_API_KEY | the one shared key, without Pystino |
OPENID_PROVIDER_URL, OPENID_CLIENT_ID, OPENID_CLIENT_SECRET | the OIDC sign-in |
MONGODB_URL | conversations, settings and pairing records |
CHAT_PG_URL | PostgreSQL with pgvector, for knowledge-base passages |
ORIGIN, PUBLIC_ORIGIN | the public URL of the chat, and of the whole site |
CHAT_KNOWLEDGE_ENABLED, CHAT_MEMORY_ENABLED, CHAT_USAGE_ENABLED, CHAT_CONSOLE_ENABLED | feature switches (true or empty) |
FETCH_BACKEND | direct (default) or playwright, the headless browser |
CODE_AGENTS_ENABLED, CODE_TERMINAL_ENABLED | the /code panel, and its browser terminal |
The deployment's full, commented list is the kit's .env.example; .env
here lists every variable the app understands.
galopin runs next to the coding agent (opencode) on a person's machine, dials out to Cerea with
its own OIDC credential, and is confirmed by its owner in /code. What a
machine allows (the permission ceiling, workspace roots, files, the terminal) is fixed on
the machine at enroll time; the terminal also needs CODE_TERMINAL_ENABLED=true
on the deployment. See docs/code-panel.md (operators),
docs/agent-machines.md (users; the
reference has the depth) and
agent/PROTOCOL.md (the wire protocol).
npm ci # also installs the git hooks (husky)
cp .env .env.local # then set OPENAI_BASE_URL, OPENAI_API_KEY and friends
npm run dev # http://localhost:5173
npm run check && npm run lint
Tests: npm run test (server and ssr Vitest projects; on a CPU without AVX point
them at a real MongoDB with TEST_MONGODB_URL and add --no-file-parallelism),
npm run test:client (the component tests, in a real browser), npx playwright test
(end to end; E2E_SKIP_BUILD=1 reuses build/) and cd agent && go test ./...
(galopin, which needs Go 1.24+). Toolchains, git hooks, every test layer, CI,
releasing and the repository's conventions are in
CONTRIBUTING.md, which is also the
Development page of the
documentation.
The image fixes SvelteKit's base path at build time, and builds galopin
too: docker build --build-arg APP_BASE=/chat -t cerea .
Cerea began as a fork of huggingface/chat-ui, with its history intact, and is now a hard fork: it does not merge upstream and carries nothing for upstream's sake. The attribution stays in NOTICE.
The documentation is a mkdocs site built from docs/:
chat · artifacts ·
pyodide · skills ·
knowledge · connectors ·
agent-machines ·
agent-machines-reference · browser ·
deploy · deploy-kit ·
configuration · chat-admin ·
code-panel · reference ·
development ·
. Build it with
(there is no Python project in this repository; the pins are in
). Pystino's documentation lives in its own
repository. is
documentation, kept as upstream wrote it, excluded from the site; parts of it
do not apply to Cerea.
See CONTRIBUTING.md and, for vulnerabilities, SECURITY.md. Cerea is Copyright 2026 Paolo Viviani and licensed under the Apache License 2.0; NOTICE records that it is based on huggingface/chat-ui, © Hugging Face, and carries the third-party notices. How this code was written is disclosed in AI-DISCLOSURE.md.
This work is supported by LINKS Foundation.
uv run --with-requirements docs/requirements.txt mkdocs build --strictdocs/requirements.txt