kadirnar commited on
Commit
8238365
1 Parent(s): fb532fe
Files changed (19) hide show
  1. .dockerignore +0 -8
  2. .env +0 -94
  3. .eslintignore +0 -13
  4. .eslintrc.cjs +0 -43
  5. .gitignore +0 -10
  6. .npmrc +0 -1
  7. .prettierignore +0 -13
  8. .prettierrc +0 -8
  9. Dockerfile +108 -19
  10. LICENSE +0 -203
  11. PRIVACY.md +0 -38
  12. README.md +6 -319
  13. package-lock.json +0 -0
  14. package.json +0 -63
  15. postcss.config.js +0 -6
  16. svelte.config.js +0 -29
  17. tailwind.config.cjs +0 -29
  18. tsconfig.json +0 -18
  19. vite.config.ts +0 -12
.dockerignore DELETED
@@ -1,8 +0,0 @@
1
- Dockerfile
2
- .vscode/
3
- .idea
4
- .gitignore
5
- LICENSE
6
- README.md
7
- node_modules/
8
- .svelte-kit/
 
 
 
 
 
 
 
 
 
.env DELETED
@@ -1,94 +0,0 @@
1
- # Use .env.local to change these variables
2
- # DO NOT EDIT THIS FILE WITH SENSITIVE DATA
3
-
4
- MONGODB_URL=#your mongodb URL here
5
- MONGODB_DB_NAME=chat-ui
6
- MONGODB_DIRECT_CONNECTION=false
7
-
8
- COOKIE_NAME=hf-chat
9
- HF_ACCESS_TOKEN=#hf_<token> from from https://huggingface.co/settings/token
10
- HF_API_ROOT=https://api-inference.huggingface.co/models
11
-
12
- # used to activate search with web functionality. disabled if none are defined. choose one of the following:
13
- SERPER_API_KEY=#your serper.dev api key here
14
- SERPAPI_KEY=#your serpapi key here
15
-
16
- # Parameters to enable "Sign in with HF"
17
- OPENID_CLIENT_ID=
18
- OPENID_CLIENT_SECRET=
19
- OPENID_SCOPES="openid profile" # Add "email" for some providers like Google that do not provide preferred_username
20
- OPENID_PROVIDER_URL=https://huggingface.co # for Google, use https://accounts.google.com
21
-
22
- # Parameters to enable a global mTLS context for client fetch requests
23
- USE_CLIENT_CERTIFICATE=false
24
- CERT_PATH=#
25
- KEY_PATH=#
26
- CA_PATH=#
27
- CLIENT_KEY_PASSWORD=#
28
- REJECT_UNAUTHORIZED=true
29
-
30
- # 'name', 'userMessageToken', 'assistantMessageToken' are required
31
- MODELS=`[
32
- {
33
- "name": "OpenAssistant/oasst-sft-4-pythia-12b-epoch-3.5",
34
- "datasetName": "OpenAssistant/oasst1",
35
- "description": "A good alternative to ChatGPT",
36
- "websiteUrl": "https://open-assistant.io",
37
- "userMessageToken": "<|prompter|>",
38
- "assistantMessageToken": "<|assistant|>",
39
- "messageEndToken": "</s>",
40
- "preprompt": "Below are a series of dialogues between various people and an AI assistant. The AI tries to be helpful, polite, honest, sophisticated, emotionally aware, and humble-but-knowledgeable. The assistant is happy to help with almost anything, and will do its best to understand exactly what is needed. It also tries to avoid giving false or misleading information, and it caveats when it isn't entirely sure about the right answer. That said, the assistant is practical and really does its best, and doesn't let caution get too much in the way of being useful.\n-----\n",
41
- "promptExamples": [
42
- {
43
- "title": "Write an email from bullet list",
44
- "prompt": "As a restaurant owner, write a professional email to the supplier to get these products every week: \n\n- Wine (x10)\n- Eggs (x24)\n- Bread (x12)"
45
- }, {
46
- "title": "Code a snake game",
47
- "prompt": "Code a basic snake game in python, give explanations for each step."
48
- }, {
49
- "title": "Assist in a task",
50
- "prompt": "How do I make a delicious lemon cheesecake?"
51
- }
52
- ],
53
- "parameters": {
54
- "temperature": 0.9,
55
- "top_p": 0.95,
56
- "repetition_penalty": 1.2,
57
- "top_k": 50,
58
- "truncate": 1000,
59
- "max_new_tokens": 1024
60
- }
61
- }
62
- ]`
63
- OLD_MODELS=`[]`# any removed models, `{ name: string, displayName?: string, id?: string }`
64
-
65
- PUBLIC_ORIGIN=#https://huggingface.co
66
- PUBLIC_SHARE_PREFIX=#https://hf.co/chat
67
- PUBLIC_GOOGLE_ANALYTICS_ID=#G-XXXXXXXX / Leave empty to disable
68
- PUBLIC_DEPRECATED_GOOGLE_ANALYTICS_ID=#UA-XXXXXXXX-X / Leave empty to disable
69
- PUBLIC_ANNOUNCEMENT_BANNERS=`[
70
- {
71
- "title": "Llama v2 is live on HuggingChat! 🦙",
72
- "linkTitle": "Announcement",
73
- "linkHref": "https://huggingface.co/blog/llama2"
74
- }
75
- ]`
76
-
77
- PARQUET_EXPORT_DATASET=
78
- PARQUET_EXPORT_HF_TOKEN=
79
- PARQUET_EXPORT_SECRET=
80
-
81
- RATE_LIMIT= # requests per minute
82
- MESSAGES_BEFORE_LOGIN=# how many messages a user can send in a conversation before having to login. set to 0 to force login right away
83
-
84
- PUBLIC_APP_NAME=ChatUI # name used as title throughout the app
85
- PUBLIC_APP_ASSETS=chatui # used to find logos & favicons in static/$PUBLIC_APP_ASSETS
86
- PUBLIC_APP_COLOR=blue # can be any of tailwind colors: https://tailwindcss.com/docs/customizing-colors#default-color-palette
87
- PUBLIC_APP_DATA_SHARING=#set to 1 to enable options & text regarding data sharing
88
- PUBLIC_APP_DISCLAIMER=#set to 1 to show a disclaimer on login page
89
-
90
- # PUBLIC_APP_NAME=HuggingChat
91
- # PUBLIC_APP_ASSETS=huggingchat
92
- # PUBLIC_APP_COLOR=yellow
93
- # PUBLIC_APP_DATA_SHARING=1
94
- # PUBLIC_APP_DISCLAIMER=1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.eslintignore DELETED
@@ -1,13 +0,0 @@
1
- .DS_Store
2
- node_modules
3
- /build
4
- /.svelte-kit
5
- /package
6
- .env
7
- .env.*
8
- !.env.example
9
-
10
- # Ignore files for PNPM, NPM and YARN
11
- pnpm-lock.yaml
12
- package-lock.json
13
- yarn.lock
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.eslintrc.cjs DELETED
@@ -1,43 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- parser: "@typescript-eslint/parser",
4
- extends: [
5
- "eslint:recommended",
6
- "plugin:@typescript-eslint/recommended",
7
- "plugin:svelte/recommended",
8
- "prettier",
9
- ],
10
- plugins: ["@typescript-eslint"],
11
- ignorePatterns: ["*.cjs"],
12
- overrides: [
13
- {
14
- files: ["*.svelte"],
15
- parser: "svelte-eslint-parser",
16
- parserOptions: {
17
- parser: "@typescript-eslint/parser",
18
- },
19
- },
20
- ],
21
- parserOptions: {
22
- sourceType: "module",
23
- ecmaVersion: 2020,
24
- extraFileExtensions: [".svelte"],
25
- },
26
- rules: {
27
- "no-shadow": ["error"],
28
- "@typescript-eslint/no-explicit-any": "error",
29
- "@typescript-eslint/no-non-null-assertion": "error",
30
- "@typescript-eslint/no-unused-vars": [
31
- // prevent variables with a _ prefix from being marked as unused
32
- "error",
33
- {
34
- argsIgnorePattern: "^_",
35
- },
36
- ],
37
- },
38
- env: {
39
- browser: true,
40
- es2017: true,
41
- node: true,
42
- },
43
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.gitignore DELETED
@@ -1,10 +0,0 @@
1
- .DS_Store
2
- node_modules
3
- /build
4
- /.svelte-kit
5
- /package
6
- .env
7
- .env.*
8
- !.env.example
9
- vite.config.js.timestamp-*
10
- vite.config.ts.timestamp-*
 
 
 
 
 
 
 
 
 
 
 
