nsarrazin HF staff commited on
Commit
69c0464
1 Parent(s): cdb33a9

Add doc section about updating HuggingChat (#683)

Browse files

* Add doc section about updating HuggingChat config

* lint

Files changed (1) hide show
  1. README.md +26 -0
README.md CHANGED
@@ -440,3 +440,29 @@ npm run build
440
  You can preview the production build with `npm run preview`.
441
 
442
  > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  You can preview the production build with `npm run preview`.
441
 
442
  > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
443
+
444
+ ## Config changes for HuggingChat
445
+
446
+ The config file for HuggingChat is stored in the `.env.template` file at the root of the repository. It is the single source of truth that is used to generate the actual `.env.local` file using our CI/CD pipeline. See [updateProdEnv](https://github.com/huggingface/chat-ui/blob/cdb33a9583f5339ade724db615347393ef48f5cd/scripts/updateProdEnv.ts) for more details.
447
+
448
+ > [!TIP]
449
+ > If you want to make changes to model config for HuggingChat, you should do so against `.env.template`.
450
+
451
+ We currently use the following secrets for deploying HuggingChat in addition to the `.env.template` above:
452
+
453
+ - `MONGODB_URL`
454
+ - `HF_TOKEN`
455
+ - `OPENID_CONFIG`
456
+ - `SERPER_API_KEY`
457
+
458
+ They are defined as secrets in the repository.
459
+
460
+ ### Testing config changes locally
461
+
462
+ You can test the config changes locally by first creating an `.env.SECRET_CONFIG` file with the secrets defined above. Then you can run the following command to generate the `.env.local` file:
463
+
464
+ ```bash
465
+ npm run updateLocalEnv
466
+ ```
467
+
468
+ This will replace your `.env.local` file with the one that will be used in prod (simply taking `.env.template + .env.SECRET_CONFIG`).