Initial commit: LocalAI P2P addons
This commit is contained in:
12
localai-p2p-worker/Dockerfile
Normal file
12
localai-p2p-worker/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM localai/localai:latest-cpu
|
||||
|
||||
|
||||
|
||||
ENV LOCALAI_P2P="true"
|
||||
ENV LOCALAI_FEDERATED="true"
|
||||
|
||||
|
||||
COPY run.sh /run.sh
|
||||
RUN chmod +x /run.sh
|
||||
|
||||
CMD [ "/run.sh" ]
|
||||
29
localai-p2p-worker/config.yaml
Normal file
29
localai-p2p-worker/config.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
name: "LocalAI P2P Worker"
|
||||
version: "1.0.2" # Incrémentez aussi la version
|
||||
slug: "localai-p2p-worker" # ⬅️ IMPORTANT : doit correspondre au nom du dossier
|
||||
description: "LocalAI P2P federation worker node"
|
||||
image: localai/localai:latest
|
||||
arch:
|
||||
- amd64
|
||||
host_network: true # OBLIGATOIRE pour P2P
|
||||
startup: application
|
||||
ports:
|
||||
8080/tcp: 8081 # Port différent si sur même réseau
|
||||
environment:
|
||||
LOCALAI_P2P: "true"
|
||||
LOCALAI_FEDERATED: "true"
|
||||
THREADS: 8 # Utiliser tous les cœurs du 5800U
|
||||
OMP_NUM_THREADS: 8
|
||||
map:
|
||||
- type: share
|
||||
read_only: false
|
||||
- type: addon_config
|
||||
read_only: false
|
||||
options:
|
||||
master_token: ""
|
||||
gpu_layers: 0
|
||||
debug: false
|
||||
schema:
|
||||
master_token: str
|
||||
gpu_layers: "int(0,)"
|
||||
debug: "bool?"
|
||||
11
localai-p2p-worker/run.sh
Normal file
11
localai-p2p-worker/run.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
CONFIG_PATH=/data/options.json
|
||||
|
||||
GPU_LAYERS="$(bashio::config 'gpu_layers')"
|
||||
TOKEN="$(bashio::config 'master_token' || echo '')"
|
||||
|
||||
if [ ! -z "$TOKEN" ]; then
|
||||
export LOCALAI_P2P_TOKEN="$TOKEN"
|
||||
fi
|
||||
|
||||
exec /build/local-ai run --models-path=/share/localai/models --gpu-layers="$GPU_LAYERS"
|
||||
Reference in New Issue
Block a user