.npmrc DELETED
@@ -1 +0,0 @@
1
- engine-strict=true
 
 
.prettierignore DELETED
@@ -1,13 +0,0 @@
1
- .DS_Store
2
- node_modules
3
- /build
4
- /.svelte-kit
5
- /package
6
- .env
7
- .env.*
8
- !.env.example
9
-
10
- # Ignore files for PNPM, NPM and YARN
11
- pnpm-lock.yaml
12
- package-lock.json
13
- yarn.lock
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.prettierrc DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "useTabs": true,
3
- "trailingComma": "es5",
4
- "printWidth": 100,
5
- "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
6
- "pluginSearchDirs": ["."],
7
- "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
8
- }
 
 
 
 
 
 
 
 
 
Dockerfile CHANGED
@@ -1,32 +1,121 @@
1
- # syntax=docker/dockerfile:1
2
- # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
3
- # you will also find guides on how best to write your Dockerfile
4
- FROM node:19 as builder-production
 
 
 
 
 
 
 
5
 
6
  WORKDIR /app
7
 
8
- COPY --link --chown=1000 package-lock.json package.json ./
9
- RUN --mount=type=cache,target=/app/.npm \
10
- npm set cache /app/.npm && \
11
- npm ci --omit=dev
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
- FROM builder-production as builder
14
 
15
  RUN --mount=type=cache,target=/app/.npm \
16
- npm set cache /app/.npm && \
17
- npm ci
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
- COPY --link --chown=1000 . .
20
 
21
- RUN --mount=type=secret,id=DOTENV_LOCAL,dst=.env.local \
22
- npm run build
 
 
 
 
23
 
24
- FROM node:19-slim
 
 
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  RUN npm install -g pm2
27
 
28
- COPY --from=builder-production /app/node_modules /app/node_modules
29
- COPY --link --chown=1000 package.json /app/package.json
30
- COPY --from=builder /app/build /app/build
 
 
 
 
31
 
32
- CMD pm2 start /app/build/index.js -i $CPU_CORES --no-daemon
 
1
+ ARG MODEL_NAME
2
+ ARG MODEL_PARAMS
3
+ ARG APP_COLOR
4
+ ARG APP_NAME
5
+
6
+
7
+ FROM node:19 as chatui-builder
8
+ ARG MODEL_NAME
9
+ ARG MODEL_PARAMS
10
+ ARG APP_COLOR
11
+ ARG APP_NAME
12
 
13
  WORKDIR /app
14
 
