Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 0776047

Browse files
authored
Merge pull request #333 from janhq/add/update-docs
Feat: Update documentation
2 parents 1e41edf + d8d0b21 commit 0776047

File tree

8 files changed

+173
-2
lines changed

8 files changed

+173
-2
lines changed

docs/docs/examples/chatboxgpt.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: Nitro on browser
3+
description: Nitro intergration guide for using on Web browser.
4+
keywords: [Nitro, Google Chrome, browser, Jan, fast inference, inference server, local AI, large language model, OpenAI compatible, open source, llama]
5+
---
6+
7+
This guide demonstrates how to use Nitro on Web browser like an copilot on Web browser.
8+
9+
## Installation
10+
We'll use [chatGPTBox](https://github.com/josStorer/chatGPTBox) for this setup.
11+
12+
- For Chrome/Edge, download directly from the [Google Web Store](https://chromewebstore.google.com/detail/chatgptbox/eobbhoofkanlmddnplfhnmkfbnlhpbbo).
13+
- For other browsers, refer to their [installation guide](https://github.com/josStorer/chatGPTBox/wiki/Install).
14+
15+
## Using chatGPTBox with Nitro
16+
17+
**1. Start Nitro server**
18+
19+
Open your terminal and run:
20+
21+
```bash title="Run Nitro"
22+
nitro
23+
```
24+
25+
**2. Download Model**
26+
27+
Download the [Stealth 7B](https://huggingface.co/jan-hq/stealth-v1.3) model with these commands:
28+
29+
```bash title="Get a model"
30+
mkdir model && cd model
31+
wget -O stealth-7b.gguf https://huggingface.co/janhq/stealth-v1.3-GGUF/resolve/main/stealth-v1.3.Q4_K_M.gguf
32+
```
33+
34+
> Explore more GGUF models at [The Bloke](https://huggingface.co/TheBloke).
35+
36+
**3. Run the Model**
37+
38+
To load the model, use the following command:
39+
40+
```bash title="Load model to the server"
41+
curl http://localhost:3928/inferences/llamacpp/loadmodel \
42+
-H 'Content-Type: application/json' \
43+
-d '{
44+
"llama_model_path": "model/stealth-7b.gguf",
45+
"ctx_len": 512,
46+
"ngl": 100,
47+
}'
48+
```
49+
50+
**4. Configure chatGPTBox**
51+
52+
Click the `chatGPTBox` icon in your browser to open the main menu.
53+
54+
![Main menu chatGPTBox](img/chatgptbox_menu.png)
55+
56+
In the `API Mode` section, switch to `Custom Model`.
57+
58+
Change the name to `Stealth 7B` and set the host to `http://localhost:3928/v1/chat/completions`
59+
60+
![Use chatGPTBox](img/chatgptbox_cus.png)
61+
62+
Your browser is now equipped with a copilot to help you on daily basis.
63+
64+
![Web browser with chatGPTBox](img/chatgptbox_use.png)
65+
66+
For detailed guidance, visit the [chatGPTBox guide](https://github.com/josStorer/chatGPTBox/wiki/Guide)
67+
68+
### Shortcut
69+
70+
| Shortcut | Description |
71+
|----------|---------------------------------------------|
72+
| Ctrl+B | Activate chat dialog box on any page. |
73+
| Alt+B | Summarize any page via the right-click menu. |
74+
| Ctrl+Shift+H | Open an independent conversation page. |
75+
76+
## Futher Usage
77+
78+
For convenient usage, you can utilize [Jan](https://jan.ai/), as it is integrated with Nitro.
18.1 KB
Loading
60.5 KB
Loading
67.3 KB
Loading

docs/docs/examples/palchat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Use these commands to download and save the [Llama2 7B chat model](https://huggi
2727

2828
```bash title="Get a model"
2929
mkdir model && cd model
30-
wget -O llama-2-7b-model.gguf https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGUF/resolve/main/llama-2-7b-chat.Q5_K_M.gguf?download=true
30+
wget -O llama-2-7b-model.gguf https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGUF/resolve/main/llama-2-7b-chat.Q5_K_M.gguf
3131
```
3232

3333
> For more GGUF model, please look at [The Bloke](https://huggingface.co/TheBloke).

docs/docs/features/log.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Logging
3+
description: Enabling logging in Nitro.
4+
keywords: [Nitro, log, Jan, fast inference, inference server, local AI, large language model, OpenAI compatible, open source, llama]
5+
---
6+
7+
8+
## Enabling Logging
9+
10+
Nitro's logging feature can be activated by specifying a log folder. This is crucial for monitoring and troubleshooting.
11+
12+
## Setting Up Logging
13+
14+
To configure logging, you need to specify the path to the log folder. Use the following command to set it up:
15+
16+
```bash title="Config logging" {5}
17+
curl http://localhost:3928/inferences/llamacpp/loadmodel \
18+
-H 'Content-Type: application/json' \
19+
-d '{
20+
"llama_model_path": "/path/to/your_model.gguf",
21+
"llama_log_folder": "/path/to/log/folder/"
22+
}'
23+
```
24+
25+
> **Note:** Ensure the log folder exists before running this command. If the specified folder does not exist, logs will default to your current directory.

docs/docs/features/vision.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: Vision
3+
description: Inference engine for vision, the same as OpenAI's
4+
keywords: [Nitro, Jan, fast inference, inference server, local AI, large language model, OpenAI compatible, open source, llava, bakllava, vision]
5+
---
6+
7+
## Load model
8+
Just like loading the Chat model, for the vision model, you need two specific types:
9+
- the `GGUF model`
10+
- the `mmproj model`.
11+
12+
You can load the model using:
13+
14+
```bash title="Load Model" {3,4}
15+
curl -X POST 'http://127.0.0.1:3928/inferences/llamacpp/loadmodel' -H 'Content-Type: application/json' -d '{
16+
"llama_model_path": "/path/to/gguf/model/",
17+
"mmproj": "/path/to/mmproj/model/",
18+
"ctx_len": 2048,
19+
"ngl": 100,
20+
"cont_batching": false,
21+
"embedding": false,
22+
"system_prompt": "",
23+
"user_prompt": "\n### Instruction:\n",
24+
"ai_prompt": "\n### Response:\n"
25+
}'
26+
```
27+
28+
Download the models here:
29+
- [Llava Model](https://huggingface.co/jartine/llava-v1.5-7B-GGUF/tree/main): Large Language and Vision Assistant achieves SoTA on 11 benchmarks.
30+
- [Bakllava Model](https://huggingface.co/mys/ggml_bakllava-1/tree/main) is a Mistral 7B base augmented with the LLaVA architecture.
31+
32+
## Inference
33+
34+
Nitro currently only works with images converted to base64 format. Use this [base64 converter](https://www.base64-image.de/) to prepare your images.
35+
36+
To get the model's understanding of an image, do the following:
37+
38+
```bash title="Inference"
39+
curl http://127.0.0.1:3928/v1/chat/completions \
40+
-H "Content-Type: application/json" \
41+
-H "Authorization: Bearer $OPENAI_API_KEY" \
42+
-d '{
43+
"model": "gpt-4-vision-preview",
44+
"messages": [
45+
{
46+
"role": "user",
47+
"content": [
48+
{
49+
"type": "text",
50+
"text": "What’s in this image?"
51+
},
52+
{
53+
"type": "image_url",
54+
"image_url": {
55+
"url": "<base64>"
56+
}
57+
}
58+
]
59+
}
60+
],
61+
"max_tokens": 300
62+
}'
63+
```
64+
65+
If the base64 string is too long and causes errors, consider using [Postman](https://www.postman.com/) as an alternative.

docs/sidebars.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const sidebars = {
3939
items: [
4040
"features/chat",
4141
"features/embed",
42+
"features/vision"
4243
],
4344
},
4445
{
@@ -51,6 +52,7 @@ const sidebars = {
5152
"features/load-unload",
5253
"features/warmup",
5354
"features/prompt",
55+
"features/log"
5456
],
5557
},
5658
{
@@ -64,7 +66,8 @@ const sidebars = {
6466
"examples/palchat",
6567
"examples/openai-node",
6668
"examples/openai-python",
67-
"examples/colab"
69+
"examples/colab",
70+
"examples/chatboxgpt"
6871
],
6972
},
7073
// {

0 commit comments

Comments
 (0)