Skip to content

Commit e14fbc6

Browse files
committed
sync: import fork main changes onto upstream base
1 parent ebeff50 commit e14fbc6

File tree

260 files changed

+5255
-28957
lines changed

Some content is hidden

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

260 files changed

+5255
-28957
lines changed

.env

Lines changed: 28 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -10,58 +10,27 @@ MONGODB_DB_NAME=chat-ui
1010
MONGODB_DIRECT_CONNECTION=false
1111

1212
### Local Storage ###
13-
MODELS_STORAGE_PATH= # where are .gguf for model inference stored
1413
MONGO_STORAGE_PATH= # where is the db folder stored
1514

16-
### Endpoints config ###
15+
### Endpoints config (OpenAI-compatible only) ###
1716
HF_API_ROOT=https://api-inference.huggingface.co/models
18-
# HF_TOKEN is used for a lot of things, not only for inference but also fetching tokenizers, etc.
19-
# We recommend using an HF_TOKEN even if you use a local endpoint.
20-
HF_TOKEN= #get it from https://huggingface.co/settings/token
21-
# API Keys for providers, you will need to specify models in the MODELS section but these keys can be kept secret
22-
OPENAI_API_KEY=#your openai api key here
23-
ANTHROPIC_API_KEY=#your anthropic api key here
24-
CLOUDFLARE_ACCOUNT_ID=#your cloudflare account id here
25-
CLOUDFLARE_API_TOKEN=#your cloudflare api token here
26-
COHERE_API_TOKEN=#your cohere api token here
27-
GOOGLE_GENAI_API_KEY=#your google genai api token here
17+
# Canonical auth token for any OpenAI-compatible provider
18+
OPENAI_API_KEY=#your provider API key (works for HF router, OpenAI, LM Studio, etc.)
19+
# Legacy alias (still supported): if set and OPENAI_API_KEY is empty, it will be used
20+
HF_TOKEN=
21+
22+
# If set, Chat UI will pull models exclusively from an OpenAI-compatible API,
23+
# calling `${OPENAI_BASE_URL}/models` and ignoring MODELS and GGUF discovery.
24+
# Example: https://router.huggingface.co/v1
25+
OPENAI_BASE_URL=
26+
27+
# OPENAI_MODEL_LIST_URL has been removed.
2828

2929

3030
### Models ###
31-
## Models can support many different endpoints, check the documentation for more details
32-
MODELS=`[
33-
{
34-
"name": "NousResearch/Hermes-3-Llama-3.1-8B",
35-
"description": "Nous Research's latest Hermes 3 release in 8B size.",
36-
"promptExamples": [
37-
{
38-
"title": "Write an email",
39-
"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)"
40-
}, {
41-
"title": "Code a game",
42-
"prompt": "Code a basic snake game in python, give explanations for each step."
43-
}, {
44-
"title": "Recipe help",
45-
"prompt": "How do I make a delicious lemon cheesecake?"
46-
}
47-
]
48-
}
49-
]`
50-
51-
LOAD_GGUF_MODELS=true
52-
## Text Embedding Models used for websearch
53-
# Default is a model that runs locally on CPU.
54-
TEXT_EMBEDDING_MODELS = `[
55-
{
56-
"name": "Xenova/gte-small",
57-
"displayName": "Xenova/gte-small",
58-
"description": "Local embedding model running on the server.",
59-
"chunkCharLength": 512,
60-
"endpoints": [
61-
{ "type": "transformersjs" }
62-
]
63-
}
64-
]`
31+
# Models are sourced exclusively from an OpenAI-compatible base URL.
32+
# See OPENAI_BASE_URL above.
33+
## Text Embedding Models (removed in this build)
6534

6635

6736
REASONING_SUMMARY=true # Change this to false to disable reasoning summary
@@ -70,11 +39,11 @@ REASONING_SUMMARY=true # Change this to false to disable reasoning summary
7039
OLD_MODELS=`[]`
7140

7241
## Task model
73-
# name of the model used for tasks such as summarizing title, creating query, etc.
74-
# if not set, the first model in MODELS will be used
42+
# Optional: set to the model id/name from the `${OPENAI_BASE_URL}/models` list
43+
# to use for internal tasks (title summarization, etc). If not set, the first
44+
# listed model will be used.
7545
TASK_MODEL=
7646

77-
7847
### Authentication ###
7948
# Parameters to enable open id login
8049
OPENID_CONFIG=
@@ -98,23 +67,8 @@ ADMIN_CLI_LOGIN=true # set to false to disable the CLI login
9867
ADMIN_TOKEN=#We recommend leaving this empty, you can get the token from the terminal.
9968

10069

101-
### Websearch ###
102-
## API Keys used to activate search with web functionality. websearch is disabled if none are defined. choose one of the following:
103-
YDC_API_KEY=#your docs.you.com api key here
104-
SERPER_API_KEY=#your serper.dev api key here
105-
SERPAPI_KEY=#your serpapi key here
106-
SERPSTACK_API_KEY=#your serpstack api key here
107-
SEARCHAPI_KEY=#your searchapi api key here
108-
USE_LOCAL_WEBSEARCH=#set to true to parse google results yourself, overrides other API keys
109-
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
110-
BING_SUBSCRIPTION_KEY=#your key
111-
## Websearch configuration
112-
PLAYWRIGHT_ADBLOCKER=true
113-
WEBSEARCH_ALLOWLIST=`[]` # if it's defined, allow websites from only this list.
114-
WEBSEARCH_BLOCKLIST=`[]` # if it's defined, block websites from this list.
115-
WEBSEARCH_JAVASCRIPT=true # CPU usage reduces by 60% on average by disabling javascript. Enable to improve website compatibility
116-
WEBSEARCH_TIMEOUT = 3500 # in milliseconds, determines how long to wait to load a page before timing out
117-
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.
70+
### Websearch (removed in this build)
71+
11872

