Skip to content

Commit 447c7b2

Browse files
Merge branch 'main' into dev
2 parents 420cb2e + 2ad5cc4 commit 447c7b2

File tree

239 files changed

+15242
-6108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+15242
-6108
lines changed

.env

+151-115
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,32 @@
11
# Use .env.local to change these variables
22
# DO NOT EDIT THIS FILE WITH SENSITIVE DATA
33

4-
MONGODB_URL=#your mongodb URL here
4+
### MongoDB ###
5+
MONGODB_URL=#your mongodb URL here, use chat-ui-db image if you don't want to set this
56
MONGODB_DB_NAME=chat-ui
67
MONGODB_DIRECT_CONNECTION=false
78

8-
COOKIE_NAME=hf-chat
9-
TRUSTED_EMAIL_HEADER= # only set this if you understand the implications
109

11-
HF_TOKEN=#hf_<token> from https://huggingface.co/settings/token
10+
### Endpoints config ###
1211
HF_API_ROOT=https://api-inference.huggingface.co/models
13-
12+
# HF_TOKEN is used for a lot of things, not only for inference but also fetching tokenizers, etc.
13+
# We recommend using an HF_TOKEN even if you use a local endpoint.
14+
HF_TOKEN= #get it from https://huggingface.co/settings/token
15+
# API Keys for providers, you will need to specify models in the MODELS section but these keys can be kept secret
1416
OPENAI_API_KEY=#your openai api key here
1517
ANTHROPIC_API_KEY=#your anthropic api key here
1618
CLOUDFLARE_ACCOUNT_ID=#your cloudflare account id here
1719
CLOUDFLARE_API_TOKEN=#your cloudflare api token here
1820
COHERE_API_TOKEN=#your cohere api token here
21+
GOOGLE_GENAI_API_KEY=#your google genai api token here
1922

20-
HF_ACCESS_TOKEN=#LEGACY! Use HF_TOKEN instead
21-
22-
# used to activate search with web functionality. disabled if none are defined. choose one of the following:
23-
YDC_API_KEY=#your docs.you.com api key here
24-
SERPER_API_KEY=#your serper.dev api key here
25-
SERPAPI_KEY=#your serpapi key here
26-
SERPSTACK_API_KEY=#your serpstack api key here
27-
SEARCHAPI_KEY=#your searchapi api key here
28-
USE_LOCAL_WEBSEARCH=#set to true to parse google results yourself, overrides other API keys
29-
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
30-
PLAYWRIGHT_ADBLOCKER=true
31-
32-
WEBSEARCH_ALLOWLIST=`[]` # if it's defined, allow websites from only this list.
33-
WEBSEARCH_BLOCKLIST=`[]` # if it's defined, block websites from this list.
34-
WEBSEARCH_JAVASCRIPT=true # CPU usage reduces by 60% on average by disabling javascript. Enable to improve website compatibility
35-
36-
# Parameters to enable open id login
37-
OPENID_CONFIG=`{
38-
"PROVIDER_URL": "",
39-
"CLIENT_ID": "",
40-
"CLIENT_SECRET": "",
41-
"SCOPES": "",
42-
"NAME_CLAIM": ""
43-
}`
44-
45-
# /!\ legacy openid settings, prefer the config above
46-
OPENID_CLIENT_ID=
47-
OPENID_CLIENT_SECRET=
48-
OPENID_SCOPES="openid profile" # Add "email" for some providers like Google that do not provide preferred_username
49-
OPENID_NAME_CLAIM="name" # Change to "username" for some providers that do not provide name
50-
OPENID_PROVIDER_URL=https://huggingface.co # for Google, use https://accounts.google.com
51-
OPENID_TOLERANCE=
52-
OPENID_RESOURCE=
53-
54-
# Parameters to enable a global mTLS context for client fetch requests
55-
USE_CLIENT_CERTIFICATE=false
56-
CERT_PATH=#
57-
KEY_PATH=#
58-
CA_PATH=#
59-
CLIENT_KEY_PASSWORD=#
60-
REJECT_UNAUTHORIZED=true
61-
62-
TEXT_EMBEDDING_MODELS = `[
63-
{
64-
"name": "Xenova/gte-small",
65-
"displayName": "Xenova/gte-small",
66-
"description": "Local embedding model running on the server.",
67-
"chunkCharLength": 512,
68-
"endpoints": [
69-
{ "type": "transformersjs" }
70-
]
71-
}
72-
]`
7323

