Merge branch 'dev' into docs-pena-team

This commit is contained in:
Henry 2024-03-17 07:01:51 +09:00 committed by GitHub
commit cf69480caf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 3897 additions and 202 deletions

View File

@ -76,31 +76,31 @@ Jan is an open-source ChatGPT alternative that runs 100% offline on your compute
<tr style="text-align:center"> <tr style="text-align:center">
<td style="text-align:center"><b>Experimental (Nightly Build)</b></td> <td style="text-align:center"><b>Experimental (Nightly Build)</b></td>
<td style="text-align:center"> <td style="text-align:center">
<a href='https://delta.jan.ai/latest/jan-win-x64-0.4.8-323.exe'> <a href='https://delta.jan.ai/latest/jan-win-x64-0.4.8-324.exe'>
<img src='./docs/static/img/windows.png' style="height:14px; width: 14px" /> <img src='./docs/static/img/windows.png' style="height:14px; width: 14px" />
<b>jan.exe</b> <b>jan.exe</b>
</a> </a>
</td> </td>
<td style="text-align:center"> <td style="text-align:center">
<a href='https://delta.jan.ai/latest/jan-mac-x64-0.4.8-323.dmg'> <a href='https://delta.jan.ai/latest/jan-mac-x64-0.4.8-324.dmg'>
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" /> <img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
<b>Intel</b> <b>Intel</b>
</a> </a>
</td> </td>
<td style="text-align:center"> <td style="text-align:center">
<a href='https://delta.jan.ai/latest/jan-mac-arm64-0.4.8-323.dmg'> <a href='https://delta.jan.ai/latest/jan-mac-arm64-0.4.8-324.dmg'>
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" /> <img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
<b>M1/M2</b> <b>M1/M2</b>
</a> </a>
</td> </td>
<td style="text-align:center"> <td style="text-align:center">
<a href='https://delta.jan.ai/latest/jan-linux-amd64-0.4.8-323.deb'> <a href='https://delta.jan.ai/latest/jan-linux-amd64-0.4.8-324.deb'>
<img src='./docs/static/img/linux.png' style="height:14px; width: 14px" /> <img src='./docs/static/img/linux.png' style="height:14px; width: 14px" />
<b>jan.deb</b> <b>jan.deb</b>
</a> </a>
</td> </td>
<td style="text-align:center"> <td style="text-align:center">
<a href='https://delta.jan.ai/latest/jan-linux-x86_64-0.4.8-323.AppImage'> <a href='https://delta.jan.ai/latest/jan-linux-x86_64-0.4.8-324.AppImage'>
<img src='./docs/static/img/linux.png' style="height:14px; width: 14px" /> <img src='./docs/static/img/linux.png' style="height:14px; width: 14px" />
<b>jan.AppImage</b> <b>jan.AppImage</b>
</a> </a>

View File

@ -68,8 +68,8 @@ This guide provides you steps to troubleshoot and to resolve the issue where you
```sh ```sh
# You can delete the `/Jan` directory in Windows's AppData Directory by visiting the following path `%APPDATA%\Jan` # You can delete the `/Jan` directory in Windows's AppData Directory by visiting the following path `%APPDATA%\Jan`
cd C:\Users\%USERNAME%\AppData\Roaming cd C:\Users\YOUR_USERNAME\AppData\Roaming
rmdir /S jan rm -r ./Jan
``` ```
### 3. Additional Step for Versions Before 0.4.2 ### 3. Additional Step for Versions Before 0.4.2

View File

