diff options
author | Liao Junxuan | 2024-01-16 17:58:52 +0800 |
---|---|---|
committer | Liao Junxuan | 2024-01-16 17:58:52 +0800 |
commit | 9fcfefedef15e600775d89815aeee207bc955ae1 (patch) | |
tree | 69e1dff7ed40e1010824869f2ab5aa0e13b46470 | |
parent | e1430a1d4ad9d2d4c5ac7de24a89f84f54a1fd94 (diff) | |
download | aur-9fcfefedef15e600775d89815aeee207bc955ae1.tar.gz |
add chatbot-ui-legacy-git
-rw-r--r-- | .SRCINFO | 24 | ||||
-rw-r--r-- | 0001-support-GPT-4-Turbo.patch | 23 | ||||
-rw-r--r-- | PKGBUILD | 27 | ||||
-rw-r--r-- | chatbot-ui-legacy.service | 44 | ||||
-rw-r--r-- | sysusers.conf | 2 |
5 files changed, 79 insertions, 41 deletions
@@ -1,7 +1,7 @@ -pkgbase = chatbot-ui-git - pkgdesc = An open source ChatGPT UI. - pkgver = r293.2e6c0ee - pkgrel = 5 +pkgbase = chatbot-ui-legacy-git + pkgdesc = An open source ChatGPT UI. (legacy version) + pkgver = r238.6bdbf1c + pkgrel = 1 url = https://github.com/mckaywrigley/chatbot-ui arch = x86_64 license = MIT @@ -9,16 +9,14 @@ pkgbase = chatbot-ui-git makedepends = npm depends = nodejs options = !emptydirs - backup = etc/webapps/chatbot-ui-git/.env.local - source = git+https://github.com/mckaywrigley/chatbot-ui.git + backup = etc/webapps/chatbot-ui-legacy-git/.env.local + source = git+https://github.com/mckaywrigley/chatbot-ui.git#branch=legacy source = sysusers.conf - source = chatbot-ui.service + source = chatbot-ui-legacy.service source = 0001-support-GPT-4-Turbo.patch - source = 0002-Fix-json-parsing.patch sha256sums = SKIP - sha256sums = 4de4e4d3bac91214398da078b3f2b5d72182b7e6a69c9124eb19713827942958 - sha256sums = 45dcb629ff221cd36d0f4c22cd5d886924233ada9b342bb0e59546fb35d1bea6 - sha256sums = 5824fc36a6a100151e6a27e8d1b0389a16517a4f2151e14e3f55ce5cd450ffec - sha256sums = bf4cccd454d1d77038d71627fb00ec49428e014bd90ed565512910b463aff952 + sha256sums = 58ecd3fccc798f90d906d9a9928ee1268e916f277dfd35e644ca0ce83fde5c30 + sha256sums = bad9ec7fd322307418ee821b070c45c3f7151cc4ca5ca7a50f29c7892f2e1ed4 + sha256sums = 6cb74c1c48ee5bbd63f1bec185d83572237e9a3375e33a073cc76c50c443e290 -pkgname = chatbot-ui-git +pkgname = chatbot-ui-legacy-git diff --git a/0001-support-GPT-4-Turbo.patch b/0001-support-GPT-4-Turbo.patch index 770071aeda4b..4507603f4940 100644 --- a/0001-support-GPT-4-Turbo.patch +++ b/0001-support-GPT-4-Turbo.patch @@ -1,30 +1,29 @@ -From 8921efb9d2ec6f4ff1706c0e468c1455b7e8a109 Mon Sep 17 00:00:00 2001 +From 615ba589f310f8985e9e56a2449b9952ec45e84a Mon Sep 17 00:00:00 2001 From: Liao Junxuan <mikeljx@126.com> -Date: Tue, 12 Dec 2023 20:50:42 +0800 +Date: Tue, 16 Jan 2024 17:22:53 +0800 Subject: [PATCH] support GPT-4-Turbo source: https://github.com/mckaywrigley/chatbot-ui/issues/1022#issuecomment-1814319276 --- - types/openai.ts | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) + types/openai.ts | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) diff --git a/types/openai.ts b/types/openai.ts -index d404350..4ba8810 100644 +index 8e423da..32f0ff5 100644 --- a/types/openai.ts +++ b/types/openai.ts -@@ -12,6 +12,9 @@ export enum OpenAIModelID { - GPT_3_5_AZ = 'gpt-35-turbo', +@@ -8,6 +8,8 @@ export interface OpenAIModel { + export enum OpenAIModelID { + GPT_3_5 = 'gpt-3.5-turbo', GPT_4 = 'gpt-4', - GPT_4_32K = 'gpt-4-32k', + GPT_4_32K_0613 = 'gpt-4-32k-0613', + GPT_4_128K = 'gpt-4-1106-preview' -+ } // in case the `DEFAULT_MODEL` environment variable is not set or set to an unsupported model -@@ -42,4 +45,16 @@ export const OpenAIModels: Record<OpenAIModelID, OpenAIModel> = { - maxLength: 96000, - tokenLimit: 32000, +@@ -26,4 +28,16 @@ export const OpenAIModels: Record<OpenAIModelID, OpenAIModel> = { + maxLength: 24000, + tokenLimit: 8000, }, + [OpenAIModelID.GPT_4_32K_0613]: { + id: OpenAIModelID.GPT_4_32K_0613, @@ -1,27 +1,25 @@ # Maintainer: Junxuan Liao <mikeljx at 126 dot com> _pkgname=chatbot-ui -pkgname=$_pkgname-git -pkgver=r293.2e6c0ee -pkgrel=5 -pkgdesc="An open source ChatGPT UI." +pkgname=$_pkgname-legacy-git +pkgver=r238.6bdbf1c +pkgrel=1 +pkgdesc="An open source ChatGPT UI. (legacy version)" arch=('x86_64') url='https://github.com/mckaywrigley/chatbot-ui' license=('MIT') depends=('nodejs') makedepends=('git' 'npm') backup=("etc/webapps/${pkgname}/.env.local") -source=("git+$url.git" +source=("git+$url.git#branch=legacy" "sysusers.conf" - "chatbot-ui.service" - "0001-support-GPT-4-Turbo.patch" - "0002-Fix-json-parsing.patch") + "chatbot-ui-legacy.service" + "0001-support-GPT-4-Turbo.patch") options=(!emptydirs) sha256sums=('SKIP' - '4de4e4d3bac91214398da078b3f2b5d72182b7e6a69c9124eb19713827942958' - '45dcb629ff221cd36d0f4c22cd5d886924233ada9b342bb0e59546fb35d1bea6' - '5824fc36a6a100151e6a27e8d1b0389a16517a4f2151e14e3f55ce5cd450ffec' - 'bf4cccd454d1d77038d71627fb00ec49428e014bd90ed565512910b463aff952') + '58ecd3fccc798f90d906d9a9928ee1268e916f277dfd35e644ca0ce83fde5c30' + 'bad9ec7fd322307418ee821b070c45c3f7151cc4ca5ca7a50f29c7892f2e1ed4' + '6cb74c1c48ee5bbd63f1bec185d83572237e9a3375e33a073cc76c50c443e290') pkgver() { cd "${srcdir}/${_pkgname}" @@ -31,7 +29,6 @@ pkgver() { prepare() { cd "${_pkgname}" git apply "${srcdir}"/"0001-support-GPT-4-Turbo.patch" - git apply "${srcdir}"/"0002-Fix-json-parsing.patch" } build() { @@ -55,11 +52,11 @@ package() { ln -s "/etc/webapps/${pkgname}/.env.local" "${pkgdir}/usr/share/webapps/${pkgname}/.env.local" - # Configure chatbot-ui user and some directories writable for that user. + # Configure chatbot-ui-legacy user and some directories writable for that user. install -Dm0644 ${srcdir}/sysusers.conf "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf" # Install systemd service file. - install -Dm0644 -t "${pkgdir}/usr/lib/systemd/system/" "${srcdir}"/chatbot-ui.service + install -Dm0644 -t "${pkgdir}/usr/lib/systemd/system/" "${srcdir}"/chatbot-ui-legacy.service # Install MIT license. install -Dm0644 license "$pkgdir/usr/share/licenses/$pkgname/LICENSE" diff --git a/chatbot-ui-legacy.service b/chatbot-ui-legacy.service new file mode 100644 index 000000000000..d5c0e4592a78 --- /dev/null +++ b/chatbot-ui-legacy.service @@ -0,0 +1,44 @@ +[Unit] +Description=An open source ChatGPT UI (lecacy version) +After=network.target + +[Service] +Type=exec + +Environment=NODE_ENV=production + +User=chatbot-ui +Group=chatbot-ui + +WorkingDirectory=/usr/share/webapps/chatbot-ui-legacy-git +ExecStart=/usr/bin/node node_modules/.bin/next start + +CapabilityBoundingSet= +NoNewPrivileges=true +PrivateDevices=true +RemoveIPC=true +LockPersonality=true + +ProtectControlGroups=true +ProtectKernelTunables=true +ProtectKernelModules=true +ProtectKernelLogs=true +ProtectClock=true +ProtectHostname=true +ProtectProc=noaccess + +RestrictRealtime=true +RestrictSUIDSGID=true +RestrictNamespaces=true +RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 + +ProtectSystem=strict +ProtectHome=true +PrivateTmp=true + +SystemCallArchitectures=native +SystemCallFilter=@system-service @pkey + +[Install] +WantedBy=multi-user.target + diff --git a/sysusers.conf b/sysusers.conf index 1ec361105a6e..ef6d858bfbda 100644 --- a/sysusers.conf +++ b/sysusers.conf @@ -1 +1 @@ -u chatbot-ui - "chatbot-ui user" +u chatbot-ui-legacy - "chatbot-ui-legacy user" |