74-
# 'name', 'userMessageToken', 'assistantMessageToken' are required
24+
### Models ###
25+
## Models can support many different endpoints, check the documentation for more details
7526
MODELS=`[
7627
{
77-
"name": "mistralai/Mistral-7B-Instruct-v0.1",
78-
"displayName": "mistralai/Mistral-7B-Instruct-v0.1",
79-
"description": "Mistral 7B is a new Apache 2.0 model, released by Mistral AI that outperforms Llama2 13B in benchmarks.",
80-
"websiteUrl": "https://mistral.ai/news/announcing-mistral-7b/",
81-
"preprompt": "",
82-
"chatPromptTemplate" : "<s>{{#each messages}}{{#ifUser}}[INST] {{#if @first}}{{#if @root.preprompt}}{{@root.preprompt}}\n{{/if}}{{/if}}{{content}} [/INST]{{/ifUser}}{{#ifAssistant}}{{content}}</s>{{/ifAssistant}}{{/each}}",
83-
"parameters": {
84-
"temperature": 0.1,
85-
"top_p": 0.95,
86-
"repetition_penalty": 1.2,
87-
"top_k": 50,
88-
"truncate": 3072,
89-
"max_new_tokens": 1024,
90-
"stop": ["</s>"]
91-
},
28+
"name": "NousResearch/Hermes-3-Llama-3.1-8B",
29+
"description": "Nous Research's latest Hermes 3 release in 8B size.",
9230
"promptExamples": [
9331
{
9432
"title": "Write an email from bullet list",
@@ -103,64 +41,162 @@ MODELS=`[
10341
]
10442
}
10543
]`
106-
107-
OLD_MODELS=`[]`# any removed models, `{ name: string, displayName?: string, id?: string }`
108-
TASK_MODEL= # name of the model used for tasks such as summarizing title, creating query, etc.
109-
110-
PUBLIC_ORIGIN=#https://huggingface.co
111-
PUBLIC_SHARE_PREFIX=#https://hf.co/chat
112-
PUBLIC_GOOGLE_ANALYTICS_ID=#G-XXXXXXXX / Leave empty to disable
113-
PUBLIC_PLAUSIBLE_SCRIPT_URL=#/js/script.js / Leave empty to disable
114-
PUBLIC_ANNOUNCEMENT_BANNERS=`[
115-
{
116-
"title": "Code Llama 70B is available! 🦙",
117-
"linkTitle": "try it",
118-
"linkHref": "https://huggingface.co/chat?model=codellama/CodeLlama-70b-Instruct-hf"
44+
## Text Embedding Models used for websearch
45+
# Default is a model that runs locally on CPU.
46+
TEXT_EMBEDDING_MODELS = `[
47+
{
48+
"name": "Xenova/gte-small",
49+
"displayName": "Xenova/gte-small",
50+
"description": "Local embedding model running on the server.",
51+
"chunkCharLength": 512,
52+
"endpoints": [
53+
{ "type": "transformersjs" }
54+
]
11955
}
12056
]`
12157

122-
PUBLIC_APPLE_APP_ID=#1234567890 / Leave empty to disable
58+
## Removed models, useful for migrating conversations
59+
# { name: string, displayName?: string, id?: string, transferTo?: string }`
60+
OLD_MODELS=`[]`
12361

124-
PARQUET_EXPORT_DATASET=
125-
PARQUET_EXPORT_HF_TOKEN=
126-
ADMIN_API_SECRET=# secret to admin API calls, like computing usage stats or exporting parquet data
62+
## Task model
63+
# name of the model used for tasks such as summarizing title, creating query, etc.
64+
# if not set, the first model in MODELS will be used
65+
TASK_MODEL=
12766

128-
PARQUET_EXPORT_SECRET=#DEPRECATED, use ADMIN_API_SECRET instead
12967

130-
RATE_LIMIT= # /!\ Legacy definition of messages per minute. Use USAGE_LIMITS.messagesPerMinute instead
68+
### Authentication ###
69+
# Parameters to enable open id login
70+
OPENID_CONFIG=
13171
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
72+
# if it's defined, only these emails will be allowed to use login
73+
ALLOWED_USER_EMAILS=`[]`
74+
# If it's defined, users with emails matching these domains will also be allowed to use login
75+
ALLOWED_USER_DOMAINS=`[]`
76+
# valid alternative redirect URLs for OAuth, used for HuggingChat apps
77+
ALTERNATIVE_REDIRECT_URLS=`[]`
78+
### Cookies
79+
# name of the cookie used to store the session
80+
COOKIE_NAME=hf-chat
81+
# specify secure behaviour for cookies
82+
COOKIE_SAMESITE=# can be "lax", "strict", "none" or left empty
83+
COOKIE_SECURE=# set to true to only allow cookies over https
13284

133-
APP_BASE="" # base path of the app, e.g. /chat, left blank as default
85+
86+
### Websearch ###
87+
## API Keys used to activate search with web functionality. websearch is disabled if none are defined. choose one of the following:
88+
YDC_API_KEY=#your docs.you.com api key here
89+
SERPER_API_KEY=#your serper.dev api key here
90+
SERPAPI_KEY=#your serpapi key here
91+
SERPSTACK_API_KEY=#your serpstack api key here
92+
SEARCHAPI_KEY=#your searchapi api key here
93+
USE_LOCAL_WEBSEARCH=#set to true to parse google results yourself, overrides other API keys
94+
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
95+
BING_SUBSCRIPTION_KEY=#your key
96+
## Websearch configuration
97+
PLAYWRIGHT_ADBLOCKER=true
98+
WEBSEARCH_ALLOWLIST=`[]` # if it's defined, allow websites from only this list.
99+
WEBSEARCH_BLOCKLIST=`[]` # if it's defined, block websites from this list.
100+
WEBSEARCH_JAVASCRIPT=true # CPU usage reduces by 60% on average by disabling javascript. Enable to improve website compatibility
101+
WEBSEARCH_TIMEOUT = 3500 # in milliseconds, determines how long to wait to load a page before timing out
102+
ENABLE_LOCAL_FETCH=false #set to true to allow fetches on the local network. /!\ Only enable this if you have the proper firewall rules to prevent SSRF attacks and understand the implications.
103+
104+
105+
## Public app configuration ##
106+
PUBLIC_APP_GUEST_MESSAGE=# a message to the guest user. If not set, no message will be shown. Only used if you have authentication enabled.
134107
PUBLIC_APP_NAME=ChatUI # name used as title throughout the app
135108
PUBLIC_APP_ASSETS=chatui # used to find logos & favicons in static/$PUBLIC_APP_ASSETS
136-
PUBLIC_APP_COLOR=blue # can be any of tailwind colors: https://tailwindcss.com/docs/customizing-colors#default-color-palette
137-
PUBLIC_APP_DESCRIPTION=# description used throughout the app (if not set, a default one will be used)
138-
PUBLIC_APP_DATA_SHARING=#set to 1 to enable options & text regarding data sharing
139-
PUBLIC_APP_DISCLAIMER=#set to 1 to show a disclaimer on login page
140-
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. Do not insert your personal data, especially sensitive, like health data."
141-
LLM_SUMMARIZATION=true
142-
143-
EXPOSE_API=true
144-
# PUBLIC_APP_NAME=HuggingChat
145-
# PUBLIC_APP_ASSETS=huggingchat
146-
# PUBLIC_APP_COLOR=yellow
147-
# PUBLIC_APP_DESCRIPTION="Making the community's best AI chat models available to everyone."
148-
# PUBLIC_APP_DATA_SHARING=1
149-
# PUBLIC_APP_DISCLAIMER=1
109+
PUBLIC_APP_DESCRIPTION=# description used throughout the app
110+
PUBLIC_APP_DATA_SHARING=# Set to 1 to enable an option in the user settings to share conversations with model authors
111+
PUBLIC_APP_DISCLAIMER=# Set to 1 to show a disclaimer on login page
112+
PUBLIC_APP_DISCLAIMER_MESSAGE=# Message to show on the login page
113+
PUBLIC_ANNOUNCEMENT_BANNERS=`[
114+
{
115+
"title": "chat-ui is now open source!",
116+
"linkTitle": "check it out",
117+
"linkHref": "https://github.com/huggingface/chat-ui"
118+
}
119+
]`
120+
PUBLIC_SMOOTH_UPDATES=false # set to true to enable smoothing of messages client-side, can be CPU intensive
121+
PUBLIC_ORIGIN=#https://huggingface.co
122+
PUBLIC_SHARE_PREFIX=#https://hf.co/chat
150123

124+
# mostly huggingchat specific
125+
PUBLIC_GOOGLE_ANALYTICS_ID=#G-XXXXXXXX / Leave empty to disable
126+
PUBLIC_PLAUSIBLE_SCRIPT_URL=#/js/script.js / Leave empty to disable
127+
PUBLIC_APPLE_APP_ID=#1234567890 / Leave empty to disable
128+
129+
130+
### Feature Flags ###
131+
LLM_SUMMARIZATION=true # generate conversation titles with LLMs
151132
ENABLE_ASSISTANTS=false #set to true to enable assistants feature
152133
ENABLE_ASSISTANTS_RAG=false # /!\ This will let users specify arbitrary URLs that the server will then request. Make sure you have the proper firewall rules in place.
153-
REQUIRE_FEATURED_ASSISTANTS=false
154-
ENABLE_LOCAL_FETCH=false #set to true to disable the blocklist for local fetches. Only enable this if you have the proper firewall rules to prevent SSRF attacks and understand the implications.
155-
ALTERNATIVE_REDIRECT_URLS=`[]` #valide alternative redirect URL for OAuth
156-
WEBHOOK_URL_REPORT_ASSISTANT=#provide webhook url to get notified when an assistant gets reported
134+
REQUIRE_FEATURED_ASSISTANTS=false # require featured assistants to show in the list
135+
COMMUNITY_TOOLS=false # set to true to enable community tools
136+
EXPOSE_API=true # make the /api routes available
137+
ALLOW_IFRAME=true # Allow the app to be embedded in an iframe
138+
139+
140+
### Tools ###
141+
# Check out public config in `chart/env/prod.yaml` for more details
142+
TOOLS=`[]`
143+
144+
### Rate limits ###
145+
# See `src/lib/server/usageLimits.ts`
146+
# {
147+
# conversations: number, # how many conversations
148+
# messages: number, # how many messages in a conversation
149+
# assistants: number, # how many assistants
150+
# messageLength: number, # how long can a message be before we cut it off
151+
# messagesPerMinute: number, # how many messages per minute
152+
# tools: number # how many tools
153+
# }
154+
USAGE_LIMITS=`{}`
157155

158-
ALLOWED_USER_EMAILS=`[]` # if it's defined, only these emails will be allowed to use the app
159156

160-
USAGE_LIMITS=`{}`
157+
### HuggingFace specific ###
158+
# Let user authenticate with their HF token in the /api routes. This is only useful if you have OAuth configured with huggingface.
159+
USE_HF_TOKEN_IN_API=false
160+
## Feature flag & admin settings
161+
# Used for setting early access & admin flags to users
162+
HF_ORG_ADMIN=
163+
HF_ORG_EARLY_ACCESS=
164+
WEBHOOK_URL_REPORT_ASSISTANT=#provide slack webhook url to get notified for reports/feature requests
161165

162-
ALLOW_INSECURE_COOKIES=false # recommended to keep this to false but set to true if you need to run over http without tls
166+
167+
168+
### Metrics ###
163169
METRICS_ENABLED=false
164170
METRICS_PORT=5565
165171
LOG_LEVEL=info
172+
173+
174+
### Parquet export ###
175+
# Not in use anymore but useful to export conversations to a parquet file as a HuggingFace dataset
176+
PARQUET_EXPORT_DATASET=
177+
PARQUET_EXPORT_HF_TOKEN=
178+
ADMIN_API_SECRET=# secret to admin API calls, like computing usage stats or exporting parquet data
179+
180+
181+
### Docker build variables ###
182+
# These values cannot be updated at runtime
183+
# They need to be passed when building the docker image
184+
# See https://github.com/huggingface/chat-ui/main/.github/workflows/deploy-prod.yml#L44-L47
185+
APP_BASE="" # base path of the app, e.g. /chat, left blank as default
186+
PUBLIC_APP_COLOR=blue # can be any of tailwind colors: https://tailwindcss.com/docs/customizing-colors#default-color-palette
187+
### Body size limit for SvelteKit https://svelte.dev/docs/kit/adapter-node#Environment-variables-BODY_SIZE_LIMIT
166188
BODY_SIZE_LIMIT=15728640
189+
PUBLIC_COMMIT_SHA=
190+
191+
### LEGACY parameters
192+
HF_ACCESS_TOKEN=#LEGACY! Use HF_TOKEN instead
193+
ALLOW_INSECURE_COOKIES=false # LEGACY! Use COOKIE_SECURE and COOKIE_SAMESITE instead
194+
PARQUET_EXPORT_SECRET=#DEPRECATED, use ADMIN_API_SECRET instead
195+
RATE_LIMIT= # /!\ DEPRECATED definition of messages per minute. Use USAGE_LIMITS.messagesPerMinute instead
196+
OPENID_CLIENT_ID=
197+
OPENID_CLIENT_SECRET=
198+
OPENID_SCOPES="openid profile" # Add "email" for some providers like Google that do not provide preferred_username
199+
OPENID_NAME_CLAIM="name" # Change to "username" for some providers that do not provide name
200+
OPENID_PROVIDER_URL=https://huggingface.co # for Google, use https://accounts.google.com
201+
OPENID_TOLERANCE=
202+
OPENID_RESOURCE=
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Bug Report (chat-ui)
3+
about: Use this for confirmed issues with chat-ui
4+
title: ""
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
## Bug description
10+
11+
<!-- A clear and concise description of what the bug is. -->
12+
13+
## Steps to reproduce
14+
15+
<!-- Steps to reproduce the issue -->
16+
17+
## Screenshots
18+
19+
<!-- If applicable, add screenshots to help explain your problem. -->
20+
21+
## Context
22+
23+
### Logs
24+
25+
<!-- Add any logs that are relevant to your issue. Could be browser or server logs. Wrap in code blocks. -->
26+
27+
```
28+
// logs here if relevant
29+
```
30+
31+
### Specs
32+
33+
- **OS**:
34+
- **Browser**:
35+
- **chat-ui commit**:
36+
37+
### Config
38+
39+
<!-- Add the environment variables you've used to setup chat-ui, making sure to redact any secrets. -->
40+
41+
## Notes
42+
43+
<!-- Anything else relevant to help the issue get solved -->
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: Config Support
3+
about: Help with setting up chat-ui locally
4+
title: ""
5+
labels: support
6+
assignees: ""
7+
---
8+
9+
**Please use the discussions on GitHub** for getting help with setting things up instead of opening an issue: https://github.com/huggingface/chat-ui/discussions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature Request (chat-ui)
3+
about: Suggest new features to be added to chat-ui
4+
title: ""
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
## Describe your feature request
10+
11+
<!-- Short description of what this is about -->
12+
13+
## Screenshots (if relevant)
14+
15+
## Implementation idea
16+
17+
<!-- If you know how this should be implemented in the codebase, share your thoughts. Let us know if you feel like implementing it yourself as well! -->

.github/ISSUE_TEMPLATE/huggingchat.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: HuggingChat
3+
about: Requests & reporting outages on HuggingChat, the hosted version of chat-ui.
4+
title: ""
5+
labels: huggingchat
6+
assignees: ""
7+
---
8+
9+
**Do not use GitHub issues** for requesting models on HuggingChat or reporting issues with HuggingChat being down/overloaded.
10+
11+
**Use the discussions page on the hub instead:** https://huggingface.co/spaces/huggingchat/chat-ui/discussions

0 commit comments

Comments
 (0)