11973

12074
## Public app configuration ##
@@ -125,13 +79,13 @@ PUBLIC_APP_DESCRIPTION=# description used throughout the app
12579
PUBLIC_APP_DATA_SHARING=# Set to 1 to enable an option in the user settings to share conversations with model authors
12680
PUBLIC_APP_DISCLAIMER=# Set to 1 to show a disclaimer on login page
12781
PUBLIC_APP_DISCLAIMER_MESSAGE=# Message to show on the login page
128-
PUBLIC_ANNOUNCEMENT_BANNERS=`[
129-
{
130-
"title": "chat-ui is now open source!",
131-
"linkTitle": "check it out",
132-
"linkHref": "https://github.com/huggingface/chat-ui"
133-
}
134-
]`
82+
# PUBLIC_ANNOUNCEMENT_BANNERS=`[
83+
# {
84+
# "title": "chat-ui is now open source!",
85+
# "linkTitle": "check it out",
86+
# "linkHref": "https://github.com/huggingface/chat-ui"
87+
# }
88+
# ]`
13589
PUBLIC_SMOOTH_UPDATES=false # set to true to enable smoothing of messages client-side, can be CPU intensive
13690
PUBLIC_ORIGIN=#https://huggingface.co
13791
PUBLIC_SHARE_PREFIX=#https://hf.co/chat
@@ -145,16 +99,12 @@ PUBLIC_APPLE_APP_ID=#1234567890 / Leave empty to disable
14599
### Feature Flags ###
146100
LLM_SUMMARIZATION=true # generate conversation titles with LLMs
147101
ENABLE_ASSISTANTS=false #set to true to enable assistants feature
148-
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.
102+
149103
REQUIRE_FEATURED_ASSISTANTS=false # require featured assistants to show in the list
150104
COMMUNITY_TOOLS=false # set to true to enable community tools
151105
ALLOW_IFRAME=true # Allow the app to be embedded in an iframe
152106
ENABLE_DATA_EXPORT=true
153107

154-
### Tools ###
155-
# Check out public config in `chart/env/prod.yaml` for more details
156-
TOOLS=`[]`
157-
158108
### Rate limits ###
159109
# See `src/lib/server/usageLimits.ts`
160110
# {
@@ -169,19 +119,14 @@ USAGE_LIMITS=`{}`
169119

170120

171121
### HuggingFace specific ###
172-
# Let user authenticate with their HF token in the /api routes. This is only useful if you have OAuth configured with huggingface.
173-
USE_HF_TOKEN_IN_API=false
174122
## Feature flag & admin settings
175123
# Used for setting early access & admin flags to users
176124
HF_ORG_ADMIN=
177125
HF_ORG_EARLY_ACCESS=
178126
WEBHOOK_URL_REPORT_ASSISTANT=#provide slack webhook url to get notified for reports/feature requests
179-
IP_TOKEN_SECRET=
180127

181128

182129
### Metrics ###
183-
METRICS_ENABLED=false
184-
METRICS_PORT=5565
185130
LOG_LEVEL=info
186131

187132

@@ -203,7 +148,6 @@ BODY_SIZE_LIMIT=15728640
203148
PUBLIC_COMMIT_SHA=
204149

205150
### LEGACY parameters
206-
HF_ACCESS_TOKEN=#LEGACY! Use HF_TOKEN instead
207151
ALLOW_INSECURE_COOKIES=false # LEGACY! Use COOKIE_SECURE and COOKIE_SAMESITE instead
208152
PARQUET_EXPORT_SECRET=#DEPRECATED, use ADMIN_API_SECRET instead
209153
RATE_LIMIT= # /!\ DEPRECATED definition of messages per minute. Use USAGE_LIMITS.messagesPerMinute instead

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
src/lib/server/fonts/*.ttf filter=lfs diff=lfs merge=lfs -text
2+
static/huggingchat/*.png filter=lfs diff=lfs merge=lfs -text
3+
static/fonts/*.ttf filter=lfs diff=lfs merge=lfs -text

Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
ARG INCLUDE_DB=false
33

44
FROM node:20-slim AS base
5-
ENV PLAYWRIGHT_SKIP_BROWSER_GC=1
65

76
# install dotenv-cli
87
RUN npm install -g dotenv-cli
@@ -21,7 +20,6 @@ WORKDIR /app
2120
RUN touch /app/.env.local
2221

2322

24-
RUN npm i --no-package-lock --no-save [email protected]
2523

2624
USER root
2725

@@ -31,9 +29,9 @@ RUN chown -R 1000:1000 /data/models
3129
RUN apt-get update
3230
RUN apt-get install gnupg curl git cmake clang libgomp1 -y
3331

34-
RUN npx playwright install --with-deps chromium
3532

36-
RUN chown -R 1000:1000 /home/user/.npm
33+
# ensure npm cache dir exists before adjusting ownership
34+
RUN mkdir -p /home/user/.npm && chown -R 1000:1000 /home/user/.npm
3735

3836
USER user
3937

0 commit comments

Comments
 (0)