@ -1,36 +1,36 @@
// @ts-check // @ts-check
// Note: type annotations allow type checking and IDEs autocompletion // Note: type annotations allow type checking and IDEs autocompletion
require("dotenv").config(); require('dotenv').config()
const darkCodeTheme = require("prism-react-renderer/themes/dracula"); const darkCodeTheme = require('prism-react-renderer/themes/dracula')
const path = require('path'); const path = require('path')
/** @type {import('@docusaurus/types').Config} */ /** @type {import('@docusaurus/types').Config} */
const config = { const config = {
title: "Jan", title: 'Jan',
tagline: "Run your own AI", tagline: 'Run your own AI',
favicon: "img/favicon.ico", favicon: 'img/favicon.ico',
// Set the production url of your site here // Set the production url of your site here
url: "https://jan.ai", url: 'https://jan.ai',
// Set the /<baseUrl>/ pathname under which your site is served // Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/' // For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/", baseUrl: '/',
// GitHub pages deployment config. // GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these. // If you aren't using GitHub pages, you don't need these.
organizationName: "janhq", // Usually your GitHub org/user name. organizationName: 'janhq', // Usually your GitHub org/user name.
projectName: "jan", // Usually your repo name. projectName: 'jan', // Usually your repo name.
onBrokenLinks: "warn", onBrokenLinks: 'warn',
onBrokenMarkdownLinks: "warn", onBrokenMarkdownLinks: 'warn',
trailingSlash: true, trailingSlash: true,
// Even if you don't use internalization, you can use this field to set useful // Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want // metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans". // to replace "en" with "zh-Hans".
i18n: { i18n: {
defaultLocale: "en", defaultLocale: 'en',
locales: ["en"], locales: ['en'],
}, },
markdown: { markdown: {
@ -41,72 +41,81 @@ const config = {
// Plugins we added // Plugins we added
plugins: [ plugins: [
"docusaurus-plugin-sass", 'docusaurus-plugin-sass',
async function myPlugin(context, options) { async function myPlugin(context, options) {
return { return {
name: "docusaurus-tailwindcss", name: 'docusaurus-tailwindcss',
configurePostCss(postcssOptions) { configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer. // Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push(require("tailwindcss")); postcssOptions.plugins.push(require('tailwindcss'))
postcssOptions.plugins.push(require("autoprefixer")); postcssOptions.plugins.push(require('autoprefixer'))
return postcssOptions; return postcssOptions
}, },
}; }
}, },
[ [
"posthog-docusaurus", 'posthog-docusaurus',
{ {
apiKey: process.env.POSTHOG_PROJECT_API_KEY || "XXX", apiKey: process.env.POSTHOG_PROJECT_API_KEY || 'XXX',
appUrl: process.env.POSTHOG_APP_URL || "XXX", // optional appUrl: process.env.POSTHOG_APP_URL || 'XXX', // optional
enableInDevelopment: false, // optional enableInDevelopment: false, // optional
}, },
], ],
[ [
"@docusaurus/plugin-client-redirects", '@docusaurus/plugin-client-redirects',
{ {
redirects: [ redirects: [
{ {
from: "/troubleshooting/failed-to-fetch", from: '/troubleshooting/failed-to-fetch',
to: "/guides/error-codes/something-amiss/", to: '/guides/error-codes/something-amiss/',
}, },
{ {
from: "/guides/troubleshooting/gpu-not-used/", from: '/guides/troubleshooting/gpu-not-used/',
to: "/guides/common-error/not-using-gpu/", to: '/guides/common-error/not-using-gpu/',
}, },
{ {
from: "/guides/troubleshooting/", from: '/guides/troubleshooting/',
to: "/guides/error-codes/", to: '/guides/error-codes/',
}, },
{ {
from: "/troubleshooting/stuck-on-broken-build/", from: '/troubleshooting/stuck-on-broken-build/',
to: "/guides/common-error/broken-build/", to: '/guides/common-error/broken-build/',
}, },
{ {
from: "/guides/troubleshooting/", from: '/guides/troubleshooting/',
to: "/guides/error-codes/", to: '/guides/error-codes/',
}, },
{ {
from: "/troubleshooting/somethings-amiss/", from: '/troubleshooting/somethings-amiss/',
to: "/guides/error-codes/something-amiss/", to: '/guides/error-codes/something-amiss/',
}, },
{ {
from: "/troubleshooting/how-to-get-error-logs/", from: '/troubleshooting/how-to-get-error-logs/',
to: "/guides/error-codes/how-to-get-error-logs/", to: '/guides/error-codes/how-to-get-error-logs/',
}, },
{ {
from: "/troubleshooting/permission-denied/", from: '/troubleshooting/permission-denied/',
to: "/guides/error-codes/permission-denied/", to: '/guides/error-codes/permission-denied/',
}, },
{ {
from: "/troubleshooting/unexpected-token/", from: '/troubleshooting/unexpected-token/',
to: "/guides/error-codes/unexpected-token/", to: '/guides/error-codes/unexpected-token/',
}, },
{ {
from: "/troubleshooting/undefined-issue/", from: '/troubleshooting/undefined-issue/',
to: "/guides/error-codes/undefined-issue/", to: '/guides/error-codes/undefined-issue/',
}, { },
from: "/install/", {
to: "/guides/install/", from: '/install/',
to: '/guides/install/',
},
{
from: '/guides/using-models/',
to: '/guides/models-setup/',
},
{
from: '/guides/using-extensions/',
to: '/guides/extensions/',
}, },
], ],
}, },
@ -114,40 +123,52 @@ const config = {
//To input custom Plugin //To input custom Plugin
path.resolve(__dirname, 'plugins', 'changelog-plugin'), path.resolve(__dirname, 'plugins', 'changelog-plugin'),
[
'@scalar/docusaurus',
{
label: '',
route: '/api-reference',
configuration: {
spec: {
url: 'https://raw.githubusercontent.com/janhq/jan/dev/docs/openapi/jan.json',
},
},
},
],
], ],
// The classic preset will relay each option entry to the respective sub plugin/theme. // The classic preset will relay each option entry to the respective sub plugin/theme.
presets: [ presets: [
[ [
"@docusaurus/preset-classic", '@docusaurus/preset-classic',
{ {
// Will be passed to @docusaurus/plugin-content-docs (false to disable) // Will be passed to @docusaurus/plugin-content-docs (false to disable)
docs: { docs: {
routeBasePath: "/", routeBasePath: '/',
sidebarPath: require.resolve("./sidebars.js"), sidebarPath: require.resolve('./sidebars.js'),
editUrl: "https://github.com/janhq/jan/tree/dev/docs", editUrl: 'https://github.com/janhq/jan/tree/dev/docs',
showLastUpdateAuthor: true, showLastUpdateAuthor: true,
showLastUpdateTime: true, showLastUpdateTime: true,
}, },
// Will be passed to @docusaurus/plugin-content-sitemap (false to disable) // Will be passed to @docusaurus/plugin-content-sitemap (false to disable)
sitemap: { sitemap: {
changefreq: "daily", changefreq: 'daily',
priority: 1.0, priority: 1.0,
ignorePatterns: ["/tags/**"], ignorePatterns: ['/tags/**'],
filename: "sitemap.xml", filename: 'sitemap.xml',
}, },
// Will be passed to @docusaurus/plugin-content-blog (false to disable) // Will be passed to @docusaurus/plugin-content-blog (false to disable)
blog: { blog: {
blogSidebarTitle: "All Posts", blogSidebarTitle: 'All Posts',
blogSidebarCount: "ALL", blogSidebarCount: 'ALL',
}, },
// Will be passed to @docusaurus/theme-classic. // Will be passed to @docusaurus/theme-classic.
theme: { theme: {
customCss: require.resolve("./src/styles/main.scss"), customCss: require.resolve('./src/styles/main.scss'),
}, },
// GTM is always inactive in development and only active in production to avoid polluting the analytics statistics. // GTM is always inactive in development and only active in production to avoid polluting the analytics statistics.
googleTagManager: { googleTagManager: {
containerId: process.env.GTM_ID || "XXX", containerId: process.env.GTM_ID || 'XXX',
}, },
// Will be passed to @docusaurus/plugin-content-pages (false to disable) // Will be passed to @docusaurus/plugin-content-pages (false to disable)
// pages: {}, // pages: {},
@ -155,17 +176,17 @@ const config = {
], ],
// Redoc preset // Redoc preset
[ [
"redocusaurus", 'redocusaurus',
{ {
specs: [ specs: [
{ {
spec: "openapi/jan.yaml", // can be local file, url, or parsed json object spec: 'openapi/jan.yaml', // can be local file, url, or parsed json object
route: "/api-reference/", // path where to render docs route: '/api-reference-1.0/', // path where to render docs
}, },
], ],
theme: { theme: {
primaryColor: "#1a73e8", primaryColor: '#1a73e8',
primaryColorDark: "#1a73e8", primaryColorDark: '#1a73e8',
options: { options: {
requiredPropsFirst: true, requiredPropsFirst: true,
noAutoAuth: true, noAutoAuth: true,
@ -178,10 +199,10 @@ const config = {
// Docs: https://docusaurus.io/docs/api/themes/configuration // Docs: https://docusaurus.io/docs/api/themes/configuration
themeConfig: { themeConfig: {
image: "img/og-image.png", image: 'img/og-image.png',
// Only for react live // Only for react live
liveCodeBlock: { liveCodeBlock: {
playgroundPosition: "bottom", playgroundPosition: 'bottom',
}, },
docs: { docs: {
sidebar: { sidebar: {
@ -191,89 +212,89 @@ const config = {
}, },
// Algolia Search Configuration // Algolia Search Configuration
algolia: { algolia: {
appId: process.env.ALGOLIA_APP_ID || "XXX", appId: process.env.ALGOLIA_APP_ID || 'XXX',
apiKey: process.env.ALGOLIA_API_KEY || "XXX", apiKey: process.env.ALGOLIA_API_KEY || 'XXX',
indexName: "jan_docs", indexName: 'jan_docs',
contextualSearch: true, contextualSearch: true,
insights: true, insights: true,
}, },
// SEO Docusarus // SEO Docusarus
metadata: [ metadata: [
{ {
name: "description", name: 'description',
content: content:
"Jan runs 100% offline on your computer, utilizes open-source AI models, prioritizes privacy, and is highly customizable.", 'Jan runs 100% offline on your computer, utilizes open-source AI models, prioritizes privacy, and is highly customizable.',
}, },
{ {
name: "keywords", name: 'keywords',
content: content:
"Jan AI, Jan, ChatGPT alternative, local AI, private AI, conversational AI, no-subscription fee, large language model ", 'Jan AI, Jan, ChatGPT alternative, local AI, private AI, conversational AI, no-subscription fee, large language model ',
}, },
{ name: "robots", content: "index, follow" }, { name: 'robots', content: 'index, follow' },
{ {
property: "og:title", property: 'og:title',
content: "Jan | Open-source ChatGPT Alternative", content: 'Jan | Open-source ChatGPT Alternative',
}, },
{ {
property: "og:description", property: 'og:description',
content: content:
"Jan runs 100% offline on your computer, utilizes open-source AI models, prioritizes privacy, and is highly customizable.", 'Jan runs 100% offline on your computer, utilizes open-source AI models, prioritizes privacy, and is highly customizable.',
}, },
{ {
property: "og:image", property: 'og:image',
content: "https://jan.ai/img/og-image.png", content: 'https://jan.ai/img/og-image.png',
}, },
{ property: "og:type", content: "website" }, { property: 'og:type', content: 'website' },
{ property: "twitter:card", content: "summary_large_image" }, { property: 'twitter:card', content: 'summary_large_image' },
{ property: "twitter:site", content: "@janframework" }, { property: 'twitter:site', content: '@janframework' },
{ {
property: "twitter:title", property: 'twitter:title',
content: "Jan | Open-source ChatGPT Alternative", content: 'Jan | Open-source ChatGPT Alternative',
}, },
{ {
property: "twitter:description", property: 'twitter:description',
content: content:
"Jan runs 100% offline on your computer, utilizes open-source AI models, prioritizes privacy, and is highly customizable.", 'Jan runs 100% offline on your computer, utilizes open-source AI models, prioritizes privacy, and is highly customizable.',
}, },
{ {
property: "twitter:image", property: 'twitter:image',
content: "https://jan.ai/img/og-image.png", content: 'https://jan.ai/img/og-image.png',
}, },
], ],
headTags: [ headTags: [
// Declare a <link> preconnect tag // Declare a <link> preconnect tag
{ {
tagName: "link", tagName: 'link',
attributes: { attributes: {
rel: "preconnect", rel: 'preconnect',
href: "https://jan.ai/", href: 'https://jan.ai/',
}, },
}, },
// Declare some json-ld structured data // Declare some json-ld structured data
{ {
tagName: "script", tagName: 'script',
attributes: { attributes: {
type: "application/ld+json", type: 'application/ld+json',
}, },
innerHTML: JSON.stringify({ innerHTML: JSON.stringify({
"@context": "https://schema.org/", '@context': 'https://schema.org/',
"@type": "localAI", '@type': 'localAI',
name: "Jan", 'name': 'Jan',
description: 'description':
"Jan runs 100% offline on your computer, utilizes open-source AI models, prioritizes privacy, and is highly customizable.", 'Jan runs 100% offline on your computer, utilizes open-source AI models, prioritizes privacy, and is highly customizable.',
keywords: 'keywords':
"Jan AI, Jan, ChatGPT alternative, local AI, private AI, conversational AI, no-subscription fee, large language model ", 'Jan AI, Jan, ChatGPT alternative, local AI, private AI, conversational AI, no-subscription fee, large language model ',
applicationCategory: "BusinessApplication", 'applicationCategory': 'BusinessApplication',
operatingSystem: "Multiple", 'operatingSystem': 'Multiple',
url: "https://jan.ai/", 'url': 'https://jan.ai/',
}), }),
}, },
], ],
navbar: { navbar: {
title: "Jan", title: 'Jan',
logo: { logo: {
alt: "Jan Logo", alt: 'Jan Logo',
src: "img/logo.svg", src: 'img/logo.svg',
}, },
items: [ items: [
// Navbar Left // Navbar Left
@ -284,38 +305,38 @@ const config = {
// label: "About", // label: "About",
// }, // },
{ {
type: "dropdown", type: 'dropdown',
label: "About", label: 'About',
position: "left", position: 'left',
items: [ items: [
{ {
type: "doc", type: 'doc',
label: "What is Jan?", label: 'What is Jan?',
docId: "about/about", docId: 'about/about',
}, },
{ {
type: "doc", type: 'doc',
label: "Who we are", label: 'Who we are',
docId: "team/team", docId: 'team/team',
}, },
{ {
type: "doc", type: 'doc',
label: "Wall of love", label: 'Wall of love',
docId: "wall-of-love", docId: 'wall-of-love',
}, },
], ],
}, },
{ {
type: "docSidebar", type: 'docSidebar',
sidebarId: "productSidebar", sidebarId: 'productSidebar',
positionL: "left", positionL: 'left',
label: "Product", label: 'Product',
}, },
{ {
type: "docSidebar", type: 'docSidebar',
sidebarId: "ecosystemSidebar", sidebarId: 'ecosystemSidebar',
position: "left", position: 'left',
label: "Ecosystem", label: 'Ecosystem',
}, },
// { // {
// type: "docSidebar", // type: "docSidebar",
@ -325,29 +346,29 @@ const config = {
// }, // },
// Navbar right // Navbar right
{ {
type: "dropdown", type: 'dropdown',
label: "Docs", label: 'Docs',
to: "docs", to: 'docs',
position: "right", position: 'right',
items: [ items: [
{ {
type: "docSidebar", type: 'docSidebar',
sidebarId: "guidesSidebar", sidebarId: 'guidesSidebar',
label: "Guides", label: 'Guides',
}, },
{ {
type: "docSidebar", type: 'docSidebar',
sidebarId: "developerSidebar", sidebarId: 'developerSidebar',
label: "Developer", label: 'Developer',
}, },
{ {
to: "/api-reference", to: '/api-reference',
label: "API Reference", label: 'API Reference',
}, },
{ {
type: "docSidebar", type: 'docSidebar',
sidebarId: "releasesSidebar", sidebarId: 'releasesSidebar',
label: "Changelog", label: 'Changelog',
}, },
// { // {
// type: "docSidebar", // type: "docSidebar",
@ -357,9 +378,9 @@ const config = {
], ],
}, },
{ {
to: "blog", to: 'blog',
label: "Blog", label: 'Blog',
position: "right", position: 'right',
}, },
], ],
}, },
@ -367,22 +388,22 @@ const config = {
theme: darkCodeTheme, theme: darkCodeTheme,
darkTheme: darkCodeTheme, darkTheme: darkCodeTheme,
additionalLanguages: [ additionalLanguages: [
"python", 'python',
"powershell", 'powershell',
"bash", 'bash',
"json", 'json',
"javascript", 'javascript',
"jsx", 'jsx',
], ],
}, },
colorMode: { colorMode: {
defaultMode: "light", defaultMode: 'light',
disableSwitch: false, disableSwitch: false,
respectPrefersColorScheme: false, respectPrefersColorScheme: false,
}, },
}, },
themes: ["@docusaurus/theme-live-codeblock", "@docusaurus/theme-mermaid"], themes: ['@docusaurus/theme-live-codeblock', '@docusaurus/theme-mermaid'],
}; }
module.exports = config; module.exports = config

2486
docs/openapi/jan.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -26,6 +26,7 @@
"@heroicons/react": "^2.0.18", "@heroicons/react": "^2.0.18",
"@mdx-js/react": "^3.0.0", "@mdx-js/react": "^3.0.0",
"@redocly/cli": "^1.4.1", "@redocly/cli": "^1.4.1",
"@scalar/docusaurus": "^0.1.3",
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.16",
"axios": "^1.5.1", "axios": "^1.5.1",
"clsx": "^1.2.1", "clsx": "^1.2.1",

View File

@ -1,6 +1,5 @@
h1, h1,
.h1 { .h1 {
line-height: 48px;
font-size: 40px; font-size: 40px;
@apply font-bold text-black dark:text-white; @apply font-bold text-black dark:text-white;
} }
@ -8,35 +7,24 @@ h2,
.h2 { .h2 {
font-size: 32px; font-size: 32px;
@apply font-bold text-black dark:text-white; @apply font-bold text-black dark:text-white;
line-height: 40px;
} }
h3, h3,
.h3 { .h3 {
font-size: 28px; font-size: 28px;
@apply font-bold text-black dark:text-white; @apply font-bold text-black dark:text-white;
line-height: 40px;
} }
h4, h4,
.h4 { .h4 {
font-size: 24px; font-size: 24px;
@apply font-bold text-black dark:text-white; @apply font-bold text-black dark:text-white;
line-height: 32px;
} }
h5, h5,
.h5 { .h5 {
font-size: 20px; font-size: 20px;
@apply font-bold text-black dark:text-white; @apply font-bold text-black dark:text-white;
line-height: 28px;
} }
h6, h6,
.h6 { .h6 {
font-size: 16px; font-size: 16px;
@apply font-bold text-black dark:text-white; @apply font-bold text-black dark:text-white;
line-height: 24px;
}
p {
line-height: 24px;
}
.paragraph {
line-height: 24px;
} }

View File

@ -1,9 +1,10 @@
.theme-doc-markdown { .theme-doc-markdown,
.markdown {
a, a,
p, p,
span, span,
li { li {
@apply leading-loose; @apply leading-relaxed;
} }
a { a {
@apply text-blue-600 dark:text-blue-400; @apply text-blue-600 dark:text-blue-400;
@ -18,7 +19,6 @@
ol { ol {
padding-left: 28px; padding-left: 28px;
li { li {
@apply leading-loose;
p { p {
margin-bottom: 0; margin-bottom: 0;
} }
@ -34,14 +34,19 @@
} }
h1, h1,
h2 { h2,
@apply mb-3; h3 {
@apply mb-2;
} }
table { table {
width: 100%; width: 100%;
display: table; display: table;
} }
p {
margin-bottom: 16px;
}
} }
.task-list-item { .task-list-item {

File diff suppressed because it is too large Load Diff

View File

@ -321,7 +321,7 @@ export default class JanModelExtension extends ModelExtension {
.toLowerCase() .toLowerCase()
.includes(JanModelExtension._tensorRtEngineFormat) .includes(JanModelExtension._tensorRtEngineFormat)
) )
})?.length > 0 // TODO: NamH find better way (can use basename to check the file name with source url) })?.length > 0 // TODO: find better way (can use basename to check the file name with source url)
) )
}) })

View File

@ -50,27 +50,27 @@
"sources": [ "sources": [
{ {
"filename": "config.json", "filename": "config.json",
"url": "https://delta.jan.ai/dist/models/turing/windows/TinyJensen-1.1B-Chat-fp16/config.json" "url": "https://delta.jan.ai/dist/models/<gpuarch>/<os>/TinyJensen-1.1B-Chat-fp16/config.json"
}, },
{ {
"filename": "rank0.engine", "filename": "rank0.engine",
"url": "https://delta.jan.ai/dist/models/turing/windows/TinyJensen-1.1B-Chat-fp16/rank0.engine" "url": "https://delta.jan.ai/dist/models/<gpuarch>/<os>/TinyJensen-1.1B-Chat-fp16/rank0.engine"
}, },
{ {
"filename": "tokenizer.model", "filename": "tokenizer.model",
"url": "https://delta.jan.ai/dist/models/turing/windows/TinyJensen-1.1B-Chat-fp16/tokenizer.model" "url": "https://delta.jan.ai/dist/models/<gpuarch>/<os>/TinyJensen-1.1B-Chat-fp16/tokenizer.model"
}, },
{ {
"filename": "special_tokens_map.json", "filename": "special_tokens_map.json",
"url": "https://delta.jan.ai/dist/models/turing/windows/TinyJensen-1.1B-Chat-fp16/special_tokens_map.json" "url": "https://delta.jan.ai/dist/models/<gpuarch>/<os>/TinyJensen-1.1B-Chat-fp16/special_tokens_map.json"
}, },
{ {
"filename": "tokenizer.json", "filename": "tokenizer.json",
"url": "https://delta.jan.ai/dist/models/turing/windows/TinyJensen-1.1B-Chat-fp16/tokenizer.json" "url": "https://delta.jan.ai/dist/models/<gpuarch>/<os>/TinyJensen-1.1B-Chat-fp16/tokenizer.json"
}, },
{ {
"filename": "tokenizer_config.json", "filename": "tokenizer_config.json",
"url": "https://delta.jan.ai/dist/models/turing/windows/TinyJensen-1.1B-Chat-fp16/tokenizer_config.json" "url": "https://delta.jan.ai/dist/models/<gpuarch>/<os>/TinyJensen-1.1B-Chat-fp16/tokenizer_config.json"
} }
], ],
"id": "tinyjensen-1.1b-chat-fp16", "id": "tinyjensen-1.1b-chat-fp16",

View File

@ -1,7 +1,7 @@
{ {
"name": "@janhq/tensorrt-llm-extension", "name": "@janhq/tensorrt-llm-extension",
"version": "0.0.3", "version": "0.0.3",
"description": "Enables accelerated inference leveraging Nvidia's TensorRT-LLM for optimal GPU hardware optimizations. Compatible with models in TensorRT-LLM format. Requires Nvidia GPU driver and CUDA Toolkit installation.", "description": "This extension enables Nvidia's TensorRT-LLM for the fastest GPU acceleration. See the [setup guide](https://jan.ai/guides/providers/tensorrt-llm/) for next steps.",
"main": "dist/index.js", "main": "dist/index.js",
"node": "dist/node/index.cjs.js", "node": "dist/node/index.cjs.js",
"author": "Jan <service@jan.ai>", "author": "Jan <service@jan.ai>",
@ -12,8 +12,7 @@
}, },
"compatibility": { "compatibility": {
"platform": [ "platform": [
"win32", "win32"
"linux"
], ],
"app": [ "app": [
"0.1.0" "0.1.0"

View File

@ -246,7 +246,8 @@ const Advanced = () => {
setGpuEnabled(true) setGpuEnabled(true)
setShowNotification(false) setShowNotification(false)
snackbar({ snackbar({
description: 'Successfully turned on GPU Accelertion', description:
'Successfully turned on GPU Acceleration',
type: 'success', type: 'success',
}) })
setTimeout(() => { setTimeout(() => {
@ -257,7 +258,7 @@ const Advanced = () => {
setGpuEnabled(false) setGpuEnabled(false)
snackbar({ snackbar({
description: description:
'Successfully turned off GPU Accelertion', 'Successfully turned off GPU Acceleration',
type: 'success', type: 'success',
}) })
} }

View File

@ -8,6 +8,7 @@ import {
systemInformations, systemInformations,
} from '@janhq/core' } from '@janhq/core'
import { import {
Badge,
Button, Button,
Progress, Progress,
Tooltip, Tooltip,
@ -20,6 +21,8 @@ import {
import { InfoCircledIcon } from '@radix-ui/react-icons' import { InfoCircledIcon } from '@radix-ui/react-icons'
import { useAtomValue } from 'jotai' import { useAtomValue } from 'jotai'
import { Marked, Renderer } from 'marked'
import { extensionManager } from '@/extension' import { extensionManager } from '@/extension'
import Extension from '@/extension/Extension' import Extension from '@/extension/Extension'
import { installingExtensionAtom } from '@/helpers/atoms/Extension.atom' import { installingExtensionAtom } from '@/helpers/atoms/Extension.atom'
@ -108,6 +111,8 @@ const TensorRtExtensionItem: React.FC<Props> = ({ item }) => {
} }
} }
const description = marked.parse(item.description ?? '', { async: false })
console.log(description)
return ( return (
<div className="flex w-full items-start justify-between border-b border-border py-4 first:pt-4 last:border-none"> <div className="flex w-full items-start justify-between border-b border-border py-4 first:pt-4 last:border-none">
<div className="flex-1 flex-shrink-0 space-y-1.5"> <div className="flex-1 flex-shrink-0 space-y-1.5">
@ -118,10 +123,12 @@ const TensorRtExtensionItem: React.FC<Props> = ({ item }) => {
<p className="whitespace-pre-wrap text-sm font-semibold leading-relaxed"> <p className="whitespace-pre-wrap text-sm font-semibold leading-relaxed">
v{item.version} v{item.version}
</p> </p>
<Badge>Experimental</Badge>
</div> </div>
<p className="whitespace-pre-wrap leading-relaxed"> {
{item.description} // eslint-disable-next-line @typescript-eslint/naming-convention
</p> <div dangerouslySetInnerHTML={{ __html: description }} />
}
</div> </div>
{(!compatibility || compatibility['platform']?.includes(PLATFORM)) && {(!compatibility || compatibility['platform']?.includes(PLATFORM)) &&
@ -204,7 +211,6 @@ const InstallStateIndicator: React.FC<InstallStateProps> = ({
) )
} }
// TODO: NamH check for dark mode here
switch (installState) { switch (installState) {
case 'Installed': case 'Installed':
return ( return (
@ -223,4 +229,14 @@ const InstallStateIndicator: React.FC<InstallStateProps> = ({
} }
} }
const marked: Marked = new Marked({
renderer: {
link: (href, title, text) => {
return Renderer.prototype.link
?.apply(this, [href, title, text])
.replace('<a', "<a class='text-blue-500' target='_blank'")
},
},
})
export default TensorRtExtensionItem export default TensorRtExtensionItem