-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
server : revamp chat UI with vuejs and daisyui #10175
server : revamp chat UI with vuejs and daisyui #10175
Conversation
Yeah this looks much better, I could use it if it had a markdown parser. Honestly there is no situation where I would consider using the current server pages, so I would be completely fine with just removing them, but I guess some people may use it. |
Huh, very cool. My favorite feature would be to remember chat sessions (maybe in the browser local cache?). |
This is looking very good now! Something I noticed is that responses stop at 500 tokens, which seems to be due to the default llama.cpp/examples/server/public/completion.js Lines 1 to 6 in 6ea3315
There is also some issue with the font color when using the edit button: |
Yup thanks for testing it. I fixed both issues on my last commit. Should be pretty much ready now! (I'm updating the video demo + description of this PR too) |
I have 2 more feature requests (feel free to ignore):
|
Already added in the last commit :D
Hmm maybe for a future version (as I'm keeping the markdown renderer as a blackbox - this change needs to modify behavior of the renderer). You can still copy the whole message for now! |
This certainly looks much better than the old page, but it's really barebones and IMO not suitable for most use cases. It's also missing the sampler options and text completion mode seen in the old UI. With something like ChatGPT you can have a very simple web page since it's a fixed instruct model and all the options are preset. With GGUF models coming in all shapes and sizes you're kind of expected to properly set up the model in order to get a decent result. Personally I use Kobold or Ooba as my frontends and only use the server web UI when I'm working on the llama.cpp code directly and want to do some test chats. To be useful I think this UI would need to: |
I would say this is already useful as it is, certainty much more so than previous server UI, which you can still use for testing if you find it useful for that purpose. However, I would caution about turning this UI into a massive list of options that almost nobody is going to understand. The goal of the default page should be something that most users can use without being overwhelmed by a never ending list of options. I understand that this is not what people who like to tinker with every option will want, but that should not be the priority. |
This can probably be fixed later, but one very annoying issue is that it is impossible to scroll up while streaming a response because it automatically scrolls to the bottom every time a new token is received. Effectively this means that you have to wait until the entire response is received before starting to read it, which can be very disrupting. |
This PR should be pretty much ready now. Feel free to test & report errors if you find some. Other functionalities (as said earlier) will be left for the community to contribute. Fun story, during a recent flight with @huggingface folks, I did a demo on how the whole thing can be run without internet, from the attitude 10000m up in the air. |
@ngxson Is it on my end, or something's wrong with the input types? Testing on LibreWolf (FF fork). The same happens to all other numeric parameters. Previous UI didn't allow manual input of parameters, using sliders instead - maybe for good? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't checked the latest version, but the earlier ones were great, so adding my approval and will play with this soon.
On the way back, you should plot |
@ngxson I build the latest version with this commit.
I something needed to acces the new web UI ? Edit :
|
@easyfab I think your browser may cache the old page, or the source code is not up to date. The new UI never makes request to json-schema-to-grammar.mjs |
Starting the webserver with an API key now returns 401 : How do you set the API key if you can't see the UI first ? |
Hmm ok seems like I didn’t well tested the case with api key is set. Will
fix that later.
|
@ngxson I tested this on a fresh installation of browser and it still tries to request to json-schema-to-grammar.mjs without the path parameter. The code is up to date from the master branch. |
@qnixsynapse @ngxson I thought it was only a problem on my side. |
Thank you. Same experience. Wiping the build dir did not help. GGML_CCACHE=OFF didn't help. I assume something in .gitignore preserves something which shouldn't be. |
* server : simple chat UI with vuejs and daisyui * move old files to legacy folder * embed deps into binary * basic markdown support * add conversation history, save to localStorage * fix bg-base classes * save theme preferences * fix tests * regenerate, edit, copy buttons * small fixes * docs: how to use legacy ui * better error handling * make CORS preflight more explicit * add GET method for CORS * fix tests * clean up a bit * better auto scroll * small fixes * use collapse-arrow * fix closeAndSaveConfigDialog * small fix * remove console.log * fix style for <pre> element * lighter bubble color (less distract when reading)
* server : simple chat UI with vuejs and daisyui * move old files to legacy folder * embed deps into binary * basic markdown support * add conversation history, save to localStorage * fix bg-base classes * save theme preferences * fix tests * regenerate, edit, copy buttons * small fixes * docs: how to use legacy ui * better error handling * make CORS preflight more explicit * add GET method for CORS * fix tests * clean up a bit * better auto scroll * small fixes * use collapse-arrow * fix closeAndSaveConfigDialog * small fix * remove console.log * fix style for <pre> element * lighter bubble color (less distract when reading)
There should be something to do with the way assets files are being converted into |
Is it possible to add more system prompt slots that is selectable? There're many situation that would help. Now I need to copy and pasting system prompts on demand as it only has one slot. |
Motivation
Related to a discussion earlier about the web UI, we want to have a more functional chat UI for
llama-server
Screen.Recording.2024-11-05.at.21.42.31.mp4
Here is something that made quite quickly. So far, my implementation has these features:
/chat/completions
endpoint, stream token in real-timeAll of this is done with just around 500 lines of code (so to prove my point on "write less, do more"). It's small compared to the old
index.html
orpublic_simplechat
but yet very functional.To archive this, I use 3 dependencies:
tailwindcss
anddaisyui
: they have a lot of already-made components like chat bubble, themes, dialog, etc. So I don't need to rewrite them from zero.vuejs
: compared topreact
, the code is more readable. 2-way binding make it trivial in some places (i.e. state management)What about the old UI?
The old completion UI is now moved into
public_legacy
. To use it, you have to launch server with--path public_legacy
(a bit like how you usepublic_simplechat
)Missing things that can be added in the future
MarkdownIt
to add a hook whenever it renders apre
elementsubConvIds