diff --git a/ct/localai.sh b/ct/localai.sh deleted file mode 100644 index 7e5cd2c1a2..0000000000 --- a/ct/localai.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash -_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main" -_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" -source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") -# Copyright (c) 2021-2026 community-scripts ORG -# Author: Bryan Lieberman (BryanCLieberman) -# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE -# Source: https://localai.io - -APP="LocalAI" -var_tags="${var_tags:-ai;llm;api}" -var_cpu="${var_cpu:-4}" -var_ram="${var_ram:-8192}" -var_disk="${var_disk:-30}" -var_os="${var_os:-debian}" -var_version="${var_version:-13}" -var_gpu="${var_gpu:-yes}" -var_unprivileged="${var_unprivileged:-1}" -# var_arm64 left unset: upstream ships a linux-arm64 asset, but this has never -# been run on an arm64 host, so arch_check asks rather than claiming support. - -# Values the install script accepts up front - without the export they never -# reach the container. -export var_auth="${var_auth:-no}" -export var_api_key="${var_api_key:-}" -export var_port="${var_port:-8080}" - -header_info "$APP" -variables -color -catch_errors - -function update_script() { - header_info - check_container_storage - check_container_resources - - if [[ ! -d /opt/localai ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - if check_for_gh_release "localai" "mudler/LocalAI"; then - msg_info "Stopping Service" - systemctl stop localai - msg_ok "Stopped Service" - - # Models, backends and the env file live outside /opt/localai, so a clean - # install only ever replaces the binary. - CLEAN_INSTALL=1 fetch_and_deploy_gh_release "localai" "mudler/LocalAI" "singlefile" "latest" "/opt/localai" "local-ai-v*-linux-$(arch_resolve amd64 arm64)" - - msg_info "Starting Service" - systemctl start localai - msg_ok "Started Service" - msg_ok "Updated successfully!" - fi - exit -} - -start -build_container -description - -msg_ok "Completed Successfully!\n" -echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" -echo -e "${INFO}${YW}Access it using the following URL:${CL}" -echo -e "${GATEWAY}${BGN}http://${IP}:8080${CL}" -echo -e "${INFO}${YW}Install models from the gallery in the web UI or place GGUF files in /opt/localai_data/models${CL}" \ No newline at end of file diff --git a/install/localai-install.sh b/install/localai-install.sh deleted file mode 100644 index 33ed19c5c5..0000000000 --- a/install/localai-install.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2021-2026 community-scripts ORG -# Author: Bryan Lieberman (BryanCLieberman) -# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE -# Source: https://localai.io - -source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" -color -verb_ip6 -catch_errors -setting_up_container -network_check -update_os - -var_port="${var_port:-8080}" -var_auth="${var_auth:-no}" -var_api_key="${var_api_key:-}" - -msg_info "Installing Dependencies" -$STD apt install -y \ - libgomp1 \ - libopenblas0 -msg_ok "Installed Dependencies" - -setup_hwaccel - -# The account system stores users, roles and sessions in SQLite by default, but -# that needs a CGO build (-tags auth) which upstream does not ship in the release -# binary. PostgreSQL is the supported alternative and needs no CGO. -if [[ "$var_auth" == "yes" ]]; then - setup_postgresql - PG_DB_NAME="localai" PG_DB_USER="localai" setup_postgresql_db -fi - -fetch_and_deploy_gh_release "localai" "mudler/LocalAI" "singlefile" "latest" "/opt/localai" "local-ai-v*-linux-$(arch_resolve amd64 arm64)" - -msg_info "Configuring LocalAI" -# Models, backends and the auth database are kept outside /opt/localai so an -# update can replace the binary without touching any of them. -mkdir -p /opt/localai_data/models /opt/localai_data/backends -cat </opt/localai.env -LOCALAI_ADDRESS=0.0.0.0:${var_port} -LOCALAI_DATA_PATH=/opt/localai_data -LOCALAI_MODELS_PATH=/opt/localai_data/models -LOCALAI_BACKENDS_PATH=/opt/localai_data/backends -LOCALAI_LOG_LEVEL=info -EOF -# LocalAI refuses to start on a wildcard bind with nothing to identify callers, -# and binding the wildcard is what makes the container reachable at all. -if [[ "$var_auth" == "yes" ]]; then - cat <>/opt/localai.env -LOCALAI_AUTH=true -LOCALAI_AUTH_DATABASE_URL=postgres://${PG_DB_USER}:${PG_DB_PASS}@localhost/${PG_DB_NAME} -LOCALAI_REGISTRATION_MODE=approval -EOF -fi -# A static key grants admin access on its own, so when it is the only thing -# guarding the API, generate one rather than leaving the server open. -if [[ -z "$var_api_key" && "$var_auth" != "yes" ]]; then - var_api_key="sk-$(openssl rand -hex 24)" - { - echo "LocalAI Credentials" - echo "API Key: ${var_api_key}" - } >>~/localai.creds -fi -if [[ -n "$var_api_key" ]]; then - echo "LOCALAI_API_KEY=${var_api_key}" >>/opt/localai.env -else - echo "#LOCALAI_API_KEY=" >>/opt/localai.env -fi -chmod 600 /opt/localai.env -msg_ok "Configured LocalAI" - -msg_info "Creating Service" -cat </etc/systemd/system/localai.service -[Unit] -Description=LocalAI Server -Wants=network-online.target -After=network-online.target - -[Service] -Type=simple -User=root -WorkingDirectory=/opt/localai -EnvironmentFile=/opt/localai.env -ExecStart=/opt/localai/localai run -Restart=on-failure -RestartSec=10 - -[Install] -WantedBy=multi-user.target -EOF -systemctl enable -q --now localai -msg_ok "Created Service" - -motd_ssh -customize -cleanup_lxc \ No newline at end of file diff --git a/json/localai.json b/json/localai.json deleted file mode 100644 index 051d699f5f..0000000000 --- a/json/localai.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "LocalAI", - "slug": "localai", - "categories": [ - 20 - ], - "date_created": "2026-08-24", - "type": "ct", - "updateable": true, - "privileged": false, - "interface_port": 8080, - "documentation": "https://localai.io/docs/", - "website": "https://localai.io/", - "repository": "https://github.com/mudler/LocalAI", - "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/localai.webp", - "description": "LocalAI is a drop-in replacement for the OpenAI API that runs entirely on your own hardware. One binary serves text generation, image generation, speech-to-text and text-to-speech behind OpenAI-compatible endpoints, backed by a model gallery and pluggable inference backends. Heavier than llama.cpp, but multi-modal and self-managing.", - "install_methods": [ - { - "type": "default", - "script": "ct/localai.sh", - "config_path": "/opt/localai.env", - "resources": { - "cpu": 4, - "ram": 8192, - "hdd": 30, - "os": "Debian", - "version": "13" - } - } - ], - "default_credentials": { - "username": null, - "password": null - }, - "app_vars": [ - { - "name": "var_auth", - "label": "Enable User Accounts", - "type": "boolean", - "default": "no", - "help": "Installs PostgreSQL and enables the account system with roles and sessions. The first account created becomes admin, later ones need its approval" - }, - { - "name": "var_api_key", - "label": "API Key", - "type": "password", - "secret": true, - "help": "Shared key granting admin access, sent as a bearer token. Generated and saved to ~/localai.creds when left empty and user accounts are off" - }, - { - "name": "var_port", - "label": "Port", - "type": "number", - "default": "8080" - }, - { - "name": "INSTALL_NVIDIA_DRIVERS", - "label": "Install NVIDIA driver libraries", - "type": "boolean", - "default": "yes", - "help": "Set to no when you install a matching driver in the container yourself" - } - ], - "notes": [ - { - "text": "No models are installed by default. Use the gallery in the web UI to pull one, or drop GGUF files into /opt/localai_data/models. Inference backends are fetched on first use and can be several GB each, which is what the 30 GB default disk is for.", - "type": "info" - }, - { - "text": "The API is protected from the moment it starts. With user accounts off, a static API key is generated and saved to ~/localai.creds in the container; clients send it as 'Authorization: Bearer ' or an 'x-api-key' header, and it grants full admin access. With user accounts on, register in the web UI immediately after install - the first account created becomes the admin.", - "type": "warning" - }, - { - "text": "GPU passthrough is offered during creation and driver libraries inside the container are matched to the host driver version automatically. Without a GPU everything still works on the CPU, just slowly.", - "type": "info" - }, - { - "text": "Models, backends and the auth database live in /opt/localai_data and configuration in /opt/localai.env, both outside the application directory, so updates never touch them. A mount point on /opt/localai_data is worth considering rather than growing the root disk.", - "type": "info" - }, - { - "text": "User accounts need a database. Upstream ships the release binary without the CGO auth tag, so the built-in SQLite store is unavailable and PostgreSQL is installed alongside LocalAI when the option is enabled. Leaving it off keeps the container to a single service.", - "type": "info" - } - ] -} \ No newline at end of file