Skip to content

Commit

Permalink
Merge branch 'main' into docs/fix-error-link
Browse files Browse the repository at this point in the history
  • Loading branch information
0xHieu01 committed Jan 5, 2024
2 parents 9624a12 + 103b44d commit b95a5a3
Show file tree
Hide file tree
Showing 67 changed files with 844 additions and 493 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,25 @@ Jan is an open-source ChatGPT alternative that runs 100% offline on your compute
<tr style="text-align:center">
<td style="text-align:center"><b>Experimental (Nightly Build)</b></td>
<td style="text-align:center">
<a href='https://delta.jan.ai/0.4.3-118/jan-win-x64-0.4.3-118.exe'>
<a href='https://delta.jan.ai/0.4.3-123/jan-win-x64-0.4.3-123.exe'>
<img src='./docs/static/img/windows.png' style="height:14px; width: 14px" />
<b>jan.exe</b>
</a>
</td>
<td style="text-align:center">
<a href='https://delta.jan.ai/0.4.3-118/jan-mac-x64-0.4.3-118.dmg'>
<a href='https://delta.jan.ai/0.4.3-123/jan-mac-x64-0.4.3-123.dmg'>
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
<b>Intel</b>
</a>
</td>
<td style="text-align:center">
<a href='https://delta.jan.ai/0.4.3-118/jan-mac-arm64-0.4.3-118.dmg'>
<a href='https://delta.jan.ai/0.4.3-123/jan-mac-arm64-0.4.3-123.dmg'>
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
<b>M1/M2</b>
</a>
</td>
<td style="text-align:center">
<a href='https://delta.jan.ai/0.4.3-118/jan-linux-amd64-0.4.3-118.deb'>
<a href='https://delta.jan.ai/0.4.3-123/jan-linux-amd64-0.4.3-123.deb'>
<img src='./docs/static/img/linux.png' style="height:14px; width: 14px" />
<b>jan.deb</b>
</a>
Expand Down
60 changes: 60 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## Requirements for running Jan App in GPU mode on Windows and Linux
- You must have an NVIDIA driver that supports CUDA 11.4 or higher. Refer [here](https://docs.nvidia.com/deploy/cuda-compatibility/index.html#binary-compatibility__table-toolkit-driver).
To check if the NVIDIA driver is installed, open PowerShell or Terminal and enter the following command:
```bash
nvidia-smi
```
If you see a result similar to the following, you have successfully installed the NVIDIA driver:
```bash
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.57.02 Driver Version: 470.57.02 CUDA Version: 11.4 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... Off | 00000000:01:00.0 On | N/A |
| 0% 51C P8 10W / 170W | 364MiB / 7982MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
```

- You must have CUDA 11.4 or higher.
To check if CUDA is installed, open PowerShell or Terminal and enter the following command:
```bash
nvcc --version
```
If you see a result similar to the following, you have successfully installed CUDA:
```bash
nvcc: NVIDIA (R) Cuda compiler driver
Cuda compilation tools, release 11.4, V11.4.100
Build cuda_11.4.r11.4/compiler.30033411_0
```

- Specifically for Linux, you will need to have a CUDA compatible driver, refer [here](https://docs.nvidia.com/deploy/cuda-compatibility/index.html#binary-compatibility__table-toolkit-driver), and you must add the `.so` libraries of CUDA and the CUDA compatible driver to the `LD_LIBRARY_PATH` environment variable, refer [here](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions).

## How to switch mode CPU/GPU Jan app

By default, Jan app will run in CPU mode. When starting Jan app, the program will automatically check if your computer meets the requirements to run in GPU mode. If it does, we will automatically enable GPU mode and pick the GPU has highest VGRAM for you (feature allowing users to select one or more GPU devices for use - currently in planning). You can check whether you are using CPU mode or GPU mode in the settings/advance section of Jan app. (see image below). ![](/docs/static/img/usage/jan-gpu-enable-setting.png)

If you have GPU mode but it is not enabled by default, the following possibilities may exist, you can follow the next steps to fix the error:

1. You have not installed the NVIDIA driver, refer to the NVIDIA driver that supports CUDA 11.4 [here](https://docs.nvidia.com/deploy/cuda-compatibility/index.html#binary-compatibility__table-toolkit-driver).

2. You have not installed the CUDA toolkit or your CUDA toolkit is not compatible with the NVIDIA driver, refer to CUDA compatibility [here](https://docs.nvidia.com/deploy/cuda-compatibility/index.html#binary-compatibility__table-toolkit-driver).

3. You have not installed a CUDA compatible driver, refer [here](https://docs.nvidia.com/deploy/cuda-compatibility/index.html#binary-compatibility__table-toolkit-driver), and you must add the `.so` libraries of CUDA and the CUDA compatible driver to the `LD_LIBRARY_PATH` environment variable, refer [here](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions). For Windows, add the `.dll` libraries of CUDA and the CUDA compatible driver to the `PATH` environment variable. Usually, when installing CUDA on Windows, this environment variable is automatically added, but if you do not see it, you can add it manually by referring [here](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html#environment-setup).

## To check the current GPU-related settings that Jan app has detected, you can go to the Settings/Advanced section as shown in the image below.
![](/docs/static/img/usage/jan-open-home-directory.png)
![](/docs/static/img/usage/jan-open-settings-1.png)
![](/docs/static/img/usage/jan-open-settings-2.png)
![](/docs/static/img/usage/jan-open-settings-3.png)

When you have an issue with GPU mode, share the `settings.json` with us will help us to solve the problem faster.

## Tested on

- Windows 11 Pro 64-bit, NVIDIA GeForce RTX 4070ti GPU, CUDA 12.2, NVIDIA driver 531.18
- Ubuntu 22.04 LTS, NVIDIA GeForce RTX 4070ti GPU, CUDA 12.2, NVIDIA driver 545
3 changes: 2 additions & 1 deletion core/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ export enum FileSystemRoute {
writeFileSync = 'writeFileSync',
}
export enum FileManagerRoute {
synceFile = 'syncFile',
syncFile = 'syncFile',
getUserSpace = 'getUserSpace',
getResourcePath = 'getResourcePath',
fileStat = 'fileStat',
}

export type ApiFunction = (...args: any[]) => any
Expand Down
12 changes: 12 additions & 0 deletions core/src/core.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { FileStat } from './types'

/**
* Execute a extension module function in main process
*
Expand Down Expand Up @@ -74,6 +76,15 @@ const openExternalUrl: (url: string) => Promise<any> = (url) =>
*/
const getResourcePath: () => Promise<string> = () => global.core.api?.getResourcePath()

/**
* Gets the file's stats.
*
* @param path - The path to the file.
* @returns {Promise<FileStat>} - A promise that resolves with the file's stats.
*/
const fileStat: (path: string) => Promise<FileStat | undefined> = (path) =>
global.core.api?.fileStat(path)

/**
* Register extension point function type definition
*/
Expand All @@ -97,4 +108,5 @@ export {
joinPath,
openExternalUrl,
baseName,
fileStat,
}
12 changes: 12 additions & 0 deletions core/src/node/api/routes/fileManager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { FileManagerRoute } from '../../../api'
import { HttpServer } from '../../index'

export const fsRouter = async (app: HttpServer) => {
app.post(`/app/${FileManagerRoute.syncFile}`, async (request: any, reply: any) => {})

app.post(`/app/${FileManagerRoute.getUserSpace}`, async (request: any, reply: any) => {})

app.post(`/app/${FileManagerRoute.getResourcePath}`, async (request: any, reply: any) => {})

app.post(`/app/${FileManagerRoute.fileStat}`, async (request: any, reply: any) => {})
}
4 changes: 4 additions & 0 deletions core/src/types/file/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type FileStat = {
isDirectory: boolean
size: number
}
1 change: 1 addition & 0 deletions core/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from './thread'
export * from './message'
export * from './inference'
export * from './monitoring'
export * from './file'
4 changes: 2 additions & 2 deletions docs/docs/about/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Jan is a startup with an open source business model. We believe in the need for
We use Github to build in public, and welcome anyone to join in.

- [Jan's Kanban](https://github.com/orgs/janhq/projects/5)
- [Jan's Roadmap](https://github.com/orgs/janhq/projects/5/views/2)
- [Jan's Roadmap](https://github.com/orgs/janhq/projects/5/views/29)

### Bootstrapped

Expand All @@ -90,4 +90,4 @@ Drop us a message in our [Discord](https://discord.gg/af6SaTdzpx) and we'll get

Jan has a culture of ownership, independent thought, and lightning fast execution. If you'd like to join us, we have open positions on our [careers page](https://janai.bamboohr.com/careers).

## Footnotes
## Footnotes
28 changes: 12 additions & 16 deletions docs/docs/guides/00-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,32 @@ keywords:
]
---

Jan is a ChatGPT-alternative that runs on your own computer, with a [local API server](/api-reference).
Jan is a ChatGPT alternative that runs on your own computer, with a [local API server](/guides/using-server).

Jan uses [open-source AI models](/docs/engineering/models), stores data in [open file formats](/developer/file-based), is highly customizable via [extensions](/developer/build-extension).
We believe in the need for an open source AI ecosystem. We're focused on building infra, tooling and [custom models](https://huggingface.co/janhq) to allow open source AIs to compete on a level playing field with proprietary offerings.

Jan believes in the need for an open source AI ecosystem. We aim to build infra and tooling to allow open source AIs to compete on a level playing field with proprietary offerings.
## Features

- Compatible with [open-source models](/guides/using-models) (GGUF, TensorRT, and remote APIs)
- Compatible with most OSes: [Windows](/install/windows/), [Mac](/install/mac), [Linux](/install/linux), with/without GPU acceleration
- Stores data in [open file formats](/developer/file-based)
- Customizable via [extensions](/developer/build-extension)
- And more in the [roadmap](https://github.com/orgs/janhq/projects/5/views/16). Join us on [Discord](https://discord.gg/5rQ2zTv3be) and tell us what you want to see!

## Why Jan?

#### 💻 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.
Jan runs 100% on your own machine, predictably, privately and offline. No one else can see your conversations, not even us.

#### 🏗️ Extensions

Jan ships with a powerful [extension framework](/developer/build-extension), which allows developers to extend and customize Jan's functionality. In fact, most core modules of Jan are [built as extensions](/developer/architecture) and use the same extensions API.
Jan ships with a local-first, AI-native, and cross platform [extensions framework](/developer/build-extension). Developers can extend and customize everything from functionality to UI to branding. In fact, Jan's current main features are actually built as extensions on top of this framework.

#### 🗂️ Open File Formats

Jan stores data in a [local folder of non-proprietary files](/developer/architecture). You're never locked-in and can do what you want with your data with extensions, or even a different app.
Jan stores data in your [local filesystem](/developer/file-based). Your data never leaves your computer. You are free to delete, export, migrate your data, even to a different platform.

#### 🌍 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).

<!-- ## Design Principles -->

<!-- OpenAI meets VSCode meets Obsidian.
Minimalism: https://docusaurus.io/docs#design-principles. Not having abstractions is better than having the wrong abstractions. Assistants as code. Only including features that are absolutely necessary in the Jan API.
File-based: User should be able to look at a Jan directory and intuit how it works. Transparency. Editing things via a text editor, vs. needing a database tool for SQLite.
Participatory: https://www.getlago.com/blog/the-5-reasons-why-we-chose-open-source -->
55 changes: 55 additions & 0 deletions docs/docs/guides/02-installation/05-hardware.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: Hardware Requirements
description: Jan is a ChatGPT-alternative that runs on your own computer, with a local API server.
keywords:
[
Jan AI,
Jan,
ChatGPT alternative,
local AI,
private AI,
conversational AI,
no-subscription fee,
large language model,
]
---

Jan is designed to be lightweight and able to run Large Language Models (LLMs) out-of-the-box.

The current download size is less than 150 MB and has a disk space of ~300 MB.

To ensure optimal performance, please see the following system requirements:

## Disk Space

- Minimum requirement
- At least 5 GB of free disk space is required to accommodate the download, storage, and management of open-source LLM models.
- Recommended
- For an optimal experience and to run most available open-source LLM models on Jan, it is recommended to have 10 GB of free disk space.

## RAM and GPU VRAM

The amount of RAM on your system plays a crucial role in determining the size and complexity of LLM models you can effectively run. Jan can be utilized on traditional computers where RAM is a key resource. For enhanced performance, Jan also supports GPU acceleration, utilizing the VRAM of your graphics card.

## Best Models for your V/RAM

The RAM and GPU VRAM requirements are dependent on the size and complexity of the LLM models you intend to run. The following are some general guidelines to help you determine the amount of RAM or VRAM you need to run LLM models on Jan

- `8 GB of RAM`: Suitable for running smaller models like 3B models or quantized 7B models
- `16 GB of RAM (recommended)`: This is considered the "minimum usable models" threshold, particularly for 7B models (e.g Mistral 7B, etc)
- `Beyond 16GB of RAM`: Required for handling larger and more sophisticated model, such as 70B models.

## Architecture

Jan is designed to run on muptiple architectures, versatility and widespread usability. The supported architectures include:

### CPU Support

- `x86`: Jan is well-suited for systems with x86 architecture, which is commonly found in traditional desktops and laptops. It ensures smooth performance on a variety of devices using x86 processors.
- `ARM`: Jan is optimized to run efficiently on ARM-based systems, extending compatibility to a broad range of devices using ARM processors.

### GPU Support

- `NVIDIA`
- `AMD`
- `ARM64 Mac`
91 changes: 2 additions & 89 deletions docs/docs/guides/02-installation/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ import TabItem from "@theme/TabItem";
In this quickstart we'll show you how to:

- Download the Jan Desktop client - Mac, Windows, Linux, (and toaster) compatible
- Download and customize models
- Import custom models
- Use the local server at port `1337`
- Download the Nightly (unstable) version
- Build the application from source

## Setup

Expand All @@ -50,89 +49,3 @@ In this quickstart we'll show you how to:
- To build Jan Desktop from scratch (and have the right to tinker!)

See the [Build from Source](/install/from-source) guide.

### Working with Models

Jan provides a list of recommended models to get you started.
You can find them in the in-app Hub.

1. `cmd + k` and type "hub" to open the Hub.
2. Download your preferred models.
3. `cmd + k` and type "chat" to open the conversation UI and start chatting.
4. Your model may take a few seconds to start up.
5. You can customize the model settings, at each conversation thread level, on the right panel.
6. To change model defaults globally, edit the `model.json` file. See the [Models](/guides/models) guide.

### Importing Models

Jan is compatible with all GGUF models.

For more information on how to import custom models, not found in the Hub, see the [Models](/guides/models) guide.

## Working with the Local Server

> This feature is currently under development. So expect bugs!
Jan runs a local server on port `1337` by default.

The endpoints are OpenAI compatible.

See the [API server guide](/guides/server) for more information.

## Next Steps

---

TODO: Merge this in:

Getting up and running open-source AI models on your own computer with Jan is quick and easy. Jan is lightweight and can run on a variety of hardware and platform versions. Specific requirements tailored to your platform are outlined below.

## Cross platform

A free, open-source alternative to OpenAI that runs on the Linux, macOS, and Windows operating systems. Please refer to the specific guides below for your platform

- [Linux](/install/linux)
- [MacOS (Mac Intel Chip and Mac Apple Silicon Chip)](/install/mac)
- [Windows](/install/windows)

## Requirements for Jan

### Hardware

Jan is a lightweight platform designed for seamless download, storage, and execution of open-source Large Language Models (LLMs). With a small download size of less than 200 MB and a disk footprint of under 300 MB, Jan is optimized for efficiency and should run smoothly on modern hardware.

To ensure optimal performance while using Jan and handling LLM models, it is recommended to meet the following system requirements:

#### Disk space

- Minimum requirement
- At least 5 GB of free disk space is required to accommodate the download, storage, and management of open-source LLM models.
- Recommended
- For an optimal experience and to run most available open-source LLM models on Jan, it is recommended to have 10 GB of free disk space.

#### Random Access Memory (RAM) and Graphics Processing Unit Video Random Access Memory (GPU VRAM)

The amount of RAM on your system plays a crucial role in determining the size and complexity of LLM models you can effectively run. Jan can be utilized on traditional computers where RAM is a key resource. For enhanced performance, Jan also supports GPU acceleration, utilizing the VRAM of your graphics card.

#### Relationship between RAM and VRAM Sizes in Relation to LLM Models

The RAM and GPU VRAM requirements are dependent on the size and complexity of the LLM models you intend to run. The following are some general guidelines to help you determine the amount of RAM or VRAM you need to run LLM models on Jan

- 8 GB of RAM: Suitable for running smaller models like 3B models or quantized 7B models
- 16 GB of RAM(recommended): This is considered the "minimum usable models" threshold, particularly for 7B models (e.g Mistral 7B, etc)
- Beyond 16GB of RAM: Required for handling larger and more sophisticated model, such as 70B models.

### Architecture

Jan is designed to run on muptiple architectures, versatility and widespread usability. The supported architectures include:

#### CPU

- x86: Jan is well-suited for systems with x86 architecture, which is commonly found in traditional desktops and laptops. It ensures smooth performance on a variety of devices using x86 processors.
- ARM: Jan is optimized to run efficiently on ARM-based systems, extending compatibility to a broad range of devices using ARM processors.

#### GPU

- NVIDIA: Jan optimizes the computational capabilities of NVIDIA GPUs, achieving efficiency through the utilization of llama.cpp. This strategic integration enhances the performance of Jan, particularly in resource-intensive Language Model (LLM) tasks. Users can expect accelerated processing and improved responsiveness when leveraging the processing capabilities inherent in NVIDIA GPUs.
- AMD: Users with AMD GPUs can seamlessly integrate Jan's GPU acceleration, offering a comprehensive solution for diverse hardware configurations and preferences.
- ARM64 Mac: Jan seamlessly supports ARM64 architecture on Mac systems, leveraging Metal for efficient GPU operations. This ensures a smooth and efficient experience for users with Apple Silicon Chips, utilizing the power of Metal for optimal performance on ARM64 Mac devices.
Loading

0 comments on commit b95a5a3

Please sign in to comment.