15
+ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
16
+ git gettext && \
17
+ rm -rf /var/lib/apt/lists/*
18
+
19
+
20
+ RUN git clone https://github.com/huggingface/chat-ui.git
21
+
22
+ WORKDIR /app/chat-ui
23
+
24
+
25
+ COPY .env.local.template .env.local.template
26
+
27
+ RUN mkdir defaults
28
+ ADD defaults /defaults
29
+ RUN chmod -R 777 /defaults
30
+ RUN --mount=type=secret,id=MONGODB_URL,mode=0444 \
31
+ MODEL_NAME="${MODEL_NAME:="$(cat /defaults/MODEL_NAME)"}" && export MODEL_NAME \
32
+ && MODEL_PARAMS="${MODEL_PARAMS:="$(cat /defaults/MODEL_PARAMS)"}" && export MODEL_PARAMS \
33
+ && APP_COLOR="${APP_COLOR:="$(cat /defaults/APP_COLOR)"}" && export APP_COLOR \
34
+ && APP_NAME="${APP_NAME:="$(cat /defaults/APP_NAME)"}" && export APP_NAME \
35
+ && MONGODB_URL=$(cat /run/secrets/MONGODB_URL > /dev/null | grep '^' || cat /defaults/MONGODB_URL) && export MONGODB_URL && \
36
+ echo "${MONGODB_URL}" && \
37
+ envsubst < ".env.local.template" > ".env.local" \
38
+ && rm .env.local.template
39
+
40
 
 
41
 
42
  RUN --mount=type=cache,target=/app/.npm \
43
+ npm set cache /app/.npm && \
44
+ npm ci
45
+
46
+ RUN npm run build
47
+
48
+ FROM ghcr.io/huggingface/text-generation-inference:0.9.4
49
+
50
+ ARG MODEL_NAME
51
+ ARG MODEL_PARAMS
52
+ ARG APP_COLOR
53
+ ARG APP_NAME
54
+
55
+ ENV TZ=Europe/Paris \
56
+ PORT=3000
57
+
58
 
 
59
 
60
+ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
61
+ gnupg \
62
+ curl \
63
+ gettext && \
64
+ rm -rf /var/lib/apt/lists/*
65
+ COPY entrypoint.sh.template entrypoint.sh.template
66
 
67
+ RUN mkdir defaults
68
+ ADD defaults /defaults
69
+ RUN chmod -R 777 /defaults
70
 
71
+ RUN --mount=type=secret,id=MONGODB_URL,mode=0444 \
72
+ MODEL_NAME="${MODEL_NAME:="$(cat /defaults/MODEL_NAME)"}" && export MODEL_NAME \
73
+ && MODEL_PARAMS="${MODEL_PARAMS:="$(cat /defaults/MODEL_PARAMS)"}" && export MODEL_PARAMS \
74
+ && APP_COLOR="${APP_COLOR:="$(cat /defaults/APP_COLOR)"}" && export APP_COLOR \
75
+ && APP_NAME="${APP_NAME:="$(cat /defaults/APP_NAME)"}" && export APP_NAME \
76
+ && MONGODB_URL=$(cat /run/secrets/MONGODB_URL > /dev/null | grep '^' || cat /defaults/MONGODB_URL) && export MONGODB_URL && \
77
+ envsubst < "entrypoint.sh.template" > "entrypoint.sh" \
78
+ && rm entrypoint.sh.template
79
+
80
+
81
+ RUN curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
82
+ gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
83
+ --dearmor
84
+
85
+ RUN echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list
86
+
87
+ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
88
+ mongodb-org && \
89
+ rm -rf /var/lib/apt/lists/*
90
+
91
+ RUN mkdir -p /data/db
92
+ RUN chown -R 1000:1000 /data
93
+
94
+ RUN curl -fsSL https://deb.nodesource.com/setup_19.x | /bin/bash -
95
+
96
+ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
97
+ nodejs && \
98
+ rm -rf /var/lib/apt/lists/*
99
+
100
+ RUN mkdir /app
101
+ RUN chown -R 1000:1000 /app
102
+
103
+ RUN useradd -m -u 1000 user
104
+
105
+ # Switch to the "user" user
106
+ USER user
107
+
108
+ ENV HOME=/home/user \
109
+ PATH=/home/user/.local/bin:$PATH
110
+
111
+ RUN npm config set prefix /home/user/.local
112
  RUN npm install -g pm2
113
 
114
+ COPY --from=chatui-builder --chown=1000 /app/chat-ui/node_modules /app/node_modules
115
+ COPY --from=chatui-builder --chown=1000 /app/chat-ui/package.json /app/package.json
116
+ COPY --from=chatui-builder --chown=1000 /app/chat-ui/build /app/build
117
+
118
+ ENTRYPOINT ["/bin/bash"]
119
+ CMD ["entrypoint.sh"]
120
+
121
 
 
LICENSE DELETED
@@ -1,203 +0,0 @@
1
- Copyright 2018- The Hugging Face team. All rights reserved.
2
-
3
- Apache License
4
- Version 2.0, January 2004
5
- http://www.apache.org/licenses/
6
-
7
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
-
9
- 1. Definitions.
10
-
11
- "License" shall mean the terms and conditions for use, reproduction,
12
- and distribution as defined by Sections 1 through 9 of this document.
13
-
14
- "Licensor" shall mean the copyright owner or entity authorized by
15
- the copyright owner that is granting the License.
16
-
17
- "Legal Entity" shall mean the union of the acting entity and all
18
- other entities that control, are controlled by, or are under common
19
- control with that entity. For the purposes of this definition,
20
- "control" means (i) the power, direct or indirect, to cause the
21
- direction or management of such entity, whether by contract or
22
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
- outstanding shares, or (iii) beneficial ownership of such entity.
24
-
25
- "You" (or "Your") shall mean an individual or Legal Entity
26
- exercising permissions granted by this License.
27
-
28
- "Source" form shall mean the preferred form for making modifications,
29
- including but not limited to software source code, documentation
30
- source, and configuration files.
31
-
32
- "Object" form shall mean any form resulting from mechanical
33
- transformation or translation of a Source form, including but
34
- not limited to compiled object code, generated documentation,
35
- and conversions to other media types.
36
-
37
- "Work" shall mean the work of authorship, whether in Source or
38
- Object form, made available under the License, as indicated by a
39
- copyright notice that is included in or attached to the work
40
- (an example is provided in the Appendix below).
41
-
42
- "Derivative Works" shall mean any work, whether in Source or Object
43
- form, that is based on (or derived from) the Work and for which the
44
- editorial revisions, annotations, elaborations, or other modifications
45
- represent, as a whole, an original work of authorship. For the purposes
46
- of this License, Derivative Works shall not include works that remain
47
- separable from, or merely link (or bind by name) to the interfaces of,
48
- the Work and Derivative Works thereof.
49
-
50
- "Contribution" shall mean any work of authorship, including
51
- the original version of the Work and any modifications or additions
52
- to that Work or Derivative Works thereof, that is intentionally
53
- submitted to Licensor for inclusion in the Work by the copyright owner
54
- or by an individual or Legal Entity authorized to submit on behalf of
55
- the copyright owner. For the purposes of this definition, "submitted"
56
- means any form of electronic, verbal, or written communication sent
57
- to the Licensor or its representatives, including but not limited to
58
- communication on electronic mailing lists, source code control systems,
59
- and issue tracking systems that are managed by, or on behalf of, the
60
- Licensor for the purpose of discussing and improving the Work, but
61
- excluding communication that is conspicuously marked or otherwise
62
- designated in writing by the copyright owner as "Not a Contribution."
63
-
64
- "Contributor" shall mean Licensor and any individual or Legal Entity
65
- on behalf of whom a Contribution has been received by Licensor and
66
- subsequently incorporated within the Work.
67
-
68
- 2. Grant of Copyright License. Subject to the terms and conditions of
69
- this License, each Contributor hereby grants to You a perpetual,
70
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
- copyright license to reproduce, prepare Derivative Works of,
72
- publicly display, publicly perform, sublicense, and distribute the
73
- Work and such Derivative Works in Source or Object form.
74
-
75
- 3. Grant of Patent License. Subject to the terms and conditions of
76
- this License, each Contributor hereby grants to You a perpetual,
77
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
- (except as stated in this section) patent license to make, have made,
79
- use, offer to sell, sell, import, and otherwise transfer the Work,
80
- where such license applies only to those patent claims licensable
81
- by such Contributor that are necessarily infringed by their
82
- Contribution(s) alone or by combination of their Contribution(s)
83
- with the Work to which such Contribution(s) was submitted. If You
84
- institute patent litigation against any entity (including a
85
- cross-claim or counterclaim in a lawsuit) alleging that the Work
86
- or a Contribution incorporated within the Work constitutes direct
87
- or contributory patent infringement, then any patent licenses
88
- granted to You under this License for that Work shall terminate
89
- as of the date such litigation is filed.
90
-
91
- 4. Redistribution. You may reproduce and distribute copies of the
92
- Work or Derivative Works thereof in any medium, with or without
93
- modifications, and in Source or Object form, provided that You
94
- meet the following conditions:
95
-
96
- (a) You must give any other recipients of the Work or
97
- Derivative Works a copy of this License; and
98
-
99
- (b) You must cause any modified files to carry prominent notices
100
- stating that You changed the files; and
101
-
102
- (c) You must retain, in the Source form of any Derivative Works
103
- that You distribute, all copyright, patent, trademark, and
104
- attribution notices from the Source form of the Work,
105
- excluding those notices that do not pertain to any part of
106
- the Derivative Works; and
107
-
108
- (d) If the Work includes a "NOTICE" text file as part of its
109
- distribution, then any Derivative Works that You distribute must
110
- include a readable copy of the attribution notices contained
111
- within such NOTICE file, excluding those notices that do not
112
- pertain to any part of the Derivative Works, in at least one
113
- of the following places: within a NOTICE text file distributed
114
- as part of the Derivative Works; within the Source form or
115
- documentation, if provided along with the Derivative Works; or,
116
- within a display generated by the Derivative Works, if and
117
- wherever such third-party notices normally appear. The contents
118
- of the NOTICE file are for informational purposes only and
119
- do not modify the License. You may add Your own attribution
120
- notices within Derivative Works that You distribute, alongside
121
- or as an addendum to the NOTICE text from the Work, provided
122
- that such additional attribution notices cannot be construed
123
- as modifying the License.
124
-
125
- You may add Your own copyright statement to Your modifications and
126
- may provide additional or different license terms and conditions
127
- for use, reproduction, or distribution of Your modifications, or
128
- for any such Derivative Works as a whole, provided Your use,
129
- reproduction, and distribution of the Work otherwise complies with
130
- the conditions stated in this License.
131
-
132
- 5. Submission of Contributions. Unless You explicitly state otherwise,
133
- any Contribution intentionally submitted for inclusion in the Work
134
- by You to the Licensor shall be under the terms and conditions of
135
- this License, without any additional terms or conditions.
136
- Notwithstanding the above, nothing herein shall supersede or modify
137
- the terms of any separate license agreement you may have executed
138
- with Licensor regarding such Contributions.
139
-
140
- 6. Trademarks. This License does not grant permission to use the trade
141
- names, trademarks, service marks, or product names of the Licensor,
142
- except as required for reasonable and customary use in describing the
143
- origin of the Work and reproducing the content of the NOTICE file.
144
-
145
- 7. Disclaimer of Warranty. Unless required by applicable law or
146
- agreed to in writing, Licensor provides the Work (and each
147
- Contributor provides its Contributions) on an "AS IS" BASIS,
148
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
- implied, including, without limitation, any warranties or conditions
150
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
- PARTICULAR PURPOSE. You are solely responsible for determining the
152
- appropriateness of using or redistributing the Work and assume any
153
- risks associated with Your exercise of permissions under this License.
154
-
155
- 8. Limitation of Liability. In no event and under no legal theory,
156
- whether in tort (including negligence), contract, or otherwise,
157
- unless required by applicable law (such as deliberate and grossly
158
- negligent acts) or agreed to in writing, shall any Contributor be
159
- liable to You for damages, including any direct, indirect, special,
160
- incidental, or consequential damages of any character arising as a
161
- result of this License or out of the use or inability to use the
162
- Work (including but not limited to damages for loss of goodwill,
163
- work stoppage, computer failure or malfunction, or any and all
164
- other commercial damages or losses), even if such Contributor
165
- has been advised of the possibility of such damages.
166
-
167
- 9. Accepting Warranty or Additional Liability. While redistributing
168
- the Work or Derivative Works thereof, You may choose to offer,
169
- and charge a fee for, acceptance of support, warranty, indemnity,
170
- or other liability obligations and/or rights consistent with this
171
- License. However, in accepting such obligations, You may act only
172
- on Your own behalf and on Your sole responsibility, not on behalf
173
- of any other Contributor, and only if You agree to indemnify,
174
- defend, and hold each Contributor harmless for any liability
175
- incurred by, or claims asserted against, such Contributor by reason
176
- of your accepting any such warranty or additional liability.
177
-
178
- END OF TERMS AND CONDITIONS
179
-
180
- APPENDIX: How to apply the Apache License to your work.
181
-
182
- To apply the Apache License to your work, attach the following
183
- boilerplate notice, with the fields enclosed by brackets "[]"
184
- replaced with your own identifying information. (Don't include
185
- the brackets!) The text should be enclosed in the appropriate
186
- comment syntax for the file format. We also recommend that a
187
- file or class name and description of purpose be included on the
188
- same "printed page" as the copyright notice for easier
189
- identification within third-party archives.
190
-
191
- Copyright [yyyy] [name of copyright owner]
192
-
193
- Licensed under the Apache License, Version 2.0 (the "License");
194
- you may not use this file except in compliance with the License.
195
- You may obtain a copy of the License at
196
-
197
- http://www.apache.org/licenses/LICENSE-2.0
198
-
199
- Unless required by applicable law or agreed to in writing, software
200
- distributed under the License is distributed on an "AS IS" BASIS,
201
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
- See the License for the specific language governing permissions and
203
- limitations under the License.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
PRIVACY.md DELETED
@@ -1,38 +0,0 @@
1
- ## Privacy
2
-
3
- > Last updated: July 23, 2023
4
-
5
- Users of HuggingChat are authenticated through their HF user account.
6
-
7
- By default, your conversations may be shared with the respective models' authors (e.g. if you're chatting with the Open Assistant model, to <a target="_blank" href="https://open-assistant.io/dashboard">Open Assistant</a>) to improve their training data and model over time. Model authors are the custodians of the data collected by their model, even if it's hosted on our platform.
8
-
9
- If you disable data sharing in your settings, your conversations will not be used for any downstream usage (including for research or model training purposes), and they will only be stored to let you access past conversations. You can click on the Delete icon to delete any past conversation at any moment.
10
-
11
- 🗓 Please also consult huggingface.co's main privacy policy at https://huggingface.co/privacy. To exercise any of your legal privacy rights, please send an email to privacy@huggingface.co.
12
-
13
- ## About available LLMs
14
-
15
- The goal of this app is to showcase that it is now (May 2023) possible to build an open source alternative to ChatGPT. 💪
16
-
17
- For now, it's running both OpenAssistant's [latest LLaMA based model](https://huggingface.co/OpenAssistant/oasst-sft-6-llama-30b-xor) (which is one of the current best open source chat models) as well as [Meta's newer Llama 2](https://huggingface.co/meta-llama/Llama-2-70b-chat-hf), but the plan in the longer-term is to expose all good-quality chat models from the Hub.
18
-
19
- We are not affiliated with Open Assistant nor Meta AI, but if you want to contribute to the training data for the next generation of open models, please consider contributing to https://open-assistant.io/ or https://ai.meta.com/llama/ ❤️
20
-
21
- ## Technical details
22
-
23
- This app is running in a [Space](https://huggingface.co/docs/hub/spaces-overview), which entails that the code for this UI is publicly visible [inside the Space repo](https://huggingface.co/spaces/huggingchat/chat-ui/tree/main).
24
-
25
- **Further development takes place on the [huggingface/chat-ui GitHub repo](https://github.com/huggingface/chat-ui).**
26
-
27
- The inference backend is running the optimized [text-generation-inference](https://github.com/huggingface/text-generation-inference) on HuggingFace's Inference API infrastructure.
28
-
29
- It is therefore possible to deploy a copy of this app to a Space and customize it (swap model, add some UI elements, or store user messages according to your own Terms and conditions). You can also 1-click deploy your own instance using the [Chat UI Spaces Docker template](https://huggingface.co/new-space?template=huggingchat/chat-ui-template).
30
-
31
- We welcome any feedback on this app: please participate to the public discussion at https://huggingface.co/spaces/huggingchat/chat-ui/discussions
32
-
33
- <a target="_blank" href="https://huggingface.co/spaces/huggingchat/chat-ui/discussions"><img src="https://huggingface.co/datasets/huggingface/badges/raw/main/open-a-discussion-xl.svg" title="open a discussion"></a>
34
-
35
- ## Coming soon
36
-
37
- - User setting to share conversations with model authors (done ✅)
38
- - LLM watermarking
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md CHANGED
@@ -1,325 +1,12 @@
1
  ---
2
- title: chat-ui
3
- emoji: 🔥
4
- colorFrom: purple
5
- colorTo: purple
6
  sdk: docker
7
  pinned: false
8
- license: apache-2.0
9
- base_path: /chat
10
  app_port: 3000
 
11
  ---
12
 
13
- # Chat UI
14
-
15
- ![Chat UI repository thumbnail](https://huggingface.co/datasets/huggingface/documentation-images/raw/f038917dd40d711a72d654ab1abfc03ae9f177e6/chat-ui-repo-thumbnail.svg)
16
-
17
- A chat interface using open source models, eg OpenAssistant or Llama. It is a SvelteKit app and it powers the [HuggingChat app on hf.co/chat](https://huggingface.co/chat).
18
-
19
- 0. [No Setup Deploy](#no-setup-deploy)
20
- 1. [Setup](#setup)
21
- 2. [Launch](#launch)
22
- 3. [Extra parameters](#extra-parameters)
23
- 4. [Deploying to a HF Space](#deploying-to-a-hf-space)
24
- 5. [Building](#building)
25
-
26
- ##  No Setup Deploy
27
-
28
- If you don't want to configure, setup, and launch your own Chat UI yourself, you can use this option as a fast deploy alternative.
29
-
30
- You can deploy your own customized Chat UI instance with any supported LLM of your choice with only a few clicks to Hugging Face Spaces thanks to the Chat UI Spaces Docker template. Get started [here](https://huggingface.co/new-space?template=huggingchat/chat-ui-template).
31
- If you'd like to deploy a model with gated access or a model in a private repository, you can simply provide `HUGGING_FACE_HUB_TOKEN` in [Space secrets](https://huggingface.co/docs/hub/spaces-overview#managing-secrets-and-environment-variables). You need to set its value to an access token you can get from [here](https://huggingface.co/settings/tokens).
32
-
33
- Read the full tutorial [here](https://huggingface.co/docs/hub/spaces-sdks-docker-chatui#chatui-on-spaces).
34
-
35
- ## Setup
36
-
37
- The default config for Chat UI is stored in the `.env` file. You will need to override some values to get Chat UI to run locally. This is done in `.env.local`.
38
-
39
- Start by creating a `.env.local` file in the root of the repository. The bare minimum config you need to get Chat UI to run locally is the following:
40
-
41
- ```bash
42
- MONGODB_URL=<the URL to your mongoDB instance>
43
- HF_ACCESS_TOKEN=<your access token>
44
- ```
45
-
46
- ### Database
47
-
48
- The chat history is stored in a MongoDB instance, and having a DB instance available is needed for Chat UI to work.
49
-
50
- You can use a local MongoDB instance. The easiest way is to spin one up using docker:
51
-
52
- ```bash
53
- docker run -d -p 27017:27017 --name mongo-chatui mongo:latest
54
- ```
55
-
56
- In which case the url of your DB will be `MONGODB_URL=mongodb://localhost:27017`.
57
-
58
- Alternatively, you can use a [free MongoDB Atlas](https://www.mongodb.com/pricing) instance for this, Chat UI should fit comfortably within their free tier. After which you can set the `MONGODB_URL` variable in `.env.local` to match your instance.
59
-
60
- ### Hugging Face Access Token
61
-
62
- You will need a Hugging Face access token to run Chat UI locally, if you use a remote inference endpoint. You can get one from [your Hugging Face profile](https://huggingface.co/settings/tokens).
63
-
64
- ## Launch
65
-
66
- After you're done with the `.env.local` file you can run Chat UI locally with:
67
-
68
- ```bash
69
- npm install
70
- npm run dev
71
- ```
72
-
73
- ## Extra parameters
74
-
75
- ### OpenID connect
76
-
77
- The login feature is disabled by default and users are attributed a unique ID based on their browser. But if you want to use OpenID to authenticate your users, you can add the following to your `.env.local` file:
78
-
79
- ```bash
80
- OPENID_PROVIDER_URL=<your OIDC issuer>
81
- OPENID_CLIENT_ID=<your OIDC client ID>
82
- OPENID_CLIENT_SECRET=<your OIDC client secret>
83
- ```
84
-
85
- These variables will enable the openID sign-in modal for users.
86
-
87
- ### Theming
88
-
89
- You can use a few environment variables to customize the look and feel of chat-ui. These are by default:
90
-
91
- ```
92
- PUBLIC_APP_NAME=ChatUI
93
- PUBLIC_APP_ASSETS=chatui
94
- PUBLIC_APP_COLOR=blue
95
- PUBLIC_APP_DATA_SHARING=
96
- PUBLIC_APP_DISCLAIMER=
97
- ```
98
-
99
- - `PUBLIC_APP_NAME` The name used as a title throughout the app.
100
- - `PUBLIC_APP_ASSETS` Is used to find logos & favicons in `static/$PUBLIC_APP_ASSETS`, current options are `chatui` and `huggingchat`.
101
- - `PUBLIC_APP_COLOR` Can be any of the [tailwind colors](https://tailwindcss.com/docs/customizing-colors#default-color-palette).
102
- - `PUBLIC_APP_DATA_SHARING` Can be set to 1 to add a toggle in the user settings that lets your users opt-in to data sharing with models creator.
103
- - `PUBLIC_APP_DISCLAIMER` If set to 1, we show a disclaimer about generated outputs on login.
104
-
105
- ### Web Search
106
-
107
- You can enable the web search by adding either `SERPER_API_KEY` ([serper.dev](https://serper.dev/)) or `SERPAPI_KEY` ([serpapi.com](https://serpapi.com/)) to your `.env.local`.
108
-
109
- ### Custom models
110
-
111
- You can customize the parameters passed to the model or even use a new model by updating the `MODELS` variable in your `.env.local`. The default one can be found in `.env` and looks like this :
112
-
113
- ```
114
-
115
- MODELS=`[
116
- {
117
- "name": "OpenAssistant/oasst-sft-4-pythia-12b-epoch-3.5",
118
- "datasetName": "OpenAssistant/oasst1",
119
- "description": "A good alternative to ChatGPT",
120
- "websiteUrl": "https://open-assistant.io",
121
- "userMessageToken": "<|prompter|>", # This does not need to be a token, can be any string
122
- "assistantMessageToken": "<|assistant|>", # This does not need to be a token, can be any string
123
- "userMessageEndToken": "<|endoftext|>", # Applies only to user messages. Can be any string.
124
- "assistantMessageEndToken": "<|endoftext|>", # Applies only to assistant messages. Can be any string.
125
- "preprompt": "Below are a series of dialogues between various people and an AI assistant. The AI tries to be helpful, polite, honest, sophisticated, emotionally aware, and humble-but-knowledgeable. The assistant is happy to help with almost anything, and will do its best to understand exactly what is needed. It also tries to avoid giving false or misleading information, and it caveats when it isn't entirely sure about the right answer. That said, the assistant is practical and really does its best, and doesn't let caution get too much in the way of being useful.\n-----\n",
126
- "promptExamples": [
127
- {
128
- "title": "Write an email from bullet list",
129
- "prompt": "As a restaurant owner, write a professional email to the supplier to get these products every week: \n\n- Wine (x10)\n- Eggs (x24)\n- Bread (x12)"
130
- }, {
131
- "title": "Code a snake game",
132
- "prompt": "Code a basic snake game in python, give explanations for each step."
133
- }, {
134
- "title": "Assist in a task",
135
- "prompt": "How do I make a delicious lemon cheesecake?"
136
- }
137
- ],
138
- "parameters": {
139
- "temperature": 0.9,
140
- "top_p": 0.95,
141
- "repetition_penalty": 1.2,
142
- "top_k": 50,
143
- "truncate": 1000,
144
- "max_new_tokens": 1024,
145
- "stop": ["<|endoftext|>"] # This does not need to be tokens, can be any list of strings
146
- }
147
- }
148
- ]`
149
-
150
- ```
151
-
152
- You can change things like the parameters, or customize the preprompt to better suit your needs. You can also add more models by adding more objects to the array, with different preprompts for example.
153
-
154
- #### Custom prompt templates:
155
-
156
- By default the prompt is constructed using `userMessageToken`, `assistantMessageToken`, `userMessageEndToken`, `assistantMessageEndToken`, `preprompt` parameters and a series of default templates.
157
-
158
- However, these templates can be modified by setting the `chatPromptTemplate`, `webSearchSummaryPromptTemplate`, and `webSearchQueryPromptTemplate` parameters. Note that if WebSearch is not enabled, only `chatPromptTemplate` needs to be set. The template language is https://handlebarsjs.com. The templates have access to the model's prompt parameters (`preprompt`, etc.). However, if the templates are specified it is recommended to inline the prompt parameters, as using the references (`{{preprompt}}`) is deprecated.
159
-
160
- For example:
161
-
162
- ```
163
- <System>You are an AI, called ChatAI.</System>
164
- {{#each messages}}
165
- {{#ifUser}}<User>{{content}}</User>{{/ifUser}}
166
- {{#ifAssistant}}<Assistant>{{content}}</Assistant>{{/ifAssistant}}
167
- {{/each}}
168
- <Assistant>
169
- ```
170
-
171
- **chatPromptTemplate**
172
-
173
- When quering the model for a chat response, the `chatPromptTemplate` template is used. `messages` is an array of chat messages, it has the format `[{ content: string }, ...]`. To idenify if a message is a user message or an assistant message the `ifUser` and `ifAssistant` block helpers can be used.
174
-
175
- The following is the default `chatPromptTemplate`, although newlines and indentiation have been added for readability.
176
-
177
- ```
178
- {{preprompt}}
179
- {{#each messages}}
180
- {{#ifUser}}{{@root.userMessageToken}}{{content}}{{@root.userMessageEndToken}}{{/ifUser}}
181
- {{#ifAssistant}}{{@root.assistantMessageToken}}{{content}}{{@root.assistantMessageEndToken}}{{/ifAssistant}}
182
- {{/each}}
183
- {{assistantMessageToken}}
184
- ```
185
-
186
- **webSearchQueryPromptTemplate**
187
-
188
- When performing a websearch, the search query is constructed using the `webSearchQueryPromptTemplate` template. It is recommended that that the prompt instructs the chat model to only return a few keywords.
189
-
190
- The following is the default `webSearchQueryPromptTemplate`. Note that not all models supports consecutive user-messages which this template uses.
191
-
192
- ```
193
- {{userMessageToken}}
194
- The following messages were written by a user, trying to answer a question.
195
- {{userMessageEndToken}}
196
- {{#each messages}}
197
- {{#ifUser}}{{@root.userMessageToken}}{{content}}{{@root.userMessageEndToken}}{{/ifUser}}
198
- {{/each}}
199
- {{userMessageToken}}
200
- What plain-text english sentence would you input into Google to answer the last question? Answer with a short (10 words max) simple sentence.
201
- {{userMessageEndToken}}
202
- {{assistantMessageToken}}Query:
203
- ```
204
-
205
- **webSearchSummaryPromptTemplate**
206
-
207
- The search-engine response (`answer`) is summarized using the following prompt template. However, when `HF_ACCESS_TOKEN` is provided, a dedicated summary model is used instead. Additionally, the model's `query` response to `webSearchQueryPromptTemplate` is also available to this template.
208
-
209
- The following is the default `webSearchSummaryPromptTemplate`. Note that not all models supports consecutive user-messages which this template uses.
210
-
211
- ```
212
- {{userMessageToken}}{{answer}}{{userMessageEndToken}}
213
- {{userMessageToken}}
214
- The text above should be summarized to best answer the query: {{query}}.
215
- {{userMessageEndToken}}
216
- {{assistantMessageToken}}Summary:
217
- ```
218
-
219
- #### Running your own models using a custom endpoint
220
-
221
- If you want to, instead of hitting models on the Hugging Face Inference API, you can run your own models locally.
222
-
223
- A good option is to hit a [text-generation-inference](https://github.com/huggingface/text-generation-inference) endpoint. This is what is done in the official [Chat UI Spaces Docker template](https://huggingface.co/new-space?template=huggingchat/chat-ui-template) for instance: both this app and a text-generation-inference server run inside the same container.
224
-
225
- To do this, you can add your own endpoints to the `MODELS` variable in `.env.local`, by adding an `"endpoints"` key for each model in `MODELS`.
226
-
227
- ```
228
-
229
- {
230
- // rest of the model config here
231
- "endpoints": [{"url": "https://HOST:PORT"}]
232
- }
233
-
234
- ```
235
-
236
- If `endpoints` is left unspecified, ChatUI will look for the model on the hosted Hugging Face inference API using the model name.
237
-
238
- ### Custom endpoint authorization
239
-
240
- #### Basic and Bearer
241
-
242
- Custom endpoints may require authorization, depending on how you configure them. Authentication will usually be set either with `Basic` or `Bearer`.
243
-
244
- For `Basic` we will need to generate a base64 encoding of the username and password.
245
-
246
- `echo -n "USER:PASS" | base64`
247
-
248
- > VVNFUjpQQVNT
249
-
250
- For `Bearer` you can use a token, which can be grabbed from [here](https://huggingface.co/settings/tokens).
251
-
252
- You can then add the generated information and the `authorization` parameter to your `.env.local`.
253
-
254
- ```
255
-
256
- "endpoints": [
257
- {
258
- "url": "https://HOST:PORT",
259
- "authorization": "Basic VVNFUjpQQVNT",
260
- }
261
- ]
262
-
263
- ```
264
-
265
- ### Amazon SageMaker
266
-
267
- You can also specify your Amazon SageMaker instance as an endpoint for chat-ui. The config goes like this:
268
-
269
- ```
270
- "endpoints": [
271
- {
272
- "host" : "sagemaker",
273
- "url": "", // your aws sagemaker url here
274
- "accessKey": "",
275
- "secretKey" : "",
276
- "sessionToken": "", // optional
277
- "weight": 1
278
- }
279
- ```
280
-
281
- You can get the `accessKey` and `secretKey` from your AWS user, under programmatic access.
282
-
283
- #### Client Certificate Authentication (mTLS)
284
-
285
- Custom endpoints may require client certificate authentication, depending on how you configure them. To enable mTLS between Chat UI and your custom endpoint, you will need to set the `USE_CLIENT_CERTIFICATE` to `true`, and add the `CERT_PATH` and `KEY_PATH` parameters to your `.env.local`. These parameters should point to the location of the certificate and key files on your local machine. The certificate and key files should be in PEM format. The key file can be encrypted with a passphrase, in which case you will also need to add the `CLIENT_KEY_PASSWORD` parameter to your `.env.local`.
286
-
287
- If you're using a certificate signed by a private CA, you will also need to add the `CA_PATH` parameter to your `.env.local`. This parameter should point to the location of the CA certificate file on your local machine.
288
-
289
- If you're using a self-signed certificate, e.g. for testing or development purposes, you can set the `REJECT_UNAUTHORIZED` parameter to `false` in your `.env.local`. This will disable certificate validation, and allow Chat UI to connect to your custom endpoint.
290
-
291
- #### Models hosted on multiple custom endpoints
292
-
293
- If the model being hosted will be available on multiple servers/instances add the `weight` parameter to your `.env.local`. The `weight` will be used to determine the probability of requesting a particular endpoint.
294
-
295
- ```
296
-
297
- "endpoints": [
298
- {
299
- "url": "https://HOST:PORT",
300
- "weight": 1
301
- }
302
- {
303
- "url": "https://HOST:PORT",
304
- "weight": 2
305
- }
306
- ...
307
- ]
308
-
309
- ```
310
-
311
- ## Deploying to a HF Space
312
-
313
- Create a `DOTENV_LOCAL` secret to your HF space with the content of your .env.local, and they will be picked up automatically when you run.
314
-
315
- ## Building
316
-
317
- To create a production version of your app:
318
-
319
- ```bash
320
- npm run build
321
- ```
322
-
323
- You can preview the production build with `npm run preview`.
324
-
325
- > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
 
1
  ---
2
+ title: Chat Ui Template
3
+ emoji: 🚀
4
+ colorFrom: indigo
5
+ colorTo: blue
6
  sdk: docker
7
  pinned: false
 
 
8
  app_port: 3000
9
+ suggested_hardware: a10g-small
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package-lock.json DELETED
The diff for this file is too large to render. See raw diff
 
package.json DELETED
@@ -1,63 +0,0 @@
1
- {
2
- "name": "chat-ui",
3
- "version": "0.5.0",
4
- "private": true,
5
- "packageManager": "npm@9.5.0",
6
- "scripts": {
7
- "dev": "vite dev",
8
- "build": "vite build",
9
- "preview": "vite preview",
10
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
11
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
12
- "lint": "prettier --plugin-search-dir . --check . && eslint .",
13
- "format": "prettier --plugin-search-dir . --write .",
14
- "test": "MONGODB_URL=mongodb://127.0.0.1:27017/ vitest"
15
- },
16
- "devDependencies": {
17
- "@iconify-json/carbon": "^1.1.16",
18
- "@iconify-json/eos-icons": "^1.1.6",
19
- "@sveltejs/adapter-node": "^1.2.4",
20
- "@sveltejs/kit": "^1.15.10",
21
- "@tailwindcss/typography": "^0.5.9",
22
- "@types/jsdom": "^21.1.1",
23
- "@types/marked": "^4.0.8",
24
- "@types/parquetjs": "^0.10.3",
25
- "@typescript-eslint/eslint-plugin": "^5.45.0",
26
- "@typescript-eslint/parser": "^5.45.0",
27
- "eslint": "^8.28.0",
28
- "eslint-config-prettier": "^8.5.0",
29
- "eslint-plugin-svelte": "^2.27.3",
30
- "prettier": "^2.8.0",
31
- "prettier-plugin-svelte": "^2.8.1",
32
- "prettier-plugin-tailwindcss": "^0.2.7",
33
- "svelte": "^3.58.0",
34
- "svelte-check": "^3.2.0",
35
- "tslib": "^2.4.1",
36
- "typescript": "^4.9.3",
37
- "unplugin-icons": "^0.16.1",
38
- "vite": "^4.3.9",
39
- "vitest": "^0.31.0"
40
- },
41
- "type": "module",
42
- "dependencies": {
43
- "@huggingface/hub": "^0.5.1",
44
- "@huggingface/inference": "^2.2.0",
45
- "autoprefixer": "^10.4.14",
46
- "aws4fetch": "^1.0.17",
47
- "date-fns": "^2.29.3",
48
- "dotenv": "^16.0.3",
49
- "handlebars": "^4.7.8",
50
- "highlight.js": "^11.7.0",
51
- "jsdom": "^22.0.0",
52
- "marked": "^4.3.0",
53
- "mongodb": "^5.3.0",
54
- "nanoid": "^4.0.2",
55
- "openid-client": "^5.4.2",
56
- "parquetjs": "^0.11.2",
57
- "postcss": "^8.4.21",
58
- "serpapi": "^1.1.1",
59
- "tailwind-scrollbar": "^3.0.0",
60
- "tailwindcss": "^3.3.1",
61
- "zod": "^3.21.4"
62
- }
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
postcss.config.js DELETED
@@ -1,6 +0,0 @@
1
- export default {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
6
- };
 
 
 
 
 
 
 
svelte.config.js DELETED
@@ -1,29 +0,0 @@
1
- import adapter from "@sveltejs/adapter-node";
2
- import { vitePreprocess } from "@sveltejs/kit/vite";
3
- import dotenv from "dotenv";
4
-
5
- dotenv.config({ path: "./.env.local" });
6
- dotenv.config({ path: "./.env" });
7
-
8
- process.env.PUBLIC_VERSION = process.env.npm_package_version;
9
-
10
- /** @type {import('@sveltejs/kit').Config} */
11
- const config = {
12
- // Consult https://kit.svelte.dev/docs/integrations#preprocessors
13
- // for more information about preprocessors
14
- preprocess: vitePreprocess(),
15
-
16
- kit: {
17
- adapter: adapter(),
18
-
19
- paths: {
20
- base: process.env.APP_BASE || "",
21
- },
22
- csrf: {
23
- // handled in hooks.server.ts, because we can have multiple valid origins
24
- checkOrigin: false,
25
- },
26
- },
27
- };
28
-
29
- export default config;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tailwind.config.cjs DELETED
@@ -1,29 +0,0 @@
1
- const defaultTheme = require("tailwindcss/defaultTheme");
2
- const colors = require("tailwindcss/colors");
3
-
4
- import dotenv from "dotenv";
5
- dotenv.config({ path: "./.env" });
6
-
7
- /** @type {import('tailwindcss').Config} */
8
- export default {
9
- darkMode: "class",
10
- content: ["./src/**/*.{html,js,svelte,ts}"],
11
- theme: {
12
- extend: {
13
- colors: {
14
- primary: colors[process.env.PUBLIC_APP_COLOR],
15
- },
16
- // fontFamily: {
17
- // sans: ['"Inter"', ...defaultTheme.fontFamily.sans]
18
- // },
19
- fontSize: {
20
- xxs: "0.625rem",
21
- smd: "0.94rem",
22
- },
23
- },
24
- },
25
- plugins: [
26
- require("tailwind-scrollbar")({ nocompatible: true }),
27
- require("@tailwindcss/typography"),
28
- ],
29
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tsconfig.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "extends": "./.svelte-kit/tsconfig.json",
3
- "compilerOptions": {
4
- "allowJs": true,
5
- "checkJs": true,
6
- "esModuleInterop": true,
7
- "forceConsistentCasingInFileNames": true,
8
- "resolveJsonModule": true,
9
- "skipLibCheck": true,
10
- "sourceMap": true,
11
- "strict": true,
12
- "target": "ES2018"
13
- }
14
- // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
15
- //
16
- // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
17
- // from the referenced tsconfig.json - TypeScript does not merge them in
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vite.config.ts DELETED
@@ -1,12 +0,0 @@
1
- import { sveltekit } from "@sveltejs/kit/vite";
2
- import { defineConfig } from "vite";
3
- import Icons from "unplugin-icons/vite";
4
-
5
- export default defineConfig({
6
- plugins: [
7
- sveltekit(),
8
- Icons({
9
- compiler: "svelte",
10
- }),
11
- ],
12
- });