summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorM0Rf302023-11-04 12:58:26 +0100
committerM0Rf302023-11-04 12:58:26 +0100
commit0fbf1f56c11a0b10024222eb650c96ca33b15d3a (patch)
tree26dbd938eda36c5f3d0f291a5b7ba46f178798fe
parentcb508bbde21adf5ca450f4bcce290ea3d15a10b8 (diff)
downloadaur-0fbf1f56c11a0b10024222eb650c96ca33b15d3a.tar.gz
local-ai: add systemd facilities
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD27
-rw-r--r--local-ai.conf55
-rw-r--r--local-ai.service15
-rw-r--r--local-ai.sysusers3
-rw-r--r--local-ai.tmpfiles8
6 files changed, 114 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 432ffeb2a4cf..97dabe378314 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = local-ai
pkgdesc = Free, Open Source OpenAI alternative. Self-hosted, community-driven and local-first.
pkgver = 1.40.0
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/mudler/LocalAI
arch = aarch64
arch = x86_64
@@ -15,6 +15,14 @@ pkgbase = local-ai
makedepends = re2
depends = glibc
source = https://github.com/mudler/LocalAI/archive/refs/tags/v1.40.0.tar.gz
+ source = local-ai.conf
+ source = local-ai.tmpfiles
+ source = local-ai.sysusers
+ source = local-ai.service
sha256sums = 1f55271a038caa00031f220e570eedc25ec1d232686b30c72465746058a05e79
+ sha256sums = a642a3eda0fe24fa2ebffc5ec997fdbcc2ee74b615045fe5f0e40c4efc7b8399
+ sha256sums = 90e042d0f5885b63a6aa4db7f87d6b931956f6c9b022407593466f61f6973312
+ sha256sums = 97ba21355c50ec658e220bc0558f506227b3dc77cc51f343b6f5657b0d77a19b
+ sha256sums = affefb565e63f19fbdad53032c090fc33c2aa8ce986ba9cf678ccf071c2d67bf
pkgname = local-ai
diff --git a/PKGBUILD b/PKGBUILD
index 0271c10b4a5e..3df786b19431 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,14 +2,19 @@
pkgname=local-ai
_pkgname=LocalAI
pkgver=1.40.0
-pkgrel=1
+pkgrel=2
pkgdesc="Free, Open Source OpenAI alternative. Self-hosted, community-driven and local-first."
arch=('aarch64' 'x86_64')
url="https://github.com/mudler/LocalAI"
license=('MIT')
depends=('glibc')
makedepends=('c-ares' 'git' 'go' 'grpc' 'make' 'openssl' 're2')
-source=("${url}/archive/refs/tags/v${pkgver}.tar.gz")
+source=("${url}/archive/refs/tags/v${pkgver}.tar.gz"
+ "${pkgname}.conf"
+ "${pkgname}.tmpfiles"
+ "${pkgname}.sysusers"
+ "${pkgname}.service"
+)
build() {
cd "${_pkgname}-${pkgver}"
@@ -18,7 +23,23 @@ build() {
package() {
cd "${_pkgname}-${pkgver}"
+
install -Dm775 "${pkgname}" -t "${pkgdir}/usr/bin/"
+
+ install -D -m644 "${srcdir}/${pkgname}.conf" \
+ "${pkgdir}/etc/conf.d/${pkgname}.conf"
+
+ # systemd
+ install -D -m644 "${srcdir}/${pkgname}.service" \
+ -t "${pkgdir}/usr/lib/systemd/system"
+ install -D -m644 "${srcdir}/${pkgname}.sysusers" \
+ "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
+ install -D -m644 "${srcdir}/${pkgname}.tmpfiles" \
+ "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
}
-sha256sums=('1f55271a038caa00031f220e570eedc25ec1d232686b30c72465746058a05e79')
+sha256sums=('1f55271a038caa00031f220e570eedc25ec1d232686b30c72465746058a05e79'
+ 'a642a3eda0fe24fa2ebffc5ec997fdbcc2ee74b615045fe5f0e40c4efc7b8399'
+ '90e042d0f5885b63a6aa4db7f87d6b931956f6c9b022407593466f61f6973312'
+ '97ba21355c50ec658e220bc0558f506227b3dc77cc51f343b6f5657b0d77a19b'
+ 'affefb565e63f19fbdad53032c090fc33c2aa8ce986ba9cf678ccf071c2d67bf')
diff --git a/local-ai.conf b/local-ai.conf
new file mode 100644
index 000000000000..b7f1eab9c1c2
--- /dev/null
+++ b/local-ai.conf
@@ -0,0 +1,55 @@
+# Configuration file for the application
+
+# Flags for different functionalities
+# Enable F16 functionality
+# F16=false
+# Enable gallery autoloading
+# AUTOLOAD_GALLERIES=false
+# Enable debug mode
+# DEBUG=false
+# Allow only one backend to be running
+# SINGLE_ACTIVE_BACKEND=false
+# Enable CORS
+# CORS=false
+# Set allowed CORS origins
+# CORS_ALLOW_ORIGINS=""
+
+# Threading configuration
+# Number of threads for parallel computation
+# THREADS=4
+
+# Paths for models and galleries
+# Path containing models used for inference
+MODELS_PATH="/var/lib/local-ai/models"
+# JSON list of galleries
+GALLERIES='[{"name":"model-gallery", "url":"github:go-skynet/model-gallery/index.yaml"}, {"url": "github:go-skynet/model-gallery/huggingface.yaml","name":"huggingface"}]'
+# List of models to preload at startup
+# PRELOAD_MODELS=""
+# Path to a YAML config file for preloading models
+# PRELOAD_MODELS_CONFIG=""
+# Path to the config file
+# CONFIG_FILE="/etc/local-ai/local-ai.yaml"
+
+# Server address and directories
+# Bind address for the API server
+# ADDRESS=":8080"
+# Directory for images
+IMAGE_PATH="/var/lib/local-ai/generated/images"
+# Directory for audio
+AUDIO_PATH="/var/lib/local-ai/generated/audio"
+# Path to backend assets
+BACKEND_ASSETS_PATH="/var/lib/local-ai/backend_data"
+
+# External GRPC backends
+# List of external GRPC backends
+EXTERNAL_GRPC_BACKENDS="huggingface-embeddings:/build/extra/grpc/huggingface/huggingface.py,autogptq:/build/extra/grpc/autogptq/autogptq.py,bark:/build/extra/grpc/bark/ttsbark.py,diffusers:/build/extra/grpc/diffusers/backend_diffusers.py,exllama:/build/extra/grpc/exllama/exllama.py,vall-e-x:/build/extra/grpc/vall-e-x/ttsvalle.py,vllm:/build/extra/grpc/vllm/backend_vllm.py"
+
+# Model context and upload settings
+# Default context size of the model
+# CONTEXT_SIZE=512
+# Default upload-limit in MB
+# UPLOAD_LIMIT=15
+# List of API Keys for API authentication
+# API_KEY=()
+# If set, the API is not launched and only the preloaded models/backends are started
+# PRELOAD_BACKEND_ONLY=false \ No newline at end of file
diff --git a/local-ai.service b/local-ai.service
new file mode 100644
index 000000000000..12fe19ed7e78
--- /dev/null
+++ b/local-ai.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=LocalAI API For Running LLaMA/GPT Models
+After=local-fs.target
+
+[Service]
+User=local-ai
+Group=local-ai
+EnvironmentFile=/etc/conf.d/local-ai.conf
+SyslogIdentifier=local-ai
+Type=simple
+ExecStart=/usr/bin/local-ai
+SuccessExitStatus=1
+
+[Install]
+WantedBy=multi-user.target
diff --git a/local-ai.sysusers b/local-ai.sysusers
new file mode 100644
index 000000000000..cb938951a5c3
--- /dev/null
+++ b/local-ai.sysusers
@@ -0,0 +1,3 @@
+u local-ai - "local-ai" /var/lib/local-ai /bin/sh
+g local-ai - -
+
diff --git a/local-ai.tmpfiles b/local-ai.tmpfiles
new file mode 100644
index 000000000000..1fd2fd3246c3
--- /dev/null
+++ b/local-ai.tmpfiles
@@ -0,0 +1,8 @@
+d /var/lib/local-ai 0755 local-ai local-ai
+d /var/log/local-ai 0755 local-ai local-ai
+d /var/lib/local-ai/models 0755 local-ai local-ai
+d /var/lib/local-ai/backend_data 0755 local-ai local-ai
+d /var/lib/local-ai/generated 0755 local-ai local-ai
+d /var/lib/local-ai/generated/images 0755 local-ai local-ai
+d /var/lib/local-ai/generated/audio 0755 local-ai local-ai
+Z /var/lib/local-ai 0755 local-ai local-ai