Skip to content

server webui easy config selection #12031

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 18 commits into
base: master
Choose a base branch
from

Conversation

poulphunter
Copy link

Add to webui a quick access for custom configurations (including prompt).

Firefox_Screenshot_2025-02-22T19-19-44 044Z

As asked by @xydac in an old PR, the chat prompts from https://github.com/f/awesome-chatgpt-prompts has been loaded in the config json file.

@ngxson
Copy link
Collaborator

ngxson commented Feb 22, 2025

From UX perspective, this will be confused for most users who are not very technical, as they expect all settings to be accessible from UI, not from a file. And from UI perspective, this breaks the UI on mobile and also make it feels messy.

So I think we should keep this as a demo for now. If more users need this, we can rethink how to make a better UX/UI.

@ngxson ngxson added the demo Demonstrate some concept or idea, not intended to be merged label Feb 22, 2025
@poulphunter
Copy link
Author

From UX perspective, this will be confused for most users who are not very technical, as they expect all settings to be accessible from UI, not from a file. And from UI perspective, this breaks the UI on mobile and also make it feels messy.

So I think we should keep this as a demo for now. If more users need this, we can rethink how to make a better UX/UI.

Now, it's not activated when no json config file is given.
Example file is given but need to be renamed to be used.
From UX perspective, it's now on the settings button and we can manually set it or choose a preset, it's easier to understand.
UI is better on mobile but I haven't fixed legacy Settings dialog that is messy on small devices.

Is also added prompt suggestions.
I've fix the Conversation menu that always show first on mobile.

@poulphunter
Copy link
Author

From UX perspective, this will be confused for most users who are not very technical, as they expect all settings to be accessible from UI, not from a file. And from UI perspective, this breaks the UI on mobile and also make it feels messy.
So I think we should keep this as a demo for now. If more users need this, we can rethink how to make a better UX/UI.

Now, it's not activated when no json config file is given. Example file is given but need to be renamed to be used. From UX perspective, it's now on the settings button and we can manually set it or choose a preset, it's easier to understand. UI is better on mobile but I haven't fixed legacy Settings dialog that is messy on small devices.

Is also added prompt suggestions. I've fix the Conversation menu that always show first on mobile.

Firefox_Screenshot_2025-02-23T13-10-01 444Z
Firefox_Screenshot_2025-02-23T13-11-05 675Z

poulphunter and others added 2 commits February 26, 2025 13:32
… ideas

* add translations packages

* add translations packages

* begining of translation

