LibreChat fork
Customising the chat product — branch model, dev loop, release flow.
The chat product is a fork of upstream LibreChat
at dudaji-vn/LibreChat.
Branch npuops/main is the integration branch, currently pinned to
upstream v0.7.5. CI publishes
ghcr.io/dudaji-vn/librechat:npuops-v0.7.5-<N> on each tag.
Repo layout
LibreChat is a monorepo:
| Workspace | Language | Role |
|---|---|---|
/api | JS (legacy) | Express server. Minimise edits here. |
/packages/api | TypeScript | New backend code (consumed by /api) |
/packages/data-schemas | TypeScript | DB schemas / models |
/packages/data-provider | TypeScript | Shared API contract (FE + BE) |
/client | TypeScript/Rect | Frontend SPA |
/packages/client | TypeScript | Shared frontend utilities |
All new backend code must be TypeScript in /packages/api. The
legacy /api exists only as a thin JS wrapper. See CLAUDE.md in
the fork for the full conventions.
Dev loop
git clone git@github.com:dudaji-vn/LibreChat.git
cd LibreChat
git checkout npuops/main
npm run smart-reinstall # install + build (turborepo)
npm run backend:dev # API at :3080 with file watching
# in a second terminal:
npm run frontend:dev # SPA at :3090 with HMRYou need a running MongoDB and a reachable gateway. The simplest
setup is to keep npuops-platform running and point the fork at it:
# .env in the fork's root
MONGO_URI=mongodb://localhost:27018/LibreChat
# Or point at the platform's mongo via host.docker.internal if you
# remap its port.
ENDPOINTS=custom
LITELLM_MASTER_KEY=<copy from npuops-platform/.env>The fork's .env.example has the full list.
Adding a feature
- Edit code in
/packages/api,/client, etc. - If you touched the shared schema, rebuild it:
npm run build:data-provider - Run tests in the affected workspace:
cd packages/api && npx jest <pattern> cd api && npx jest <pattern> - Open a PR against
npuops/main.
Release
Tag the fork. CI builds and pushes
ghcr.io/dudaji-vn/librechat:npuops-v0.7.5-<N>:
git tag npuops-v0.7.5-4 # bump the trailing number
git push origin npuops-v0.7.5-4In npuops-platform/docker-compose.yml, bump the image tag:
librechat:
image: ghcr.io/dudaji-vn/librechat:npuops-v0.7.5-4Then:
docker compose pull librechat && docker compose up -d librechatUpgrading upstream LibreChat
# in the fork
git remote add upstream https://github.com/danny-avila/LibreChat.git # one-time
git fetch upstream --tags
git checkout npuops/main
git merge v0.7.6 # resolve conflicts in npuops commits
git push
git tag npuops-v0.7.6-1
git push origin npuops-v0.7.6-1Then bump the image tag in npuops-platform/docker-compose.yml. Keep
the rebase diff small — git log upstream/v0.7.5..npuops/main should
fit on one screen for sanity.
Conventions
- TypeScript strict, no
any, limitunknown. - Single-word file names (
permissions.ts, notuserPermissions.ts). - Functional first; never-nesting (early returns, flat code).
useLocalize()for every user-facing string inclient/.- Real-DB tests via
mongodb-memory-server. Mocks are last resort.
The full style guide is in CLAUDE.md at the fork root.
See also
- Release flow — the NUFI release pipeline (chat image tagging + GHCR build verification).