Merge branch 'main' into jan-339
This commit is contained in:
commit
bca9bc045f
54
adr/adr-001-jan-deployable-cloud-native.md
Normal file
54
adr/adr-001-jan-deployable-cloud-native.md
Normal file
@ -0,0 +1,54 @@
|
||||
# ADR #001: Jan deployable cloud-native
|
||||
|
||||
## Changelog
|
||||
|
||||
- 23.10.03: Initial unfinished draft
|
||||
- 23.10.16: Remove authentication
|
||||
|
||||
## Authors
|
||||
|
||||
- @nam-john-ho
|
||||
- @louis
|
||||
|
||||
## Context
|
||||
|
||||
### Status Quo
|
||||
|
||||
* User doesn't have a local GPU machine but wants to run Jan on a rented server
|
||||
* User wants a quick, fast way to experiment with Jan on a rented GPU
|
||||
* https://github.com/janhq/jan/issues/255
|
||||
|
||||
## Decision
|
||||
|
||||
* This ADR aims to outline design decisions for deploying Jan in cloud native environments such as: Runpod, AWS, Azure, GCP in a fast and simple way.
|
||||
* The current code-base should not change too much.
|
||||
* The current plugins must be reusable across enviroments (Desktop, Cloud-native).
|
||||
|
||||
|
||||
### Key Design Decisions
|
||||

|
||||
#### Why middleware
|
||||
* The /web codebase needs to operate in both browser and electron environments
|
||||
* The /web codebase needs to route plugin routes accordingly, either to /server or /electron
|
||||
* Middleware takes care of this
|
||||
* We will have a /server codebase that takes care of routing to plugins
|
||||
#### Unsuitable Alternatives
|
||||
* Not possible to just run electron headless
|
||||
* /web is on a different chromium window
|
||||
* Does not have all the electron handlers
|
||||
* Does not have the IPC handler
|
||||
|
||||
## Alternative Approaches
|
||||
Separated server process runs along side with electron. https://github.com/janhq/jan/pull/184/commits/6005409a945bb0e80a61132b9eb77f47f19d0aa6
|
||||
|
||||
## Considerations
|
||||
* Due to the limitation of accessing the file system in web browsers, the first version of the web app will load all the current plugins by default, and users will not be able to add, remove, or update plugins.
|
||||
* Simple authentication will be implemented as a plugin.
|
||||
|
||||
## References
|
||||
|
||||
- https://www.runpod.io/console/templates
|
||||
- https://repost.aws/articles/ARQ0Tz9eorSL6EAus7XPMG-Q/how-to-install-textgen-webui-on-aws
|
||||
- https://www.youtube.com/watch?v=_59AsSyMERQ
|
||||
- https://gpus.llm-utils.org/running-llama-2-on-runpod-with-oobaboogas-text-generation-webui/
|
||||
- https://medium.com/@jarimh1984/installing-oobabooga-and-oobabooga-api-to-runpod-cloud-step-by-step-tutorial-47457974dfa5
|
||||
@ -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
|
||||
|
||||
52
adr/adr-004-UI-Service.md
Normal file
52
adr/adr-004-UI-Service.md
Normal file
@ -0,0 +1,52 @@
|
||||
# ADR 004: UI Service
|
||||
|
||||
## Changelog
|
||||
|
||||
- 10 Oct 2023: initial vision @dan-jan @0xSage
|
||||
|
||||
## Status
|
||||
|
||||
Proposed
|
||||
|
||||
## Context
|
||||
|
||||
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
|
||||
|
||||

|
||||
|
||||
- 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
|
||||
|
||||
- Increased code complexity
|
||||
|
||||
## Reference
|
||||
|
||||
- VSCode
|
||||
- Obsidian
|
||||
@ -3,6 +3,9 @@
|
||||
## Changelog
|
||||
- {date}: {changelog}
|
||||
|
||||
## Authors
|
||||
- @usernames
|
||||
|
||||
## Status
|
||||
|
||||
What is the status, such as proposed, accepted, rejected, deprecated, superseded, etc.?
|
||||
@ -21,4 +24,6 @@ What is the change that we're proposing and/or doing?
|
||||
|
||||
What becomes easier or more difficult to do because of this change?
|
||||
|
||||
## Alternatives
|
||||
|
||||
## Reference
|
||||
@ -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
|
||||
|
||||
BIN
adr/images/adr-001-01.png
Normal file
BIN
adr/images/adr-001-01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 172 KiB |
BIN
adr/images/adr-001-02.png
Normal file
BIN
adr/images/adr-001-02.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 270 KiB |
BIN
adr/images/jan-ui-framework.png
Normal file
BIN
adr/images/jan-ui-framework.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 253 KiB |
Loading…
x
Reference in New Issue
Block a user