* Check for reverse prompt by characters instead of tokens (ggml-org#292) (ggml-org#330)

* Check for reverse prompt by characters instead of tokens (ggml-org#292)

* Update main.cpp

Wording.

* Cleanup.

* Remove unnecessary use of std::stringstream.

---------

Co-authored-by: Johnman <tjohnman@github>
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>

* metal : fix `ggml_metal_log` vargs (ggml-org#4373)

* docs: utilize the forward slash (/) as the path separator for Unix-like systems (ggml-org#11770)

* close dropdown Menu function

* no export here

* automatic close sidebar when choice is made (mobile UX improvement)

* fix closeDropDownMenu

* Translation config in Header now

* Translation config in Header now

* French promt example

* continue translation

* continue translation

* change refreshing when language is selected
will use first config in json file if present and if in the correct language

* Add languages and translations

* fix loading when no prompt from language is found

* fix click on manual settings if already checked in dropdown

* rename Sidebar to ConversationList, better understanding, refactor code to have all that concerns this component in the same place

* rename Sidebar to ConversationList, better understanding, refactor code to have all that concerns this component in the same place

* rename Sidebar to ConversationList, better understanding, refactor code to have all that concerns this component in the same place

* UI improvements
UX is easier to understand

* json reformat

* UI buttons margins

* configs and language selection in appcontext, improve UI

* continue translation

* add favicon (no more console log errors)

* start changing Setting Dialog

* fix color in light/auto theme

* fix color in light/auto theme

* UX/UI improvements, no more drawer

* code refactor

* code refactor, continue translation, UX/UI improvements

* fix key

* format

* format

* loading / save presets

* translations

* build

* embed translations

* remove log

* code refactor, main functions in app.context

* build

* fix not needed, revert

* New README.md for Web UI app.

* prompts renamed to presets

* favicon

* remove unused parameter in json preset files

* add favicon (no more console logs)

* new build

* readme and screenshoots

---------

Co-authored-by: Votre Nom <Vous@exemple.com>
Co-authored-by: tjohnman <tjohnman@users.noreply.github.com>
Co-authored-by: Johnman <tjohnman@github>
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Co-authored-by: Finn Voorhees <finnvoorhees@gmail.com>
Co-authored-by: jason_w <jason.wang@126.com>
Co-authored-by: poulphunter <>
@poulphunter
Copy link
Author

Big changes in last commit, translations, presets, suggestions ideas, lot's of UX/UI improvements.
Cleaner code, refactor of parts that may not be in right component etc...
Separate readme for Web UI project.
@ngxson can you review it ?

mobile_settings
mobile_python_example_run
mobile_python_example_ask2
mobile_python_example_ask1
mobile_french_translation_example
mobile_conversation_tab
iPad_conversation_Italy
desktop_light_theme_presets_suggestions
desktop_dark_theme_presets_suggestions

import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';

import translationCN from './locales/cn/translation.json';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think i18n is something we should add right now. I did i18n in various web app product before and the maintenance cost is just too much.

For a small frontend project like this, i18n introduces too many works in the future.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Translation was something that was aked to me.
It's a little weird to ask translation in an app that cannot support the language you ask translation for...
This also make sens as system prompt can be in other languages and we can see "prompt master" user that don't understand well English.
It's heavy for user who begin to use something as embed model with llamafile to have a frontend that ask them for "temperature" with no language friendly explanation.

I have no vision of the future of llama cpp and parameters, if it changes a lots.
I've just in mind that only English can be maintained (with near 0 new cost) as it's the default translation used if language translation was not found.
For costs in mind, I'm not sure that Python interpreter was needed in "small frontend" (I don't consider a ~2.5Mo app as "small frontend" by the way).

Copy link
Collaborator

@ngxson ngxson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have time to review everything here. Your screenshots look good, but problems are:

  • There are too many changes grouped into single PR, I cannot review all of them. Please at least break them down into smaller PRs.
  • Most of the introduced functions like i18n or questionIdeas bring too much code into the project. Since we're currently aiming for simplicity, I don't think we should add these functions right away. If you have a look on the old webui, it actually has a lot more features compare to this, but with the cost of no one maintaining it.
  • The code is not very clean, i.e. still many places use getElementById to bypass using proper react ref or component. This will be a lot of headaches when come to managing states.

className="h-4 w-4"
>
<path
fillRule="evenodd"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've already moved to heroicons, so plain svg like this is not recommended

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that task can be asked here as code was already messy with sometimes icon sometimes svg.
I think refactoring icon can be a separate task (with low priority since it have a very small impact).

By the way, I don't think it's wise to use lot's of libraries (as heroicons) for now, as it adds dependencies (libraries) vs near zero cost because index is compressed. To maintain there are lot's of other tasks to do with higher priority.

@poulphunter
Copy link
Author

I don't have time to review everything here. Your screenshots look good, but problems are:

* There are too many changes grouped into single PR, I cannot review all of them. Please at least break them down into smaller PRs.

I've start doing it, but as you asked me to think about UX/UI, I've found lot's of code very messy (modal dialog in mobile was very hard, UX needs lot's of click to open/select/close something, some part of code where sometimes in an other component with no reason, "drawer" was very painful for UX).
It was hard to understand this code, so I've cleaned it in the same time of other functions development, a separate PR would have cost me too much time.
Also, it ask lot's of cost to separate things like "translations" and "presets" as it depends of each other to work well. I've done that in few days, separate PR would have cost few weeks...

* Most of the introduced functions like i18n or `questionIdeas` bring too much code into the project. Since we're currently aiming for simplicity, I don't think we should add these functions right away. If you have a look on the old webui, it actually has a lot more features compare to this, but with the cost of no one maintaining it.

I don't know the reason for other dev. to not maintain legacy projects (I've started to update legacy version before see that it has been replaced by a react app).
Old code was not LLM beginners friendly, it was very hard to understand to peoples I've given "packages" to begin playing with local LLM, but was easier to maintain (adapt) for me as the code was smaller.
I had thinked that if the project change from "small project" of ~250ko to a >2.5Mo react app (that don't fully work on my old browsers) for reasons like not to be a "small project" anymore but a fully usable project (not just a demo), larger community that can help improve it, etc...
I tried to make the application more accessible for non-computer scientists, I don't know if that's the direction of this project.
It have already more complex features like Python interpreter that is not necessary for lot's of peoples and hard to maintain.

* The code is not very clean, i.e. still many places use `getElementById` to bypass using proper react ref or component. This will be a lot of headaches when come to managing states.

I've done states management with the help of some coffee ! I think it can be refactored in a more understandable way.
It's explained in the documentation Readme I've added, an it make app really more intuitive.

I've start to use "getElementById" to bypass dropdown UX non-sense of DaisyUI, it's not React and is also lighter, I don't think I will change that as React isn't needed and is heavier for performances, for browsers.
But I may rewrite block visibility using "getElementById" to take full advantages of animations, theme etc...

I give you this improvements but I don't think I will maintain C++ app, so it's up to you to use it or not.
As mentioned above, if it's not in the spirit of the app, I can start a separate project.
I think I will add some other features such as cutting text into chunks for making summaries of large texts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
demo Demonstrate some concept or idea, not intended to be merged examples server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants