From 88ea34a7d3d9687b9de785bebb5eaa03969beddb Mon Sep 17 00:00:00 2001 From: Daniel <101145494+dan-jan@users.noreply.github.com> Date: Sun, 19 Nov 2023 01:52:27 +0800 Subject: [PATCH 1/3] Add Intro --- docs/docs/guide/extensions.md | 3 + docs/docs/intro/introduction.md | 103 +++++------------------------ docs/docs/specs/architecture.md | 19 +----- docs/docs/specs/data-structures.md | 68 ++++++++++++++++++- docs/docs/specs/jan.md | 16 ++++- docs/docs/specs/settings.md | 3 + docs/sidebars.js | 4 +- 7 files changed, 111 insertions(+), 105 deletions(-) create mode 100644 docs/docs/guide/extensions.md create mode 100644 docs/docs/specs/settings.md diff --git a/docs/docs/guide/extensions.md b/docs/docs/guide/extensions.md new file mode 100644 index 0000000000..c04f60a68f --- /dev/null +++ b/docs/docs/guide/extensions.md @@ -0,0 +1,3 @@ +--- +title: Extending Jan +--- \ No newline at end of file diff --git a/docs/docs/intro/introduction.md b/docs/docs/intro/introduction.md index 00d4906192..4e45670aa6 100644 --- a/docs/docs/intro/introduction.md +++ b/docs/docs/intro/introduction.md @@ -3,102 +3,33 @@ title: Introduction slug: /docs --- -Jan can be used to build a variety of AI use cases, at every level of the stack: +Jan is a ChatGPT-alternative that runs on your own computer. -- An OpenAI compatible API, with feature parity for `models`, `assistants`, `files` and more -- A standard data format on top of the user's local filesystem, allowing for transparency and composability -- Automatically package and distribute to Mac, Windows and Linux. Cloud coming soon -- An UI kit to customize user interactions with `assistants` and more -- A standalone inference engine for low level use cases +Jan uses [open-source AI models](/guide/models), stores data in [open file formats](/specs/data-structures) and is is highly customizable via [extensions](/guide/extensions). -## Resources +Jan ships with an [OpenAI-compatible API](/api) and a powerful [Assistant framework](/guide/assistants) to create custom AIs. - +## Why Jan? -- Create an AI assistant -- Run an OpenAI compatible API endpoint -- Build a VSCode plugin with a local model -- Build a Jan platform module +💻 **Own your AI**
+Jan runs 100% on your own machine, [predictably](https://www.reddit.com/r/LocalLLaMA/comments/17mghqr/comment/k7ksti6/?utm_source=share&utm_medium=web2x&context=3), privately and even offline. No one else can see your conversations, not even us. -## Key Concepts +🏗️ **Customizability**
+Jan ships with a powerful [extension framework](/guide/extensions), which allows developers to extend and customize Jan's functionality. In fact, most core modules of Jan are [built as extensions](/specs/architecture) and use the same extensions API. -### Modules +🗂️ **Open File Formats**
+Jan stores data in a [local folder of non-proprietary files](/specs/data-structures). You're never locked-in and can do what you want with your data with extensions, or even a different app. -Jan is comprised of system-level modules that mirror OpenAI’s, exposing similar APIs and objects +🌍 **Open Source**
+Both Jan and [Nitro](https://nitro.jan.ai), our lightweight inference engine, are open source via the [AGPLv3 license](https://github.com/janhq/jan/blob/main/LICENSE). -- Modules are modular, atomic implementations of a single OpenAI-compatible endpoint -- Modules can be swapped out for alternate implementations - - The default `messages` module persists messages in thread-specific `.json` - - `messages-postgresql` uses Postgres for production-grade cloud-native environments + -| Jan Module | Description | API Docs | -| ---------- | ------------- | ---------------------------- | -| Chat | Inference | [/chat](/api/chat) | -| Models | Models | [/model](/api/model) | -| Assistants | Apps | [/assistant](/api/assistant) | -| Threads | Conversations | [/thread](/api/thread) | -| Messages | Messages | [/message](/api/message) | + diff --git a/docs/docs/specs/architecture.md b/docs/docs/specs/architecture.md index 079d400332..0a1399a9fa 100644 --- a/docs/docs/specs/architecture.md +++ b/docs/docs/specs/architecture.md @@ -2,6 +2,9 @@ title: Architecture --- +- Jan is built using modules +- Plugin architecture (on Pluggable-Electron) + ## Concepts ```mermaid @@ -23,19 +26,3 @@ graph LR - Model object - Thread object - Built-in tool object - -## File system -```sh -janroot/ - assistants/ - assistant-a/ - assistant.json - src/ - index.ts - threads/ - thread-a/ - thread-b - models/ - model-a/ - model.json -``` \ No newline at end of file diff --git a/docs/docs/specs/data-structures.md b/docs/docs/specs/data-structures.md index 063f9a0b46..d3f8507f47 100644 --- a/docs/docs/specs/data-structures.md +++ b/docs/docs/specs/data-structures.md @@ -1,3 +1,69 @@ --- title: Data Structures ---- \ No newline at end of file +--- + + +```sh +janroot/ + assistants/ + assistant-a/ + assistant.json + src/ + index.ts + threads/ + thread-a/ + thread-b + models/ + model-a/ + model.json +``` + + + +Jan use the local filesystem for data persistence, similar to VSCode. This allows for composability and tinkerability. + +```sh= +/janroot # Jan's root folder (e.g. ~/jan) + /models # For raw AI models + /threads # For conversation history + /assistants # For AI assistants' configs, knowledge, etc. +``` + +```sh= +/models + /modelA + model.json # Default model settings + llama-7b-q4.gguf # Model binaries + llama-7b-q5.gguf # Include different quantizations +/threads + /jan-unixstamp-salt + model.json # Overrides assistant/model-level model settings + thread.json # thread metadata (e.g. subject) + messages.json # messages + content.json # What is this? + files/ # Future for RAG +/assistants + /jan + assistant.json # Assistant configs (see below) + + # For any custom code + package.json # Import npm modules + # e.g. Langchain, Llamaindex + /src # Supporting files (needs better name) + index.js # Entrypoint + process.js # For electron IPC processes (needs better name) + + # `/threads` at root level + # `/models` at root level + /shakespeare + assistant.json + model.json # Creator chooses model and settings + package.json + /src + index.js + process.js + + /threads # Assistants remember conversations in the future + /models # Users can upload custom models + /finetuned-model +``` diff --git a/docs/docs/specs/jan.md b/docs/docs/specs/jan.md index 77d63eddc0..3d5d9e17db 100644 --- a/docs/docs/specs/jan.md +++ b/docs/docs/specs/jan.md @@ -1,3 +1,17 @@ --- title: Jan ---- \ No newline at end of file +--- + +## Jan: a "global" assistant + +Jan ships with a default assistant "Jan" that lets users chat with any open source model out-of-the-box. + +This assistant is defined in `/jan`. It is a generic assistant to illustrate power of Jan. In the future, it will support additional features e.g. multi-assistant conversations + +- Your Assistant "Jan" lets you pick any model that is in the root /models folder +- Right panel: pick LLM model and set model parameters +- Jan’s threads will be at root level +- `model.json` will reflect model chosen for that session +- Be able to “add” other assistants in the future +- Jan’s files will be at thread level +- Jan is not a persistent memory assistant diff --git a/docs/docs/specs/settings.md b/docs/docs/specs/settings.md new file mode 100644 index 0000000000..715c3401b8 --- /dev/null +++ b/docs/docs/specs/settings.md @@ -0,0 +1,3 @@ +--- +title: .jan +--- \ No newline at end of file diff --git a/docs/sidebars.js b/docs/sidebars.js index 38b93e5ba9..a40b80f299 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -19,7 +19,7 @@ const sidebars = { label: "Introduction", link: { type: "doc", id: "intro/introduction" }, collapsible: true, - collapsed: false, + collapsed: true, items: ["intro/quickstart", "intro/how-jan-works"], }, { @@ -39,6 +39,7 @@ const sidebars = { { type: "category", label: "Extending Jan", + link: { type: "doc", id: "guide/extensions" }, collapsible: true, collapsed: true, items: [ @@ -71,6 +72,7 @@ const sidebars = { "specs/files", "specs/jan", "specs/fine-tuning", + "specs/settings", ], }, ], From 17258192e8c5ade54a41aa1ffb98e1ec7c43b885 Mon Sep 17 00:00:00 2001 From: Daniel <101145494+dan-jan@users.noreply.github.com> Date: Sun, 19 Nov 2023 02:30:48 +0800 Subject: [PATCH 2/3] Refactor structure --- docs/docs/{guide => docs}/assistants.md | 0 docs/docs/{guide => docs}/extensions.md | 0 docs/docs/{guide => docs}/models.md | 0 docs/docs/{guide => docs}/modules.md | 0 docs/docs/{guide => docs}/server.md | 0 docs/docs/{guide => docs}/themes.md | 0 docs/docs/{guide => docs}/tools.md | 0 docs/docs/intro/introduction.md | 13 ++++++------- docs/docs/specs/architecture.md | 15 +++++++++++++++ docs/docs/specs/jan.md | 2 +- docs/docs/specs/settings.md | 2 +- docs/sidebars.js | 11 +++-------- 12 files changed, 26 insertions(+), 17 deletions(-) rename docs/docs/{guide => docs}/assistants.md (100%) rename docs/docs/{guide => docs}/extensions.md (100%) rename docs/docs/{guide => docs}/models.md (100%) rename docs/docs/{guide => docs}/modules.md (100%) rename docs/docs/{guide => docs}/server.md (100%) rename docs/docs/{guide => docs}/themes.md (100%) rename docs/docs/{guide => docs}/tools.md (100%) diff --git a/docs/docs/guide/assistants.md b/docs/docs/docs/assistants.md similarity index 100% rename from docs/docs/guide/assistants.md rename to docs/docs/docs/assistants.md diff --git a/docs/docs/guide/extensions.md b/docs/docs/docs/extensions.md similarity index 100% rename from docs/docs/guide/extensions.md rename to docs/docs/docs/extensions.md diff --git a/docs/docs/guide/models.md b/docs/docs/docs/models.md similarity index 100% rename from docs/docs/guide/models.md rename to docs/docs/docs/models.md diff --git a/docs/docs/guide/modules.md b/docs/docs/docs/modules.md similarity index 100% rename from docs/docs/guide/modules.md rename to docs/docs/docs/modules.md diff --git a/docs/docs/guide/server.md b/docs/docs/docs/server.md similarity index 100% rename from docs/docs/guide/server.md rename to docs/docs/docs/server.md diff --git a/docs/docs/guide/themes.md b/docs/docs/docs/themes.md similarity index 100% rename from docs/docs/guide/themes.md rename to docs/docs/docs/themes.md diff --git a/docs/docs/guide/tools.md b/docs/docs/docs/tools.md similarity index 100% rename from docs/docs/guide/tools.md rename to docs/docs/docs/tools.md diff --git a/docs/docs/intro/introduction.md b/docs/docs/intro/introduction.md index 4e45670aa6..6c320af4d6 100644 --- a/docs/docs/intro/introduction.md +++ b/docs/docs/intro/introduction.md @@ -1,6 +1,6 @@ --- title: Introduction -slug: /docs +slug: /intro --- Jan is a ChatGPT-alternative that runs on your own computer. @@ -11,23 +11,22 @@ Jan ships with an [OpenAI-compatible API](/api) and a powerful [Assistant framew ## Why Jan? -💻 **Own your AI**
+#### 💻 Own your AI Jan runs 100% on your own machine, [predictably](https://www.reddit.com/r/LocalLLaMA/comments/17mghqr/comment/k7ksti6/?utm_source=share&utm_medium=web2x&context=3), privately and even offline. No one else can see your conversations, not even us. -🏗️ **Customizability**
+#### 🏗️ Extensions Jan ships with a powerful [extension framework](/guide/extensions), which allows developers to extend and customize Jan's functionality. In fact, most core modules of Jan are [built as extensions](/specs/architecture) and use the same extensions API. -🗂️ **Open File Formats**
+#### 🗂️ Open File Formats Jan stores data in a [local folder of non-proprietary files](/specs/data-structures). You're never locked-in and can do what you want with your data with extensions, or even a different app. -🌍 **Open Source**
-Both Jan and [Nitro](https://nitro.jan.ai), our lightweight inference engine, are open source via the [AGPLv3 license](https://github.com/janhq/jan/blob/main/LICENSE). +#### 🌍 Open Source +Both Jan and [Nitro](https://nitro.jan.ai), our lightweight inference engine, are licensed via the open source [AGPLv3 license](https://github.com/janhq/jan/blob/main/LICENSE).