From 879a4813731aae050bba3dfc9ca89d90c9774884 Mon Sep 17 00:00:00 2001 From: 0xSage Date: Fri, 24 Nov 2023 17:59:42 +0800 Subject: [PATCH 1/2] docs: cleanup --- docs/docs/api/assistant.md | 3 -- docs/docs/api/chat.md | 3 -- docs/docs/api/files.md | 3 -- docs/docs/api/message.md | 3 -- docs/docs/api/model.md | 3 -- docs/docs/api/overview.md | 4 -- docs/docs/api/thread.md | 3 -- docs/docs/docs/extensions.md | 10 ++++- docs/docs/specs/architecture.md | 41 ++++++++----------- .../{data-structures.md => file-based.md} | 25 ++++++++++- docs/docs/specs/models.md | 14 +++---- docs/sidebars.js | 26 ++---------- 12 files changed, 60 insertions(+), 78 deletions(-) delete mode 100644 docs/docs/api/assistant.md delete mode 100644 docs/docs/api/chat.md delete mode 100644 docs/docs/api/files.md delete mode 100644 docs/docs/api/message.md delete mode 100644 docs/docs/api/model.md delete mode 100644 docs/docs/api/overview.md delete mode 100644 docs/docs/api/thread.md rename docs/docs/specs/{data-structures.md => file-based.md} (70%) diff --git a/docs/docs/api/assistant.md b/docs/docs/api/assistant.md deleted file mode 100644 index e2bc5b53d..000000000 --- a/docs/docs/api/assistant.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -title: Thread ---- diff --git a/docs/docs/api/chat.md b/docs/docs/api/chat.md deleted file mode 100644 index 6bebd5d60..000000000 --- a/docs/docs/api/chat.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -title: Chat ---- diff --git a/docs/docs/api/files.md b/docs/docs/api/files.md deleted file mode 100644 index 2c6926523..000000000 --- a/docs/docs/api/files.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -title: File ---- diff --git a/docs/docs/api/message.md b/docs/docs/api/message.md deleted file mode 100644 index 34df8daf4..000000000 --- a/docs/docs/api/message.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -title: Message ---- diff --git a/docs/docs/api/model.md b/docs/docs/api/model.md deleted file mode 100644 index a2869f547..000000000 --- a/docs/docs/api/model.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -title: Model ---- diff --git a/docs/docs/api/overview.md b/docs/docs/api/overview.md deleted file mode 100644 index dd32bbe8f..000000000 --- a/docs/docs/api/overview.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Overview -position: 1 ---- diff --git a/docs/docs/api/thread.md b/docs/docs/api/thread.md deleted file mode 100644 index 6bebd5d60..000000000 --- a/docs/docs/api/thread.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -title: Chat ---- diff --git a/docs/docs/docs/extensions.md b/docs/docs/docs/extensions.md index c04f60a68..87edbf863 100644 --- a/docs/docs/docs/extensions.md +++ b/docs/docs/docs/extensions.md @@ -1,3 +1,9 @@ --- -title: Extending Jan ---- \ No newline at end of file +title: Extending Jan +--- + +## Overview + +- Jan exports a developer SDK which lets you customize assistants, Jan app, and more. +- Jan exports a AI-friendly UI kit which lets people customize the [Jan UI](/specs/user-interface). +- Jan provisions a local AI server which lets you built external applications on other platforms. diff --git a/docs/docs/specs/architecture.md b/docs/docs/specs/architecture.md index 15a1b196d..62bc05f36 100644 --- a/docs/docs/specs/architecture.md +++ b/docs/docs/specs/architecture.md @@ -8,10 +8,19 @@ This page is still under construction, and should be read as a scratchpad ::: -- Jan is built using modules -- Plugin architecture (on Pluggable-Electron) +## Overview -Jan is comprised of system-level modules that mirror OpenAI’s, exposing similar APIs and objects +- Jan built a modular infrastructure on top of Electron, in order to support extensions and AI functionality. +- Jan is largely built on top of its own modules. +- Jan uses a local [file-based approach](/specs/file-based) for data persistence. + +## Modules + +Modules are low level, system services. It is similar to OS kernel modules, in that modules provide abstractions to functionality like the filesystem, device system, databases, AI inference engines, etc. + +## Pluggable Modules + +Jan exports modules that mirror OpenAI’s, exposing similar APIs and objects: - Modules are modular, atomic implementations of a single OpenAI-compatible endpoint - Modules can be swapped out for alternate implementations @@ -26,24 +35,10 @@ Jan is comprised of system-level modules that mirror OpenAI’s, exposing simila | Threads | Conversations | [/thread](/api/thread) | | Messages | Messages | [/message](/api/message) | -## Concepts + -```mermaid -graph LR - A1[("A User Integrators")] -->|uses| B1[assistant] - B1 -->|persist conversational history| C1[("thread A")] - B1 -->|executes| D1[("built-in tools as module")] - B1 -.->|uses| E1[model] - E1 -.->|model.json| D1 - D1 --> F1[retrieval] - F1 -->|belongs to| G1[("web browsing")] - G1 --> H1[Google] - G1 --> H2[Duckduckgo] - F1 -->|belongs to| I1[("API calling")] - F1 --> J1[("knowledge files")] -``` -- User/ Integrator -- Assistant object -- Model object -- Thread object -- Built-in tool object +## Extensions + +Extensions are feature level services that include both UI and logic implementation. + + diff --git a/docs/docs/specs/data-structures.md b/docs/docs/specs/file-based.md similarity index 70% rename from docs/docs/specs/data-structures.md rename to docs/docs/specs/file-based.md index db854a8a6..3b38bb06b 100644 --- a/docs/docs/specs/data-structures.md +++ b/docs/docs/specs/file-based.md @@ -1,5 +1,5 @@ --- -title: Data Structures +title: File-based Approach --- :::warning @@ -41,3 +41,26 @@ janroot/ # Jan's root folder (e.g. ~/jan) /threads # Assistants remember conversations in the future /models # Users can upload custom models ``` + +## Data Dependencies + +```mermaid +graph LR + A1[("A User Integrators")] -->|uses| B1[assistant] + B1 -->|persist conversational history| C1[("thread A")] + B1 -->|executes| D1[("built-in tools as module")] + B1 -.->|uses| E1[model] + E1 -.->|model.json| D1 + D1 --> F1[retrieval] + F1 -->|belongs to| G1[("web browsing")] + G1 --> H1[Google] + G1 --> H2[Duckduckgo] + F1 -->|belongs to| I1[("API calling")] + F1 --> J1[("knowledge files")] +``` + +- User/ Integrator +- Assistant object +- Model object +- Thread object +- Built-in tool object diff --git a/docs/docs/specs/models.md b/docs/docs/specs/models.md index d396c10d1..f9ea26724 100644 --- a/docs/docs/specs/models.md +++ b/docs/docs/specs/models.md @@ -53,14 +53,14 @@ Here's a standard example `model.json` for a GGUF model. - `source_url`: https://huggingface.co/TheBloke/zephyr-7B-beta-GGUF/. ```js -"id": "zephyr-7b" // Defaults to foldername +"id": "zephyr-7b", // Defaults to foldername "object": "model", // Defaults to "model" "source_url": "https://huggingface.co/TheBloke/zephyr-7B-beta-GGUF/blob/main/zephyr-7b-beta.Q4_K_M.gguf", -"name": "Zephyr 7B" // Defaults to foldername -"owned_by": "you" // Defaults to you +"name": "Zephyr 7B", // Defaults to foldername +"owned_by": "you", // Defaults to "you" "version": "1", // Defaults to 1 -"created": 1231231 // Defaults to file creation time -"description": "" +"created": 1231231, // Defaults to file creation time +"description": null, // Defaults to null "state": enum[null, "downloading", "ready", "starting", "stopping", ...] "format": "ggufv3", // Defaults to "ggufv3" "settings": { // Models are initialized with settings @@ -68,7 +68,7 @@ Here's a standard example `model.json` for a GGUF model. "ngl": "100", "embedding": "true", "n_parallel": "4", -} +}, "parameters": { // Models are called parameters "temperature": "0.7", "token_limit": "2048", @@ -76,7 +76,7 @@ Here's a standard example `model.json` for a GGUF model. "top_p": "1", "stream": "true" }, -"metadata": {} // Defaults to {} +"metadata": {}, // Defaults to {} "assets": [ // Defaults to current dir "file://.../zephyr-7b-q4_k_m.bin", ] diff --git a/docs/sidebars.js b/docs/sidebars.js index dd3e58f0c..7b3ccf078 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -52,37 +52,17 @@ const sidebars = { "docs/modules", ], - apiSidebar: [ - "api/overview", - { - type: "category", - label: "Endpoints", - collapsible: true, - collapsed: false, - items: [ - { - type: "autogenerated", - dirName: "api", - }, - ], - }, - ], - specsSidebar: [ { type: "category", label: "Overview", collapsible: true, collapsed: false, - items: [ - "specs/architecture", - "specs/data-structures", - "specs/user-interface", - ], + items: ["specs/architecture", "specs/file-based", "specs/user-interface"], }, { type: "category", - label: "Product", + label: "Product Specs", collapsible: true, collapsed: false, items: [ @@ -95,7 +75,7 @@ const sidebars = { { type: "category", - label: "Engineering", + label: "Engineering Specs", collapsible: true, collapsed: false, items: [ From ccf4b499f8da28a3b8c80f8635a457481bf1b483 Mon Sep 17 00:00:00 2001 From: 0xSage Date: Fri, 24 Nov 2023 18:03:49 +0800 Subject: [PATCH 2/2] docs: nit --- docs/docs/specs/architecture.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/specs/architecture.md b/docs/docs/specs/architecture.md index 62bc05f36..0e3a1407c 100644 --- a/docs/docs/specs/architecture.md +++ b/docs/docs/specs/architecture.md @@ -16,7 +16,7 @@ This page is still under construction, and should be read as a scratchpad ## Modules -Modules are low level, system services. It is similar to OS kernel modules, in that modules provide abstractions to functionality like the filesystem, device system, databases, AI inference engines, etc. +Modules are low level, system services. It is similar to OS kernel modules, in that `modules` provide abstractions to device level, basic functionality like the filesystem, device system, databases, AI inference engines, etc. ## Pluggable Modules