Merge branch 'docs/add-requirements' of https://github.com/janhq/jan into docs/add-requirements
This commit is contained in:
commit
8b7f90255d
@ -69,9 +69,9 @@ jobs:
|
||||
if: github.event_name == 'schedule'
|
||||
uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
|
||||
with:
|
||||
ref: refs/heads/main
|
||||
ref: refs/heads/dev
|
||||
build_reason: Nightly
|
||||
push_to_branch: main
|
||||
push_to_branch: dev
|
||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||
|
||||
noti-discord-manual-and-update-url-readme:
|
||||
@ -80,7 +80,7 @@ jobs:
|
||||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.public_provider == 'cloudflare-r2'
|
||||
uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
|
||||
with:
|
||||
ref: refs/heads/main
|
||||
ref: refs/heads/dev
|
||||
build_reason: Manual
|
||||
push_to_branch: main
|
||||
push_to_branch: dev
|
||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||
|
||||
@ -46,7 +46,7 @@ jobs:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
|
||||
with:
|
||||
ref: refs/heads/main
|
||||
ref: refs/heads/dev
|
||||
build_reason: Nightly
|
||||
push_to_branch: main
|
||||
push_to_branch: dev
|
||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||
|
||||
@ -58,7 +58,7 @@ jobs:
|
||||
mv /tmp/package.json electron/package.json
|
||||
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
||||
mv /tmp/package.json web/package.json
|
||||
jq '.build.publish = [{"provider": "s3", "bucket": "${{ secrets.CLOUDFLARE_R2_BUCKET_NAME }}", "region": "auto", "endpoint": "https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com", "path": "${{ inputs.cloudflare_r2_path }}", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
||||
jq '.build.publish = [{"provider": "generic", "url": "${{ secrets.CLOUDFLARE_R2_PUBLIC_URL }}", "channel": "latest"}, {"provider": "s3", "bucket": "${{ secrets.CLOUDFLARE_R2_BUCKET_NAME }}", "region": "auto", "endpoint": "https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com", "path": "${{ inputs.cloudflare_r2_path }}", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
||||
mv /tmp/package.json electron/package.json
|
||||
cat electron/package.json
|
||||
|
||||
|
||||
4
.github/workflows/template-build-macos.yml
vendored
4
.github/workflows/template-build-macos.yml
vendored
@ -1,4 +1,4 @@
|
||||
name: build-linux-x64
|
||||
name: build-macos
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
@ -70,7 +70,7 @@ jobs:
|
||||
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
||||
mv /tmp/package.json web/package.json
|
||||
|
||||
jq '.build.publish = [{"provider": "s3", "bucket": "${{ secrets.CLOUDFLARE_R2_BUCKET_NAME }}", "region": "auto", "endpoint": "https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com", "path": "${{ inputs.cloudflare_r2_path }}", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
||||
jq '.build.publish = [{"provider": "generic", "url": "${{ secrets.CLOUDFLARE_R2_PUBLIC_URL }}", "channel": "latest"}, {"provider": "s3", "bucket": "${{ secrets.CLOUDFLARE_R2_BUCKET_NAME }}", "region": "auto", "endpoint": "https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com", "path": "${{ inputs.cloudflare_r2_path }}", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
||||
mv /tmp/package.json electron/package.json
|
||||
cat electron/package.json
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ jobs:
|
||||
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
||||
mv /tmp/package.json web/package.json
|
||||
|
||||
jq '.build.publish = [{"provider": "s3", "bucket": "${{ secrets.CLOUDFLARE_R2_BUCKET_NAME }}", "region": "auto", "endpoint": "https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com", "path": "${{ inputs.cloudflare_r2_path }}", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
||||
jq '.build.publish = [{"provider": "generic", "url": "${{ secrets.CLOUDFLARE_R2_PUBLIC_URL }}", "channel": "latest"}, {"provider": "s3", "bucket": "${{ secrets.CLOUDFLARE_R2_BUCKET_NAME }}", "region": "auto", "endpoint": "https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com", "path": "${{ inputs.cloudflare_r2_path }}", "channel": "latest"}]' electron/package.json > /tmp/package.json
|
||||
mv /tmp/package.json electron/package.json
|
||||
|
||||
jq '.build.win.sign = "./sign.js"' electron/package.json > /tmp/package.json
|
||||
|
||||
10
README.md
10
README.md
@ -76,31 +76,31 @@ 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.4-158/jan-win-x64-0.4.4-158.exe'>
|
||||
<a href='https://delta.jan.ai/latest/jan-win-x64-0.4.4-166.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.4-158/jan-mac-x64-0.4.4-158.dmg'>
|
||||
<a href='https://delta.jan.ai/latest/jan-mac-x64-0.4.4-166.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.4-158/jan-mac-arm64-0.4.4-158.dmg'>
|
||||
<a href='https://delta.jan.ai/latest/jan-mac-arm64-0.4.4-166.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.4-158/jan-linux-amd64-0.4.4-158.deb'>
|
||||
<a href='https://delta.jan.ai/latest/jan-linux-amd64-0.4.4-166.deb'>
|
||||
<img src='./docs/static/img/linux.png' style="height:14px; width: 14px" />
|
||||
<b>jan.deb</b>
|
||||
</a>
|
||||
</td>
|
||||
<td style="text-align:center">
|
||||
<a href='https://delta.jan.ai/0.4.4-158/jan-linux-x86_64-0.4.4-158.AppImage'>
|
||||
<a href='https://delta.jan.ai/latest/jan-linux-x86_64-0.4.4-166.AppImage'>
|
||||
<img src='./docs/static/img/linux.png' style="height:14px; width: 14px" />
|
||||
<b>jan.AppImage</b>
|
||||
</a>
|
||||
|
||||
20
docs/docs/guides/08-troubleshooting/06-unexpected-token.mdx
Normal file
20
docs/docs/guides/08-troubleshooting/06-unexpected-token.mdx
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
title: Unexpected Token
|
||||
slug: /troubleshooting/unexpected-token
|
||||
description: Unexpected token is not a valid JSON
|
||||
keywords:
|
||||
[
|
||||
Jan AI,
|
||||
Jan,
|
||||
ChatGPT alternative,
|
||||
local AI,
|
||||
private AI,
|
||||
conversational AI,
|
||||
no-subscription fee,
|
||||
large language model,
|
||||
troubleshooting,
|
||||
unexpected token,
|
||||
]
|
||||
---
|
||||
|
||||
1. You may receive an error response `Error occurred: Unexpected token '<', "<!DOCTYPE"...is not valid JSON`, when you start a chat with OpenAI models. Using a VPN may help fix the issue.
|
||||
@ -14,7 +14,7 @@ license:
|
||||
name: AGPLv3
|
||||
url: https://github.com/janhq/nitro/blob/main/LICENSE
|
||||
servers:
|
||||
- url: http://localhost:1337/v1/
|
||||
- url: /v1
|
||||
tags:
|
||||
- name: Models
|
||||
description: List and describe the various models available in the API.
|
||||
|
||||
@ -72,7 +72,10 @@ export default class JanModelExtension extends ModelExtension {
|
||||
* @param network - Optional object to specify proxy/whether to ignore SSL certificates.
|
||||
* @returns A Promise that resolves when the model is downloaded.
|
||||
*/
|
||||
async downloadModel(model: Model, network?: { ignoreSSL?: boolean; proxy?: string }): Promise<void> {
|
||||
async downloadModel(
|
||||
model: Model,
|
||||
network?: { ignoreSSL?: boolean; proxy?: string }
|
||||
): Promise<void> {
|
||||
// create corresponding directory
|
||||
const modelDirPath = await joinPath([JanModelExtension._homeDir, model.id])
|
||||
if (!(await fs.existsSync(modelDirPath))) await fs.mkdirSync(modelDirPath)
|
||||
@ -294,6 +297,11 @@ export default class JanModelExtension extends ModelExtension {
|
||||
name: dirName,
|
||||
created: Date.now(),
|
||||
description: `${dirName} - user self import model`,
|
||||
metadata: {
|
||||
size: binaryFileSize,
|
||||
author: 'User',
|
||||
tags: [],
|
||||
},
|
||||
}
|
||||
|
||||
const modelFilePath = await joinPath([
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
"description": "User self import model",
|
||||
"settings": {
|
||||
"ctx_len": 4096,
|
||||
"ngl": 0,
|
||||
"embedding": false,
|
||||
"prompt_template": "{system_message}\n### Instruction: {prompt}\n### Response:"
|
||||
},
|
||||
|
||||
@ -116,7 +116,7 @@ export const startServer = async (configs?: ServerConfig) => {
|
||||
// Log server listening
|
||||
if (isVerbose)
|
||||
logServer(
|
||||
`Debug: JAN API listening at: http://${JAN_API_HOST}:${JAN_API_PORT}`
|
||||
`Debug: JAN API listening at: http://${hostSetting}:${portSetting}`
|
||||
);
|
||||
});
|
||||
} catch (e) {
|
||||
|
||||
@ -9,6 +9,7 @@ import { Button } from '@janhq/uikit'
|
||||
import { useAtomValue, useSetAtom } from 'jotai'
|
||||
import { RefreshCcw } from 'lucide-react'
|
||||
|
||||
import { useActiveModel } from '@/hooks/useActiveModel'
|
||||
import useSendChatMessage from '@/hooks/useSendChatMessage'
|
||||
|
||||
import { extensionManager } from '@/extension'
|
||||
@ -16,6 +17,7 @@ import {
|
||||
deleteMessageAtom,
|
||||
getCurrentChatMessagesAtom,
|
||||
} from '@/helpers/atoms/ChatMessage.atom'
|
||||
import { totalRamAtom } from '@/helpers/atoms/SystemBar.atom'
|
||||
import { activeThreadAtom } from '@/helpers/atoms/Thread.atom'
|
||||
|
||||
const ErrorMessage = ({ message }: { message: ThreadMessage }) => {
|
||||
@ -23,6 +25,8 @@ const ErrorMessage = ({ message }: { message: ThreadMessage }) => {
|
||||
const thread = useAtomValue(activeThreadAtom)
|
||||
const deleteMessage = useSetAtom(deleteMessageAtom)
|
||||
const { resendChatMessage } = useSendChatMessage()
|
||||
const { activeModel } = useActiveModel()
|
||||
const totalRam = useAtomValue(totalRamAtom)
|
||||
|
||||
const regenerateMessage = async () => {
|
||||
const lastMessageIndex = messages.length - 1
|
||||
@ -66,24 +70,33 @@ const ErrorMessage = ({ message }: { message: ThreadMessage }) => {
|
||||
{message.status === MessageStatus.Error && (
|
||||
<div key={message.id} className="mt-10 flex flex-col items-center">
|
||||
<span className="mb-3 text-center text-sm font-medium text-gray-500">
|
||||
<p>Apologies, something's amiss!</p>
|
||||
Jan's in beta. Find troubleshooting guides{' '}
|
||||
<a
|
||||
href="https://jan.ai/guides/troubleshooting"
|
||||
target="_blank"
|
||||
className="text-blue-600 hover:underline dark:text-blue-300"
|
||||
>
|
||||
here
|
||||
</a>{' '}
|
||||
or reach out to us on{' '}
|
||||
<a
|
||||
href="https://discord.gg/AsJ8krTT3N"
|
||||
target="_blank"
|
||||
className="text-blue-600 hover:underline dark:text-blue-300"
|
||||
>
|
||||
Discord
|
||||
</a>{' '}
|
||||
for assistance.
|
||||
{Number(activeModel?.metadata.size) > totalRam ? (
|
||||
<>
|
||||
Oops! Model size exceeds available RAM. Consider selecting a
|
||||
smaller model or upgrading your RAM for smoother performance.
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<p>Apologies, something's amiss!</p>
|
||||
Jan's in beta. Find troubleshooting guides{' '}
|
||||
<a
|
||||
href="https://jan.ai/guides/troubleshooting"
|
||||
target="_blank"
|
||||
className="text-blue-600 hover:underline dark:text-blue-300"
|
||||
>
|
||||
here
|
||||
</a>{' '}
|
||||
or reach out to us on{' '}
|
||||
<a
|
||||
href="https://discord.gg/AsJ8krTT3N"
|
||||
target="_blank"
|
||||
className="text-blue-600 hover:underline dark:text-blue-300"
|
||||
>
|
||||
Discord
|
||||
</a>{' '}
|
||||
for assistance.
|
||||
</>
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@ -108,9 +108,7 @@ const LocalServerScreen = () => {
|
||||
window.core?.api?.stopServer()
|
||||
setServerEnabled(false)
|
||||
} else {
|
||||
if (!activeModel) {
|
||||
startModel(String(selectedModel?.id))
|
||||
}
|
||||
startModel(String(selectedModel?.id))
|
||||
window.core?.api?.startServer({
|
||||
host,
|
||||
port,
|
||||
@ -129,7 +127,7 @@ const LocalServerScreen = () => {
|
||||
</Button>
|
||||
{serverEnabled && (
|
||||
<Button block themes="secondaryBlue" asChild>
|
||||
<a href={`http://${host}:${port}`} target="_blank">
|
||||
<a href={`http://localhost:${port}`} target="_blank">
|
||||
API Reference <ExternalLinkIcon size={20} className="ml-2" />
|
||||
</a>
|
||||
</Button>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user