adowu commited on
Commit
c7615ea
1 Parent(s): 3e69399

Create .env

Browse files
Files changed (1) hide show
  1. .env +203 -108
.env CHANGED
@@ -1,66 +1,117 @@
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_TOKEN=#hf_<token> from from https://huggingface.co/settings/token
10
- HF_API_ROOT=https://api-inference.huggingface.co/models
11
- OPENAI_API_KEY=#your openai api key here
12
-
13
- HF_ACCESS_TOKEN=#LEGACY! Use HF_TOKEN instead
14
-
15
- # used to activate search with web functionality. disabled if none are defined. choose one of the following:
16
- YDC_API_KEY=#your docs.you.com api key here
17
- SERPER_API_KEY=#your serper.dev api key here
18
- SERPAPI_KEY=#your serpapi key here
19
- SERPSTACK_API_KEY=#your serpstack api key here
20
- USE_LOCAL_WEBSEARCH=#set to true to parse google results yourself, overrides other API keys
21
- SEARXNG_QUERY_URL=# where '<query>' will be replaced with query keywords see https://docs.searxng.org/dev/search_api.html eg https://searxng.yourdomain.com/search?q=<query>&engines=duckduckgo,google&format=json
22
-
23
- WEBSEARCH_ALLOWLIST=`[]` # if it's defined, allow websites from only this list.
24
- WEBSEARCH_BLOCKLIST=`[]` # if it's defined, block websites from this list.
25
-
26
- # Parameters to enable open id login
27
- OPENID_CONFIG=`{
28
- "PROVIDER_URL": "",
29
- "CLIENT_ID": "",
30
- "CLIENT_SECRET": "",
31
- "SCOPES": ""
32
- }`
33
-
34
- # /!\ legacy openid settings, prefer the config above
35
- OPENID_CLIENT_ID=
36
- OPENID_CLIENT_SECRET=
37
- OPENID_SCOPES="openid profile" # Add "email" for some providers like Google that do not provide preferred_username
38
- OPENID_PROVIDER_URL=https://huggingface.co # for Google, use https://accounts.google.com
39
- OPENID_TOLERANCE=
40
- OPENID_RESOURCE=
41
-
42
- # Parameters to enable a global mTLS context for client fetch requests
43
- USE_CLIENT_CERTIFICATE=false
44
- CERT_PATH=#
45
- KEY_PATH=#
46
- CA_PATH=#
47
- CLIENT_KEY_PASSWORD=#
48
- REJECT_UNAUTHORIZED=true
49
-
50
- TEXT_EMBEDDING_MODELS = `[
51
- {
52
- "name": "Xenova/gte-small",
53
- "displayName": "Xenova/gte-small",
54
- "description": "Local embedding model running on the server.",
55
- "chunkCharLength": 512,
56
- "endpoints": [
57
- { "type": "transformersjs" }
58
- ]
59
- }
60
- ]`
61
-
62
- # 'name', 'userMessageToken', 'assistantMessageToken' are required
63
  MODELS=`[
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  {
65
  "name": "mistralai/Mistral-7B-Instruct-v0.1",
66
  "displayName": "mistralai/Mistral-7B-Instruct-v0.1",
@@ -77,6 +128,36 @@ MODELS=`[
77
  "max_new_tokens": 1024,
78
  "stop": ["</s>"]
79
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  "promptExamples": [
81
  {
82
  "title": "Write an email from bullet list",
@@ -89,53 +170,67 @@ MODELS=`[
89
  "prompt": "How do I make a delicious lemon cheesecake?"
90
  }
91
  ]
92
- }
93
- ]`
94
-
95
- OLD_MODELS=`[]`# any removed models, `{ name: string, displayName?: string, id?: string }`
96
- TASK_MODEL= # name of the model used for tasks such as summarizing title, creating query, etc.
97
-
98
- PUBLIC_ORIGIN=#https://huggingface.co
99
- PUBLIC_SHARE_PREFIX=#https://hf.co/chat
100
- PUBLIC_GOOGLE_ANALYTICS_ID=#G-XXXXXXXX / Leave empty to disable
101
- PUBLIC_PLAUSIBLE_SCRIPT_URL=#/js/script.js / Leave empty to disable
102
- PUBLIC_ANNOUNCEMENT_BANNERS=`[
103
- {
104
- "title": "Code Llama 70B is available! 🦙",
105
- "linkTitle": "try it",
106
- "linkHref": "https://huggingface.co/chat?model=codellama/CodeLlama-70b-Instruct-hf"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
108
  ]`
109
-
110
- PARQUET_EXPORT_DATASET=
111
- PARQUET_EXPORT_HF_TOKEN=
112
- PARQUET_EXPORT_SECRET=
113
-
114
- RATE_LIMIT= # requests per minute
115
- 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
116
-
117
- APP_BASE="" # base path of the app, e.g. /chat, left blank as default
118
- PUBLIC_APP_NAME=ChatUI # name used as title throughout the app
119
- PUBLIC_APP_ASSETS=chatui # used to find logos & favicons in static/$PUBLIC_APP_ASSETS
120
- PUBLIC_APP_COLOR=blue # can be any of tailwind colors: https://tailwindcss.com/docs/customizing-colors#default-color-palette
121
- PUBLIC_APP_DESCRIPTION=# description used throughout the app (if not set, a default one will be used)
122
- PUBLIC_APP_DATA_SHARING=#set to 1 to enable options & text regarding data sharing
123
- PUBLIC_APP_DISCLAIMER=#set to 1 to show a disclaimer on login page
 
 
 
124
  PUBLIC_APP_DISCLAIMER_MESSAGE="Disclaimer: AI is an area of active research with known problems such as biased generation and misinformation. Do not use this application for high-stakes decisions or advice."
125
- LLM_SUMMERIZATION=true
126
-
 
 
 
 
 
 
 
 
127
  EXPOSE_API=true
128
- # PUBLIC_APP_NAME=HuggingChat
129
- # PUBLIC_APP_ASSETS=huggingchat
130
- # PUBLIC_APP_COLOR=yellow
131
- # PUBLIC_APP_DESCRIPTION="Making the community's best AI chat models available to everyone."
132
- # PUBLIC_APP_DATA_SHARING=1
133
- # PUBLIC_APP_DISCLAIMER=1
134
-
135
- ENABLE_ASSISTANTS=false #set to true to enable assistants feature
136
-
137
- ALTERNATIVE_REDIRECT_URLS=`[]` #valide alternative redirect URL for OAuth
138
-
139
- WEBHOOK_URL_REPORT_ASSISTANT=#provide webhook url to get notified when an assistant gets reported
140
-
141
- ALLOWED_USER_EMAILS=`[]` # if it's defined, only these emails will be allowed to use the app
 
1
+ # template used in production for HuggingChat.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  MODELS=`[
3
+ {
4
+ "name" : "mistralai/Mixtral-8x7B-Instruct-v0.1",
5
+ "description" : "The latest MoE model from Mistral AI! 8x7B and outperforms Llama 2 70B in most benchmarks.",
6
+ "websiteUrl" : "https://mistral.ai/news/mixtral-of-experts/",
7
+ "preprompt" : "",
8
+ "chatPromptTemplate": "<s> {{#each messages}}{{#ifUser}}[INST]{{#if @first}}{{#if @root.preprompt}}{{@root.preprompt}}\n{{/if}}{{/if}} {{content}} [/INST]{{/ifUser}}{{#ifAssistant}} {{content}}</s> {{/ifAssistant}}{{/each}}",
9
+ "parameters" : {
10
+ "temperature" : 0.6,
11
+ "top_p" : 0.95,
12
+ "repetition_penalty" : 1.2,
13
+ "top_k" : 50,
14
+ "truncate" : 24576,
15
+ "max_new_tokens" : 8192,
16
+ "stop" : ["</s>"]
17
+ },
18
+ "promptExamples" : [
19
+ {
20
+ "title": "Write an email from bullet list",
21
+ "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)"
22
+ }, {
23
+ "title": "Code a snake game",
24
+ "prompt": "Code a basic snake game in python, give explanations for each step."
25
+ }, {
26
+ "title": "Assist in a task",
27
+ "prompt": "How do I make a delicious lemon cheesecake?"
28
+ }
29
+ ]
30
+ },
31
+ {
32
+ "name": "meta-llama/Llama-2-70b-chat-hf",
33
+ "description": "The latest and biggest model from Meta, fine-tuned for chat.",
34
+ "websiteUrl": "https://ai.meta.com/llama/",
35
+ "preprompt": " ",
36
+ "chatPromptTemplate" : "<s>[INST] <<SYS>>\n{{preprompt}}\n<</SYS>>\n\n{{#each messages}}{{#ifUser}}{{content}} [/INST] {{/ifUser}}{{#ifAssistant}}{{content}} </s><s>[INST] {{/ifAssistant}}{{/each}}",
37
+ "promptExamples": [
38
+ {
39
+ "title": "Write an email from bullet list",
40
+ "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)"
41
+ }, {
42
+ "title": "Code a snake game",
43
+ "prompt": "Code a basic snake game in python, give explanations for each step."
44
+ }, {
45
+ "title": "Assist in a task",
46
+ "prompt": "How do I make a delicious lemon cheesecake?"
47
+ }
48
+ ],
49
+ "parameters": {
50
+ "temperature": 0.1,
51
+ "top_p": 0.95,
52
+ "repetition_penalty": 1.2,
53
+ "top_k": 50,
54
+ "truncate": 3072,
55
+ "max_new_tokens": 1024,
56
+ "stop" : ["</s>", "</s><s>[INST]"]
57
+ }
58
+ },
59
+ {
60
+ "name" : "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
61
+ "description" : "Nous Hermes 2 Mixtral 8x7B DPO is the new flagship Nous Research model trained over the Mixtral 8x7B MoE LLM.",
62
+ "websiteUrl" : "https://nousresearch.com/",
63
+ "chatPromptTemplate" : "{{#if @root.preprompt}}<|im_start|>system\n{{@root.preprompt}}<|im_end|>\n{{/if}}{{#each messages}}{{#ifUser}}<|im_start|>user\n{{content}}<|im_end|>\n<|im_start|>assistant\n{{/ifUser}}{{#ifAssistant}}{{content}}<|im_end|>\n{{/ifAssistant}}{{/each}}",
64
+ "promptExamples": [
65
+ {
66
+ "title": "Write an email from bullet list",
67
+ "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)"
68
+ }, {
69
+ "title": "Code a snake game",
70
+ "prompt": "Code a basic snake game in python, give explanations for each step."
71
+ }, {
72
+ "title": "Assist in a task",
73
+ "prompt": "How do I make a delicious lemon cheesecake?"
74
+ }
75
+ ],
76
+ "parameters": {
77
+ "temperature": 0.7,
78
+ "top_p": 0.95,
79
+ "repetition_penalty": 1,
80
+ "top_k": 50,
81
+ "truncate": 24576,
82
+ "max_new_tokens": 2048,
83
+ "stop": ["<|im_end|>"]
84
+ }
85
+ },
86
+ {
87
+ "name": "codellama/CodeLlama-70b-Instruct-hf",
88
+ "displayName": "codellama/CodeLlama-70b-Instruct-hf",
89
+ "description": "Code Llama, a state of the art code model from Meta. Now in 70B!",
90
+ "websiteUrl": "https://ai.meta.com/blog/code-llama-large-language-model-coding/",
91
+ "preprompt": "",
92
+ "chatPromptTemplate" : "<s>{{#if @root.preprompt}}Source: system\n\n {{@root.preprompt}} <step> {{/if}}{{#each messages}}{{#ifUser}}Source: user\n\n {{content}} <step> {{/ifUser}}{{#ifAssistant}}Source: assistant\n\n {{content}} <step> {{/ifAssistant}}{{/each}}Source: assistant\nDestination: user\n\n ",
93
+ "promptExamples": [
94
+ {
95
+ "title": "Fibonacci in Python",
96
+ "prompt": "Write a python function to calculate the nth fibonacci number."
97
+ }, {
98
+ "title": "JavaScript promises",
99
+ "prompt": "How can I wait for multiple JavaScript promises to fulfill before doing something with their values?"
100
+ }, {
101
+ "title": "Rust filesystem",
102
+ "prompt": "How can I load a file from disk in Rust?"
103
+ }
104
+ ],
105
+ "parameters": {
106
+ "temperature": 0.1,
107
+ "top_p": 0.95,
108
+ "repetition_penalty": 1.2,
109
+ "top_k": 50,
110
+ "truncate": 4096,
111
+ "max_new_tokens": 4096,
112
+ "stop": ["<step>", " <step>", " <step> "],
113
+ }
114
+ },
115
  {
116
  "name": "mistralai/Mistral-7B-Instruct-v0.1",
117
  "displayName": "mistralai/Mistral-7B-Instruct-v0.1",
 
128
  "max_new_tokens": 1024,
129
  "stop": ["</s>"]
130
  },
131
+ "promptExamples": [
132
+ {
133
+ "title": "Write an email from bullet list",
134
+ "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)"
135
+ }, {
136
+ "title": "Code a snake game",
137
+ "prompt": "Code a basic snake game in python, give explanations for each step."
138
+ }, {
139
+ "title": "Assist in a task",
140
+ "prompt": "How do I make a delicious lemon cheesecake?"
141
+ }
142
+ ],
143
+ "unlisted": true
144
+ },
145
+ {
146
+ "name": "mistralai/Mistral-7B-Instruct-v0.2",
147
+ "displayName": "mistralai/Mistral-7B-Instruct-v0.2",
148
+ "description": "Mistral 7B is a new Apache 2.0 model, released by Mistral AI that outperforms Llama2 13B in benchmarks.",
149
+ "websiteUrl": "https://mistral.ai/news/announcing-mistral-7b/",
150
+ "preprompt": "",
151
+ "chatPromptTemplate" : "<s>{{#each messages}}{{#ifUser}}[INST] {{#if @first}}{{#if @root.preprompt}}{{@root.preprompt}}\n{{/if}}{{/if}}{{content}} [/INST]{{/ifUser}}{{#ifAssistant}}{{content}}</s>{{/ifAssistant}}{{/each}}",
152
+ "parameters": {
153
+ "temperature": 0.3,
154
+ "top_p": 0.95,
155
+ "repetition_penalty": 1.2,
156
+ "top_k": 50,
157
+ "truncate": 3072,
158
+ "max_new_tokens": 1024,
159
+ "stop": ["</s>"]
160
+ },
161
  "promptExamples": [
162
  {
163
  "title": "Write an email from bullet list",
 
170
  "prompt": "How do I make a delicious lemon cheesecake?"
171
  }
172
  ]
173
+ },
174
+ {
175
+ "name": "openchat/openchat-3.5-0106",
176
+ "displayName": "openchat/openchat-3.5-0106",
177
+ "description": "OpenChat 3.5 is the #1 model on MT-Bench, with only 7B parameters.",
178
+ "websiteUrl": "https://huggingface.co/openchat/openchat-3.5-0106",
179
+ "preprompt": "",
180
+ "chatPromptTemplate" : "<s>{{#each messages}}{{#ifUser}}GPT4 Correct User: {{#if @first}}{{#if @root.preprompt}}{{@root.preprompt}}\n{{/if}}{{/if}}{{content}}<|end_of_turn|>GPT4 Correct Assistant:{{/ifUser}}{{#ifAssistant}}{{content}}<|end_of_turn|>{{/ifAssistant}}{{/each}}",
181
+ "parameters": {
182
+ "temperature": 0.6,
183
+ "top_p": 0.95,
184
+ "repetition_penalty": 1.2,
185
+ "top_k": 50,
186
+ "truncate": 6016,
187
+ "max_new_tokens": 2048,
188
+ "stop": ["<|end_of_turn|>"]
189
+ },
190
+ "promptExamples": [
191
+ {
192
+ "title": "Write an email from bullet list",
193
+ "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)"
194
+ }, {
195
+ "title": "Code a snake game",
196
+ "prompt": "Code a basic snake game in python, give explanations for each step."
197
+ }, {
198
+ "title": "Assist in a task",
199
+ "prompt": "How do I make a delicious lemon cheesecake?"
200
+ }
201
+ ]
202
  }
203
  ]`
204
+ OLD_MODELS=`[
205
+ {"name":"bigcode/starcoder"},
206
+ {"name":"OpenAssistant/oasst-sft-6-llama-30b-xor"},
207
+ {"name":"HuggingFaceH4/zephyr-7b-alpha"},
208
+ {"name":"openchat/openchat_3.5"},
209
+ {"name":"openchat/openchat-3.5-1210"},
210
+ {"name": "tiiuae/falcon-180B-chat"},
211
+ {"name": "codellama/CodeLlama-34b-Instruct-hf"}
212
+ ]`
213
+ TASK_MODEL='mistralai/Mistral-7B-Instruct-v0.1'
214
+ APP_BASE="/chat"
215
+ PUBLIC_ORIGIN=https://huggingface.co
216
+ PUBLIC_SHARE_PREFIX=https://hf.co/chat
217
+ PUBLIC_ANNOUNCEMENT_BANNERS=`[]`
218
+ PUBLIC_APP_NAME=HuggingChat
219
+ PUBLIC_APP_ASSETS=huggingchat
220
+ PUBLIC_APP_COLOR=yellow
221
+ PUBLIC_APP_DESCRIPTION="Making the community's best AI chat models available to everyone."
222
  PUBLIC_APP_DISCLAIMER_MESSAGE="Disclaimer: AI is an area of active research with known problems such as biased generation and misinformation. Do not use this application for high-stakes decisions or advice."
223
+ PUBLIC_APP_DATA_SHARING=1
224
+ PUBLIC_APP_DISCLAIMER=1
225
+ RATE_LIMIT=16
226
+ MESSAGES_BEFORE_LOGIN=5# how many messages a user can send in a conversation before having to login. set to 0 to force login right away
227
+ PUBLIC_GOOGLE_ANALYTICS_ID=G-8Q63TH4CSL
228
+ PUBLIC_PLAUSIBLE_SCRIPT_URL="/js/script.js"
229
+ # Not part of the .env but set as other variables in the space
230
+ # ADDRESS_HEADER=X-Forwarded-For
231
+ # XFF_DEPTH=2
232
+ ENABLE_ASSISTANTS=true
233
  EXPOSE_API=true
234
+ ALTERNATIVE_REDIRECT_URLS=`[
235
+ huggingchat://login/callback
236
+ ]`