Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update extensions and engines docs #4413

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from
Prev Previous commit
Next Next commit
Updated Engines pages
  • Loading branch information
imtuyethan committed Jan 7, 2025
commit a197dc290d6e67eb1468f63d61e1703d29b40e45
2 changes: 1 addition & 1 deletion docs/public/sitemap-0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<url><loc>https://jan.ai/docs/desktop/windows</loc><lastmod>2024-09-09T08:19:45.722Z</lastmod><changefreq>daily</changefreq><priority>1</priority></url>
<url><loc>https://jan.ai/docs/error-codes</loc><lastmod>2024-09-09T08:19:45.722Z</lastmod><changefreq>daily</changefreq><priority>1</priority></url>
<url><loc>https://jan.ai/docs/extensions</loc><lastmod>2024-09-09T08:19:45.722Z</lastmod><changefreq>daily</changefreq><priority>1</priority></url>
<url><loc>https://jan.ai/docs/installing-extension</loc><lastmod>2024-09-09T08:19:45.722Z</lastmod><changefreq>daily</changefreq><priority>1</priority></url>
<url><loc>https://jan.ai/docs/install-extensions</loc><lastmod>2024-09-09T08:19:45.722Z</lastmod><changefreq>daily</changefreq><priority>1</priority></url>
<url><loc>https://jan.ai/docs/models</loc><lastmod>2024-09-09T08:19:45.722Z</lastmod><changefreq>daily</changefreq><priority>1</priority></url>
<url><loc>https://jan.ai/docs/models/manage-models</loc><lastmod>2024-09-09T08:19:45.722Z</lastmod><changefreq>daily</changefreq><priority>1</priority></url>
<url><loc>https://jan.ai/docs/models/model-parameters</loc><lastmod>2024-09-09T08:19:45.722Z</lastmod><changefreq>daily</changefreq><priority>1</priority></url>
Expand Down
Binary file added docs/src/pages/docs/_assets/llama.cpp-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/model-management-04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/model-management-05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/model-management-06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/model-management-07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-09.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/settings-18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/src/pages/docs/_assets/trouble-shooting-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions docs/src/pages/docs/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@
"title": "ENGINES",
"type": "separator"
},
"built-in": "Local Engines",
"local-engines": "Local Engines",
"remote-models": "Remote Engines",
"install-engines": "Install Engines",
"extensions-separator": {
"title": "EXTENSIONS",
"type": "separator"
},
"extensions": "Overview",
"extensions-settings": "Extensions Settings",
"extensions-settings": "Extension Settings",
"configure-extensions": "Configure Extensions",
"installing-extension": "Install Extensions",
"install-extensions": "Install Extensions",
"troubleshooting-separator": {
"title": "TROUBLESHOOTING",
"type": "separator"
Expand Down
133 changes: 0 additions & 133 deletions docs/src/pages/docs/built-in/llama-cpp.mdx

This file was deleted.

166 changes: 166 additions & 0 deletions docs/src/pages/docs/install-engines.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
---
title: Install Engines
description: Learn about Jan's default extensions and explore how to configure them.
[
Jan,
Customizable Intelligence, LLM,
local AI,
privacy focus,
free and open source,
private and offline,
conversational AI,
no-subscription fee,
large language models,
Jan Extensions,
Extensions,
]
---

import { Callout } from 'nextra/components'
import { Settings, EllipsisVertical } from 'lucide-react'

# Install Engines

## Install Local Engines
Jan currently doesn't support installing a local engine yet.

## Install Remote Engines

### Step-by-step Guide
You can add any OpenAI API-compatible providers like OpenAI, Anthropic, or others.
To add a new remote engine:

1. Navigate to **Settings** (<Settings width={16} height={16} style={{display:"inline"}}/>) > **Engines**
1. At **Remote Engine** category, click **+ Install Engine**
2. Fill in the following required information:

| Field | Description | Required |
|-------|-------------|----------|
| Engine Name | Name for your engine (e.g., "OpenAI", "Claude") | ✓ |
| API URL | The base URL of the provider's API | ✓ |
| API Key | Your authentication key from the provider | ✓ |
| Model List URL | URL for fetching available models | |
| API Key Template | Custom authorization header format | |
| Request Format Conversion | Function to convert Jan's request format to provider's format | |
| Response Format Conversion | Function to convert provider's response format to Jan's format | |


> - The conversion functions are only needed for providers that don't follow the OpenAI API format. For OpenAI-compatible APIs, you can leave these empty.
> - For OpenAI-compatible APIs like OpenAI, Anthropic, or Groq, you only need to fill in the required fields. Leave optional fields empty.

4. Click **Install** to complete

### Examples
#### OpenAI-Compatible Setup
Here's how to set up OpenAI as a remote engine:

1. Engine Name: `OpenAI`
2. API URL: `https://api.openai.com`
3. Model List URL: `https://api.openai.com/v1/models`
4. API Key: Your OpenAI API key
5. Leave other fields as default


#### Custom APIs Setup
If you're integrating an API that doesn't follow OpenAI's format, you'll need to use the conversion functions.
Let's say you have a custom API with this format:

```javascript
// Custom API Request Format
{
"prompt": "What is AI?",
"max_length": 100,
"temperature": 0.7
}

// Custom API Response Format
{
"generated_text": "AI is...",
"tokens_used": 50,
"status": "success"
}
```

Here's how to set it up in Jan:
```
Engine Name: Custom LLM
API URL: https://api.customllm.com
API Key: your_api_key_here
```

**Conversion Functions:**
1. Request Format Conversion:
```javascript
function convertRequest(janRequest) {
return {
prompt: janRequest.messages[janRequest.messages.length - 1].content,
max_length: janRequest.max_tokens || 100,
temperature: janRequest.temperature || 0.7
}
}
```

2. Response Format Conversion:
```javascript
function convertResponse(apiResponse) {
return {
choices: [{
message: {
role: "assistant",
content: apiResponse.generated_text
}
}],
usage: {
total_tokens: apiResponse.tokens_used
}
}
}
```

<Callout type="info">
The conversion functions should:
- Request: Convert from Jan's OpenAI-style format to your API's format
- Response: Convert from your API's format back to OpenAI-style format
</Callout>

**Expected Formats:**

1. Jan's Request Format
```javascript
{
"messages": [
{"role": "user", "content": "What is AI?"}
],
"max_tokens": 100,
"temperature": 0.7
}
```

2. Jan's Expected Response Format
```javascript
{
"choices": [{
"message": {
"role": "assistant",
"content": "AI is..."
}
}],
"usage": {
"total_tokens": 50
}
}
```

<Callout type="warning">
Make sure to test your conversion functions thoroughly. Incorrect conversions may cause errors or unexpected behavior.
</Callout>










Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { Callout } from 'nextra/components'

Jan comes with several [pre-installed extensions](/docs/extensions#core-extensions) that provide core functionalities. You can manually add custom third-party extensions at your own risk.

## Creating Extensions
## Create Extensions

<Callout type="info">
Jan currently only accepts `.tgz` file format for extensions.
Expand All @@ -33,7 +33,7 @@ Jan currently only accepts `.tgz` file format for extensions.
> **Heads Up:**
> - Please use the following structure and setup as a **reference** only.
> - You're free to develop extensions using any approach or structure that works for your needs. As long as your extension can be packaged as a `.tgz` file, it can be installed in Jan. Feel free to experiment and innovate!
> - If you already have your own `.tgz` extension file, please move forward to [install extension](/docs/installing-extension#install-extensions) step.
> - If you already have your own `.tgz` extension file, please move forward to [install extension](/docs/install-extensions#install-extensions) step.

#### Extension Structure
Your extension should follow this basic structure:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"llama-cpp": {
"title": "llama.cpp",
"href": "/docs/built-in/llama-cpp"
"href": "/docs/local-engines/llama-cpp"
},
"tensorrt-llm": {
"title": "TensorRT-LLM",
"href": "/docs/built-in/tensorrt-llm"
"href": "/docs/local-engines/tensorrt-llm"
}
}
Loading
Loading