diff --git a/adr/adr-003-jan-plugins.md b/adr/adr-003-jan-plugins.md index 134aa59b0..827682975 100644 --- a/adr/adr-003-jan-plugins.md +++ b/adr/adr-003-jan-plugins.md @@ -25,5 +25,41 @@ Modular Architecture w/ Plugins: What becomes easier or more difficult to do because of this change? -## Reference -[Plugin APIs](./adr-003-jan-plugins.md) +## CoreService API + +Jan frontend components will communicate with plugin functions via Service Interfaces: + +All of the available APIs are listed in [CoreService](../web/shared/coreService.ts) + +- Data Service: + + - GET_CONVERSATIONS: retrieve all of the conversations + - CREATE_CONVERSATION: start a new conversation + - DELETE_CONVERSATION: delete an existing conversation + - GET_CONVERSATION_MESSAGES: retrieve a certain conversation messages + - CREATE_MESSAGE: store a new message (both sent & received) + - UPDATE_MESSAGE: update an existing message (streaming) + - STORE_MODEL: store new model information (when clicking download) + - UPDATE_FINISHED_DOWNLOAD: mark a model as downloaded + - GET_UNFINISHED_DOWNLOAD_MODELS: retrieve all unfinished downloading model (TBD) + - GET_FINISHED_DOWNLOAD_MODELS: retrieve all finished downloading model (TBD) + - DELETE_DOWNLOAD_MODEL: delete a model (TBD) + - GET_MODEL_BY_ID: retrieve model information by its ID + +- Inference Service: + + - INFERENCE_URL: retrieve inference endpoint served by plugin + - INIT_MODEL: runs a model + - STOP_MODEL: stop a running model + +- Model Management Service: (TBD) + + - GET_AVAILABLE_MODELS: retrieve available models (deprecate soon) + - GET_DOWNLOADED_MODELS: (deprecated) + - DELETE_MODEL: (deprecated) + - DOWNLOAD_MODEL: start to download a model + - SEARCH_MODELS: explore models with search query on HuggingFace (TBD) + +- Monitoring service: + - GET_RESOURCES_INFORMATION: retrieve total & used memory information + - GET_CURRENT_LOAD_INFORMATION: retrieve CPU load information diff --git a/adr/adr-005-UIService.md b/adr/adr-005-UIService.md index e47d6a6b9..47893b243 100644 --- a/adr/adr-005-UIService.md +++ b/adr/adr-005-UIService.md @@ -1,24 +1,52 @@ -# ADR {ADR-NUM}: {TITLE} +# ADR 005: UiService ## Changelog -- {date}: {changelog} + +- 10 Oct 2023: @dan-jan @0xSage ## Status -What is the status, such as proposed, accepted, rejected, deprecated, superseded, etc.? - -{Proposed|Accepted|Rejected} +Proposed ## Context -What is the issue that we're seeing that is motivating this decision or change? +Plugin devs need an API to change the Jan UI. Before we layer on more features, let's ensure good devex for feature building. ## Decision -What is the change that we're proposing and/or doing? +![Jan UI Framework](./images/jan-ui-framework.png) + +- Side-Ribbon: Jan Apps + + - This is a protected area, for Apps + - Apps can define Left Panel, Center, and Right Panel + - We will only have 1 App for now (no need to build this abstraction yet) + - Future: Server mode (see LMStudio), Art Studio (Stable Diffusion) + +- Side-Ribbon: Global Settings + + - These will all open in a modal + - Currently: Model Store, Running Models + - Currently: User Login, Settings + +- Main Window and Right Panel + + - These will mainly be session-based + +- Console: production logs + +## UiService API + +We need a UI API for Plugins + +- e.g. Model Store plugin -> Registers "Global Settings" Icon, defines what will show up in the Modal +- e.g. Model Runner plugin -> Inference Parameters ## Consequences -What becomes easier or more difficult to do because of this change? +- Increased code complexity -## Reference \ No newline at end of file +## Reference + +- VSCode +- Obsidian diff --git a/adr/docs/adr-003-plugins.md b/adr/docs/adr-003-plugins.md deleted file mode 100644 index c26a02a6e..000000000 --- a/adr/docs/adr-003-plugins.md +++ /dev/null @@ -1,37 +0,0 @@ -## JAN service & plugin APIs - -Jan frontend components will communicate with plugin functions via Service Interfaces: - - -All of the available APIs are listed in [CoreService](../../web/shared/coreService.ts) - -- Data Service: - - GET_CONVERSATIONS: retrieve all of the conversations - - CREATE_CONVERSATION: start a new conversation - - DELETE_CONVERSATION: delete an existing conversation - - GET_CONVERSATION_MESSAGES: retrieve a certain conversation messages - - CREATE_MESSAGE: store a new message (both sent & received) - - UPDATE_MESSAGE: update an existing message (streaming) - - STORE_MODEL: store new model information (when clicking download) - - UPDATE_FINISHED_DOWNLOAD: mark a model as downloaded - - GET_UNFINISHED_DOWNLOAD_MODELS: retrieve all unfinished downloading model (TBD) - - GET_FINISHED_DOWNLOAD_MODELS: retrieve all finished downloading model (TBD) - - DELETE_DOWNLOAD_MODEL: delete a model (TBD) - - GET_MODEL_BY_ID: retrieve model information by its ID - -- Inference Service: - - INFERENCE_URL: retrieve inference endpoint served by plugin - - INIT_MODEL: runs a model - - STOP_MODEL: stop a running model - -- Model Management Service: (TBD) - - GET_AVAILABLE_MODELS: retrieve available models (deprecate soon) - - GET_DOWNLOADED_MODELS: (deprecated) - - DELETE_MODEL: (deprecated) - - DOWNLOAD_MODEL: start to download a model - - SEARCH_MODELS: explore models with search query on HuggingFace (TBD) - -- Monitoring service: - - GET_RESOURCES_INFORMATION: retrieve total & used memory information - - GET_CURRENT_LOAD_INFORMATION: retrieve CPU load information - diff --git a/adr/images/jan-ui-framework.png b/adr/images/jan-ui-framework.png new file mode 100644 index 000000000..24beeefd5 Binary files /dev/null and b/adr/images/jan-ui-framework.png differ