c0sogi / LLMChat

A full-stack Webui implementation of Large Language model, such as ChatGPT or LLaMA.
MIT License
257 stars 45 forks source link

Modular architecture #37

Closed Torhamilton closed 1 year ago

Torhamilton commented 1 year ago

So far we have achieved a lot with this codebase. Perhaps its time, we pause new features and refactor code base to allow for core/plugin structure. Adopting modular architecture, will give this project incredible flexibility. I want us to be the "drupal" of this space, but we must structure it now before code base grow too big.

Lets standardize what a module is and push:

This allows developers to add, maintain modules without interfering with core. Project is useable as is. I will send you an email shortly. Your thoughts

c0sogi commented 1 year ago

Refactoring and modularizing the code seems like a good idea, but I'm wondering what I should do to specifically modularize it.

Currently, a lot of functionality is centered around ChatCommands, and simply adding a "/" allows us to do things regardless of the current core functionality. I assume by core functionality you mean the HandleMessage.ai function that gets the response from the LLM.

Torhamilton commented 1 year ago

I think we can solve this by implementing a useful feature we don't currently have. Lets add multi-language support as a module.

This will be the minimum requirements

All translatable UI names in core/other modules should be wrapped in t().

I think modules should have a few mandatory files

c0sogi commented 1 year ago

Multilingual translation seems difficult as it requires a lot of effort and constant updates, if you mean the flutter app. Iwill continue to consider modularization.

Torhamilton commented 1 year ago

Sure, we really don't need translation for now. Flutter is frontend and our module effort should focus on backend. Maybe we take the embed feature and modularized that, so admin can enabled or disable sitewide. The benefit is another developer can contribute to just embed without affecting core.

WordPress is successful because of plugins. However modularization is not a must now, it's just a better direction than adding more features.

Torhamilton commented 1 year ago

Please disregard my push for modularization, Continue on current path. When the time is ripe for modularization, it will happen naturally :)