Skip to content

Test New LLMs (Llama2, CodeLlama, etc.) on Chat-UI? #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 73 commits into
base: main
Choose a base branch
from

Conversation

krrishdholakia
Copy link

Hi @ThrownLemon,

Notice you forked chat-ui. if you're trying to test other LLMs (codellama, wizardcoder, etc.) with it, I just wrote a 1-click proxy to translate openai calls to huggingface, anthropic, togetherai, etc. api calls.

code

$ pip install litellm

$ litellm --model huggingface/bigcode/starcoder

#INFO:     Uvicorn running on http://0.0.0.0:8000

>> openai.api_base = "http://0.0.0.0:8000"

Here's the PR on adding openai to chat-ui: huggingface#452

I'd love to know if this solves a problem for you

symsmith and others added 30 commits May 12, 2023 10:38
* fix deepestChild function throwing error

* let -> const

* remove unecessary var
close huggingface#203 

* added svg favicon and updated link

* included png favicon as fallback sizes 16 and 32

* removed sizes to avoid duplicates
* replace EthicsModal by LoginModal and start binding auth logic

* start implementing login modal + give a try to @auth/sveltekit

using Github oauth as a test

* start custom auth implementation instead of auth.js for consistency with moon-landing

* fetch user data from provider

* add migration from anonymous to user + bind frontend

* add missing auth secret + only migrate conversations for pre-existing users

* remove email scope as it's not needed

Co-authored-by: Eliott C. <[email protected]>

* no need to define .well-known path

Co-authored-by: Eliott C. <[email protected]>

* use env var for hf hub website url

* move sessionId to signature on csrf token exchange

* remove ethic modal check and set default settings on new users

* anonymous users can read only + modal on write tries

* refresh session cookie when existing user signin again rather than use the old one

* allow users to keep using the app without loging-in if env var is not present

* typo

* handle denied login

* do not use a form action for login as there is nothing post-ed

* use requiresUser instead of env var to define login modal or not

* move back to a form action for login so user can't be linked to /login directly

* show login modal even for pre-existing users

* fix logic of account creation/updates

* settings insertOne instead of updateOne

* fix missing userId to settings creation

* fix missing updatedAt when updating settings of pre-existing users

* show login modal for everyone + add comments

* fix login modal condition for both required/not required login

* 🔨

* bring back missing form values in login modal

* refactor default settings spread around to a constant

* missing default settings

* typo

* rename a bunch of things to remove SSO references

* always migrate conversations

* remove unneeded sha256 Node specific function, replace with browser crypto API

* fix typings

* Update src/lib/components/LoginModal.svelte

* use authCondition() in callback

* add logout

* 🐛 Fix signout

cc @Grsmto, because "path" of the cookie should be "/"

* fixup! 🐛 Fix signout

* sign out button ui

* add hf logo in the button

---------

Co-authored-by: Eliott C. <[email protected]>
Co-authored-by: Victor Mustar <[email protected]>
* replace EthicsModal by LoginModal and start binding auth logic

* start implementing login modal + give a try to @auth/sveltekit

using Github oauth as a test

* start custom auth implementation instead of auth.js for consistency with moon-landing

* fetch user data from provider

* add migration from anonymous to user + bind frontend

* add missing auth secret + only migrate conversations for pre-existing users

* remove email scope as it's not needed

Co-authored-by: Eliott C. <[email protected]>

* no need to define .well-known path

Co-authored-by: Eliott C. <[email protected]>

* use env var for hf hub website url

* move sessionId to signature on csrf token exchange

* remove ethic modal check and set default settings on new users

* anonymous users can read only + modal on write tries

* refresh session cookie when existing user signin again rather than use the old one

* allow users to keep using the app without loging-in if env var is not present

* typo

* handle denied login

* do not use a form action for login as there is nothing post-ed

* use requiresUser instead of env var to define login modal or not

* move back to a form action for login so user can't be linked to /login directly

* show login modal even for pre-existing users

* fix logic of account creation/updates

* settings insertOne instead of updateOne

* fix missing userId to settings creation

* fix missing updatedAt when updating settings of pre-existing users

* show login modal for everyone + add comments

* fix login modal condition for both required/not required login

* 🔨

* bring back missing form values in login modal

* refactor default settings spread around to a constant

* missing default settings

* typo

* rename a bunch of things to remove SSO references

* always migrate conversations

* remove unneeded sha256 Node specific function, replace with browser crypto API

* fix typings

* Update src/lib/components/LoginModal.svelte

* use authCondition() in callback

* add logout

* 🐛 Fix signout

cc @Grsmto, because "path" of the cookie should be "/"

* fixup! 🐛 Fix signout

* add basic test setup with Vitest + tests of login DB updates

* add test for cookie

* try to run tests on CI

* try to fix docker compose not able to ignore .env file

* oopsy

* moved back .env before running tests

* add comment about docker compose .env workaround

* try to run mongo directly from github actions instead of docker-compose

* oopsy

* do we need to wait for mongo?

* move tested code back to relevant place + rename

* fix linting

* revert unnecessary change

---------

Co-authored-by: Eliott C. <[email protected]>
* add thumb up/down voting system for messages

* make like/dislike buttons toggle + bind to server

* refactor vote API to better endpoint structure

* set score to undefined rather than 0 when toggled

* throw if message is not found + refactor retry dispatch

* fix undefined class

* Only make the buttons invisible if there's no score

Co-authored-by: Eliott C. <[email protected]>

* only allow thumb up/down if user is the author of the messages

* always show thumbs up/down when voted

* use MongoDB instead of mutating messages array in code

* fix typings

* fix linting issue

* refactor code to throw before ifs

* add auth logic to vote API endpoint

* lint fix after merge conflict

* on mobile only show thumbs on top + increase spacing between messages

* fix thumbs always showing on mobile

---------

Co-authored-by: coyotte508 <[email protected]>
* 🐛 Fix settings modal not resetting its state

should not mutate passed prop

* make variable dynamic in case it's updated from outside

Co-authored-by: Eliott C. <[email protected]>

* Revert "make variable dynamic in case it's updated from outside"

This reverts commit ba1938e.

---------

Co-authored-by: Eliott C. <[email protected]>
* ✨ add conversations deletion to settings modal huggingface#233

* remove inert attribute from app only if last modal closed

* make the button an underlined text instead

* prepare for no-js

* ui

---------

Co-authored-by: Victor Mustar <[email protected]>
* fix retry not working after vote changes

* once assistant answer is received, invalidate the messages so we get the update id

* pass response message id from client to server

* remove url dependency
* fix stop btn

* use media query
…gface#259)

* Add incremental build + multi layer docker for size reduction

* Update .dockerignore

* fix cache miss

* pr comment .gitignore

---------

Co-authored-by: Eliott C <[email protected]>
nsarrazin and others added 30 commits June 19, 2023 09:24
* web search retries

* remove test error lol
…ce#319)

* Add support for HF endpoint for summary

* add fail-safe for summarization
* add optional timestamp field to messages

* Add a `hashConv` function that only uses a subset of the message for hashing
* Add ability to define custom model/dataset URLs

* lint

---------

Co-authored-by: Nathan Sarrazin <[email protected]>
* Update README.md

* Update README.md

Co-authored-by: Julien Chaumond <[email protected]>

* Align with header

* lint

* fixed markdown table of content

---------

Co-authored-by: Julien Chaumond <[email protected]>
Co-authored-by: Nathan Sarrazin <[email protected]>
* disable login on first message

* update banner here too

* modal wording tweaks

* prevent NaN

---------

Co-authored-by: Victor Mustar <[email protected]>
* disable login on first message

* update banner here too

* modal wording tweaks

* prevent NaN

* fix login wall

* fix flicker

* lint

* put modal text behind login check

* fix bug with sending messages without login

* fix misalignment between ui and api

* fix data update on disable login

---------

Co-authored-by: Nathan Sarrazin <[email protected]>
* Update README.md

* Update README.md

Co-authored-by: Julien Chaumond <[email protected]>

* Update README.md

---------

Co-authored-by: Julien Chaumond <[email protected]>
The userMessageToken, assistantMessageToken, messageEndToken, and
parameters.stop settings in `MODELS` do not have to be a token. They can
be any string.
* rm open assistant branding

* Update SettingsModal.svelte

* make settings  work with a dynamic list of models

* fixed types

---------

Co-authored-by: Nathan Sarrazin <[email protected]>
The chat generation removes parameters.stop and <|endoftext|>
from the generated text. And additionally trims trailing whitespace.

This PR copies that behavior to the summarize functionality, when the
summary is produced by a the chat model.
* allow different user and assistant end-token

For models like Llama2, the EndToken is not the same for a userMessage
and an assistantMessage. This implements `userMessageEndToken` and
`assistantMessageEndToken` which overwrites the messageEndToken
behavior.

This PR also allows empty strings as userMessageToken and
assistantMessageToken and makes this the default. This adds additional
flexibility, which is required in the case of Llama2 where the first
userMessage is effectively different because of the system message.

Note that because `userMessageEndToken` and `assistantMessageToken` are
nearly always concatenated, it is almost redundant to have both. The
exception is `generateQuery` for websearch which have several
consecutive user messages.

* Make model branding customizable based on env var (huggingface#345)

* rm open assistant branding

* Update SettingsModal.svelte

* make settings  work with a dynamic list of models

* fixed types

---------

Co-authored-by: Nathan Sarrazin <[email protected]>

* trim and remove stop-suffixes from summary (huggingface#369)

The chat generation removes parameters.stop and <|endoftext|>
from the generated text. And additionally trims trailing whitespace.

This PR copies that behavior to the summarize functionality, when the
summary is produced by a the chat model.

* add a login button when users are logged out (huggingface#381)

* add fallback to message end token if there's no specified tokens for user & assistant

---------

Co-authored-by: Florian Zimmermeister <[email protected]>
Co-authored-by: Nathan Sarrazin <[email protected]>
* Use modelUrl instead of building it from model name

* Preserve compatibility with optional modelUrl config

Use modelUrl if informed, else use the previous behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.