Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
17d2394
Improve style and accessibility in the settings modal (#206)
symsmith May 12, 2023
8bb1351
🧑‍💻 Explicit error message when MongoDB configuration lacking (#208)
coyotte508 May 12, 2023
dbd3d72
Break long word in user message (#209)
TP-O May 12, 2023
0db6ce6
📌 Specifiy packageManager to prevent yarn accidents (#211)
coyotte508 May 12, 2023
ca616cc
Fix long word in assistant message (#214)
TP-O May 12, 2023
64263c4
fix deepestChild function throwing error (#213)
Grsmto May 12, 2023
55a1bbc
added svg favicon (#205)
jerryeatworld May 13, 2023
2ac7bd0
💡 parameters is no longer required for a model
coyotte508 May 13, 2023
31ef570
Update documentation on local inference
coyotte508 May 13, 2023
64d3841
Login flow (#193)
Grsmto May 15, 2023
3dbdd6a
Announcement banners Configurable with .env vars (#222)
SteveSimms May 15, 2023
a26aaaa
Update PRIVACY.md
gary149 May 15, 2023
0c599d2
Bump to `v0.2` (#229)
julien-c May 16, 2023
d9a878f
✅ Add tests setup + test sign in flow
Grsmto May 16, 2023
767afa7
🐛 Fix "signin with HF" within space + CSRF (#236)
coyotte508 May 16, 2023
26ccb67
🐛 Add missing classes for pre tag (#220)
TP-O May 16, 2023
5b779a6
✨ add thumb up/down voting system for messages (#152)
Grsmto May 17, 2023
865ebc3
🐛 Fix settings modal not resetting its state (#240)
Grsmto May 18, 2023
fd5e4ef
misc ui
gary149 May 19, 2023
4791715
✨ add conversations deletion to settings modal (#239)
Grsmto May 19, 2023
a974db9
🐛 Vote not working with new messages (#249)
Grsmto May 19, 2023
293ff91
Fix stop generating button (#244)
TP-O May 23, 2023
ff2db2e
⚡️ Improve docker incremental build time (#142)
coyotte508 May 23, 2023
1b9697f
🔧 Add "directConnection" option to MongoDB (#260)
coyotte508 May 24, 2023
101f9ef
🥅 Display OIDC error properly (#261)
coyotte508 May 24, 2023
fa3b3b4
feat openid login with google (#250)
fredguth May 24, 2023
9658717
Export to parquet: also export score (#265)
julien-c May 24, 2023
74532d2
Add incremental build + multi layer docker for size reduction (#259)
XciD May 25, 2023
aa125df
🐛 Fix export of convos (#267)
coyotte508 May 26, 2023
002a2a0
🩹 Make preferred_username optional
coyotte508 May 29, 2023
fae93d9
Added a few sections to the readme and reorganized it (#264)
nsarrazin May 31, 2023
002f606
Shared convos can be opened without being logged in (#266, #270) (#271)
nsarrazin Jun 2, 2023
0c4cf03
Add initial support for web browsing (#237)
nsarrazin Jun 2, 2023
9d7a9c3
Web search details: ui update (#277)
gary149 Jun 5, 2023
36022cf
Chat Logo Home Screen Bookmark icons for iOS (#279)
CarolynM8ri3 Jun 6, 2023
f854cbb
Bump version to v0.3 (#283)
nsarrazin Jun 7, 2023
aa18b4d
fix details arrow (#285)
gary149 Jun 7, 2023
6434339
Refactor of websearch (#281)
nsarrazin Jun 7, 2023
df5a2eb
Fix typo in Settings.ts (#286)
eltociear Jun 9, 2023
abe7804
Fixed grammar (#291)
CAPTAIN320 Jun 13, 2023
5d07536
Added ChatUI branding & put theming behind an env variable (#298)
nsarrazin Jun 16, 2023
0dace21
➕ Update README.md to Include endpoints Variable (#288)
averad Jun 19, 2023
f567f41
Fix code example preview (#300)
arifszn Jun 19, 2023
e34af36
Fix README linting & add details about auth
nsarrazin Jun 19, 2023
7457e8c
add a readme section about theming
nsarrazin Jun 20, 2023
6f7b315
Added Serper.dev API as an alternative web search provider (#302)
rogerserper Jun 20, 2023
b46dc11
add details about websearch to README
nsarrazin Jun 20, 2023
922b1b2
very basic rate limiter (#320)
nsarrazin Jun 23, 2023
0aa57de
Add support for websearch retries (#318)
nsarrazin Jun 26, 2023
fb55900
loader dots fix
gary149 Jul 6, 2023
3baa389
feat: factor out HF_API_ROOT to allow different inference endpoints (…
DayOfThePenguin Jul 11, 2023
10d1ab5
Add support for HF summarization endpoint in the websearch (#319)
nsarrazin Jul 11, 2023
1eff97d
Add optional timestamps to messages (#294)
nsarrazin Jul 12, 2023
ce2231f
Add ability to define custom model/dataset URLs (#347)
secondtruth Jul 17, 2023
b3411af
Added Docker Space deployment docs (#350)
merveenoyan Jul 18, 2023
a38cbb5
bump version to 0.4 (#353)
nsarrazin Jul 19, 2023
479dbfa
Update README.md (#354)
merveenoyan Jul 19, 2023
6183fe7
Option to disable login on first N messages (#352)
nsarrazin Jul 19, 2023
0a662b7
Revert "Option to disable login on first N messages (#352)"
gary149 Jul 19, 2023
7767757
support rate limiting based on user IP (#342)
nsarrazin Jul 20, 2023
7c4fdc9
Reopen: Feature/disable login for n messages (#356)
gary149 Jul 20, 2023
ac291a6
Revert "support rate limiting based on user IP (#342)"
nsarrazin Jul 20, 2023
569bde3
Update README.md (#359)
osanseviero Jul 20, 2023
a935f0a
Added access token note (#360)
merveenoyan Jul 28, 2023
7dd8724
Update /privacy and other content following Llama v2 release (#374)
julien-c Jul 28, 2023
19db9db
Clarify that model 'tokens' are not actual tokens (#367)
AndreasMadsen Jul 28, 2023
932ee7e
Attempt to clarify how hosted API ≠ local endpoint (#373)
julien-c Jul 28, 2023
54e8a52
Make model branding customizable based on env var (#345)
flozi00 Aug 1, 2023
d2a650e
trim and remove stop-suffixes from summary (#369)
AndreasMadsen Aug 2, 2023
8fa7bd9
add a login button when users are logged out (#381)
nsarrazin Aug 2, 2023
f209301
allow different user and assistant end-token (#375)
AndreasMadsen Aug 2, 2023
0ad340e
Leverage model link to modelUrl when informed (#385)
airibarne Aug 3, 2023
49caedf
Update README.md
krrishdholakia Sep 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Dockerfile
.vscode/
.idea
.gitignore
LICENSE
README.md
node_modules/
.svelte-kit/
41 changes: 37 additions & 4 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@

MONGODB_URL=#your mongodb URL here
MONGODB_DB_NAME=chat-ui
MONGODB_DIRECT_CONNECTION=false

COOKIE_NAME=hf-chat
HF_ACCESS_TOKEN=#hf_<token> from from https://huggingface.co/settings/token
HF_API_ROOT=https://api-inference.huggingface.co/models

# used to activate search with web functionality. disabled if none are defined. choose one of the following:
SERPER_API_KEY=#your serper.dev api key here
SERPAPI_KEY=#your serpapi key here

# Parameters to enable "Sign in with HF"
HF_CLIENT_ID=
HF_CLIENT_SECRET=
OPENID_CLIENT_ID=
OPENID_CLIENT_SECRET=
OPENID_SCOPES="openid profile" # Add "email" for some providers like Google that do not provide preferred_username
OPENID_PROVIDER_URL=https://huggingface.co # for Google, use https://accounts.google.com

# 'name', 'userMessageToken', 'assistantMessageToken', 'parameters' are required

# 'name', 'userMessageToken', 'assistantMessageToken' are required
MODELS=`[
{
"name": "OpenAssistant/oasst-sft-4-pythia-12b-epoch-3.5",
Expand Down Expand Up @@ -45,10 +55,33 @@ MODELS=`[
]`
OLD_MODELS=`[]`# any removed models, `{ name: string, displayName?: string, id?: string }`

PUBLIC_ORIGIN=#https://hf.co
PUBLIC_ORIGIN=#https://huggingface.co
PUBLIC_SHARE_PREFIX=#https://hf.co/chat
PUBLIC_GOOGLE_ANALYTICS_ID=#G-XXXXXXXX / Leave empty to disable
PUBLIC_DEPRECATED_GOOGLE_ANALYTICS_ID=#UA-XXXXXXXX-X / Leave empty to disable
PUBLIC_ANNOUNCEMENT_BANNERS=`[
{
"title": "Llama v2 is live on HuggingChat! 🦙",
"linkTitle": "Announcement",
"linkHref": "https://huggingface.co/blog/llama2"
}
]`

PARQUET_EXPORT_DATASET=
PARQUET_EXPORT_HF_TOKEN=
PARQUET_EXPORT_SECRET=

RATE_LIMIT= # requests per minute
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

PUBLIC_APP_NAME=ChatUI # name used as title throughout the app
PUBLIC_APP_ASSETS=chatui # used to find logos & favicons in static/$PUBLIC_APP_ASSETS
PUBLIC_APP_COLOR=blue # can be any of tailwind colors: https://tailwindcss.com/docs/customizing-colors#default-color-palette
PUBLIC_APP_DATA_SHARING=#set to 1 to enable options & text regarding data sharing
PUBLIC_APP_DISCLAIMER=#set to 1 to show a disclaimer on login page

# PUBLIC_APP_NAME=HuggingChat
# PUBLIC_APP_ASSETS=huggingchat
# PUBLIC_APP_COLOR=yellow
# PUBLIC_APP_DATA_SHARING=1
# PUBLIC_APP_DISCLAIMER=1
22 changes: 22 additions & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,25 @@ jobs:
- name: "Checking type errors"
run: |
npm run check
test:
runs-on: ubuntu-latest
timeout-minutes: 10

services:
mongodb:
image: mongo:6.0.5
ports:
- 27017:27017

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
- run: |
npm ci
- name: "Tests"
run: |
npm run test
27 changes: 21 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
FROM node:19 as builder-production

FROM node:19
WORKDIR /app

RUN npm install -g pm2
COPY --link --chown=1000 package-lock.json package.json ./
RUN --mount=type=cache,target=/app/.npm \
npm set cache /app/.npm && \
npm ci --omit=dev

WORKDIR /app
FROM builder-production as builder

RUN --mount=type=cache,target=/app/.npm \
npm set cache /app/.npm && \
npm ci

COPY --link --chown=1000 . .

RUN npm i
RUN --mount=type=secret,id=DOTENV_LOCAL,dst=.env.local \
npm run build

FROM node:19-slim

RUN npm install -g pm2

RUN --mount=type=secret,id=DOTENV_LOCAL,dst=.env.local npm run build
COPY --from=builder-production /app/node_modules /app/node_modules
COPY --link --chown=1000 package.json /app/package.json
COPY --from=builder /app/build /app/build

CMD pm2 start build/index.js -i $CPU_CORES --no-daemon
CMD pm2 start /app/build/index.js -i $CPU_CORES --no-daemon
12 changes: 6 additions & 6 deletions PRIVACY.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Privacy

> Last updated: May 11th, 2023
> Last updated: July 23, 2023

In this `v0.1` of HuggingChat, users are not authenticated in any way, i.e. this app doesn't have access to your HF user account even if you're logged in to huggingface.co. The app is only using an anonymous session cookie. ❗️ Warning ❗️ this means if you switch browsers or clear cookies, you will currently lose your conversations.
Users of HuggingChat are authenticated through their HF user account.

By default, your conversations are shared with the model's authors (for the `v0.1` 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.
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.

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.

Expand All @@ -14,9 +14,9 @@ If you disable data sharing in your settings, your conversations will not be use

The goal of this app is to showcase that it is now (May 2023) possible to build an open source alternative to ChatGPT. 💪

For now, it's running 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), but the plan in the longer-term is to expose all good-quality chat models from the Hub.
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.

We are not affiliated with Open Assistant, 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/ ❤️
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/ ❤️

## Technical details

Expand All @@ -26,7 +26,7 @@ This app is running in a [Space](https://huggingface.co/docs/hub/spaces-overview

The inference backend is running the optimized [text-generation-inference](https://github.com/huggingface/text-generation-inference) on HuggingFace's Inference API infrastructure.

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)
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).

We welcome any feedback on this app: please participate to the public discussion at https://huggingface.co/spaces/huggingchat/chat-ui/discussions

Expand Down
Loading