Skip to content

Commit a5200d5

Browse files
committed
Update README with simplified MongoDB setup instructions
Streamlines the setup steps by clarifying that MongoDB configuration is optional for local development, as Chat UI now falls back to an embedded MongoDB if MONGODB_URL is not set. Updates Docker instructions and removes redundant details about MongoDB setup, making the guide easier to follow for new users.
1 parent 15a179c commit a5200d5

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ Chat UI speaks to OpenAI-compatible APIs only. The fastest way to get running is
2626
```env
2727
OPENAI_BASE_URL=https://router.huggingface.co/v1
2828
OPENAI_API_KEY=hf_************************
29-
# Fill in once you pick a database option below
30-
MONGODB_URL=
3129
```
3230

3331
`OPENAI_API_KEY` can come from any OpenAI-compatible endpoint you plan to call. Pick the combo that matches your setup and drop the values into `.env.local`:
@@ -42,9 +40,7 @@ MONGODB_URL=
4240

4341
Check the root [`.env` template](./.env) for the full list of optional variables you can override.
4442

45-
**Step 2 – Choose where MongoDB lives:** Either provision a managed cluster (for example MongoDB Atlas) or run a local container. Both approaches are described in [Database Options](#database-options). After you have the URI, drop it into `MONGODB_URL` (and, if desired, set `MONGODB_DB_NAME`).
46-
47-
**Step 3 – Install and launch the dev server:**
43+
**Step 2 – Install and launch the dev server:**
4844

4945
```bash
5046
git clone https://github.com/huggingface/chat-ui
@@ -59,6 +55,9 @@ You now have Chat UI running locally. Open the browser and start chatting.
5955

6056
Chat history, users, settings, files, and stats all live in MongoDB. You can point Chat UI at any MongoDB 6/7 deployment.
6157

58+
> [!TIP]
59+
> For quick local development, you can skip this section. When `MONGODB_URL` is not set, Chat UI falls back to an embedded MongoDB that persists to `./db`.
60+
6261
### MongoDB Atlas (managed)
6362

6463
1. Create a free cluster at [mongodb.com](https://www.mongodb.com/pricing).
@@ -70,13 +69,13 @@ Atlas keeps MongoDB off your laptop, which is ideal for teams or cloud deploymen
7069

7170
### Local MongoDB (container)
7271

73-
If you prefer to run MongoDB locally:
72+
If you prefer to run MongoDB in a container:
7473

7574
```bash
7675
docker run -d -p 27017:27017 --name mongo-chatui mongo:latest
7776
```
7877

79-
Then set `MONGODB_URL=mongodb://localhost:27017` in `.env.local`. You can also supply `MONGO_STORAGE_PATH` if you want Chat UI’s fallback in-memory server to persist under a specific folder.
78+
Then set `MONGODB_URL=mongodb://localhost:27017` in `.env.local`.
8079

8180
## Launch
8281

@@ -91,19 +90,18 @@ The dev server listens on `http://localhost:5173` by default. Use `npm run build
9190

9291
## Optional Docker Image
9392

94-
Prefer containerized setup? You can run everything in one container as long as you supply a MongoDB URI (local or hosted):
93+
The `chat-ui-db` image bundles MongoDB inside the container:
9594

9695
```bash
9796
docker run \
9897
-p 3000:3000 \
99-
-e MONGODB_URL=mongodb://host.docker.internal:27017 \
10098
-e OPENAI_BASE_URL=https://router.huggingface.co/v1 \
10199
-e OPENAI_API_KEY=hf_*** \
102-
-v db:/data \
100+
-v chat-ui-data:/data \
103101
ghcr.io/huggingface/chat-ui-db:latest
104102
```
105103

106-
`host.docker.internal` lets the container reach a MongoDB instance on your host machine; swap it for your Atlas URI if you use the hosted option. All environment variables accepted in `.env.local` can be provided as `-e` flags.
104+
All environment variables accepted in `.env.local` can be provided as `-e` flags.
107105

108106
## Extra parameters
109107

0 commit comments

Comments
 (0)