So, I have localai running as a custom app. it has its own hard drive dedicated to it, my yml (not sure what else to call it… the custom app settings) are below.
LocalAI runs fine on TrueNAS, accessable from outside, slowly, but beautifully, it can run some absolutely gargantuan models (75B models
)
Anyway, i have other machines throughout the house (and some of my offices have servers in them with hardware i can leverage). Problem is, as soon as i add a P2P token, it breaks the app. I can enable Federated, assign a network, but as soon as i try to generate a key and save, edit the config to contain the token, or paste the token into the ui. Every path leads to breaking localai (it wont boot). And, its hard to catch the logs before it crashes, so its difficult to see what the container is reporting back.
manually editing the config file for localai and removing the key fixes the issue and localai comes up correctly, but with the same issues. Ive tried editing the permissions on the localai folder, the sub directories of its data, the specific config file. Ive got 3 other machines inked together ready and waiting for this guy to come up… but that token breaks it every time. Any help would be appreciated. (Below is my custom config for the truenas app and my localai config.
```
services:
localai:
cap_drop:
- ALL
deploy:
resources:
limits:
cpus: '10'
memory: 65536M
environment:
GID: '1000'
GROUP_ID: '1000'
LOCALAI_ADDRESS: ':1234'
LOCALAI_BACKENDS_PATH: /backends
LOCALAI_CONFIG_DIR: /configuration
LOCALAI_DISABLE_WEBUI: 'false'
LOCALAI_MODELS_PATH: /models
NVIDIA_VISIBLE_DEVICES: void
PGID: '1000'
PUID: '1000'
TZ: Etc/UTC
UID: '1000'
UMASK: '002'
UMASK_SET: '002'
USER_ID: '1000'
group_add:
- 1000
healthcheck:
interval: 30s
retries: 5
start_interval: 2s
start_period: 15s
test:
- CMD
- curl
- '--request'
- GET
- '--silent'
- '--output'
- /dev/null
- '--show-error'
- '--fail'
- http://127.0.0.1:1234/readyz
timeout: 5s
image: quay.io/go-skynet/local-ai:v4.2.4
network_mode: host
platform: linux/amd64
privileged: False
restart: unless-stopped
security_opt:
- no-new-privileges=true
stdin_open: False
tty: False
user: '1000:1000'
volumes:
- bind:
create_host_path: False
propagation: rprivate
read_only: False
source: /mnt/apps/docker/localai/backends
target: /backends
type: bind
- bind:
create_host_path: False
propagation: rprivate
read_only: False
source: /mnt/apps/docker/localai/config
target: /configuration
type: bind
- bind:
create_host_path: False
propagation: rprivate
read_only: False
source: /mnt/apps/docker/localai/models
target: /models
type: bind
- bind:
create_host_path: False
propagation: rprivate
read_only: False
source: /mnt/apps/docker/localai/data
target: /data
type: bind
volumes: {}
x-action-required: False
x-notes: >
# LocalAI
## Security
**Read the following security precautions to ensure that you wish to continue
using this application.**
---
### Container: [localai]
#### Running user/group(s)
- User: 1000
- Group: 1000
- Supplementary Groups: apps
---
## Bug Reports and Feature Requests
If you find a bug in this app or have an idea for a new feature, please file
an issue at
https://github.com/truenas/apps
x-portals:
- host: 0.0.0.0
name: Web UI
path: /
port: 1234
scheme: http
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##################!!runtime_settings.json!!(CONFIG)#####################
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
"watchdog_enabled": true,
"watchdog_idle_enabled": true,
"watchdog_busy_enabled": true,
"watchdog_idle_timeout": "15m0s",
"watchdog_busy_timeout": "5m0s",
"watchdog_interval": "500ms",
"single_backend": false,
"max_active_backends": 2,
"auto_upgrade_backends": false,
"prefer_development_backends": false,
"memory_reclaimer_enabled": true,
"memory_reclaimer_threshold": 0.9,
"force_eviction_when_busy": false,
"lru_eviction_max_retries": 30,
"lru_eviction_retry_interval": "1s",
"threads": 0,
"context_size": 1024,
"f16": false,
"debug": false,
"enable_tracing": false,
"tracing_max_items": 1024,
"enable_backend_logging": false,
"cors": false,
"csrf": false,
"cors_allow_origins": "",
"p2p_token": "ThisIsTheOffendingKeyThatIfHereCausesMeNotToBoot",
"p2p_network_id": "MyCoolAI",
"federated": true,
"galleries": [
{
"url": "github:mudler/LocalAI/gallery/index.yaml@master",
"name": "localai"
}
],
"backend_galleries": [
{
"url": "github:mudler/LocalAI/backend/index.yaml@master",
"name": "localai"
}
],
"autoload_galleries": true,
"autoload_backend_galleries": true,
"api_keys": null,
"agent_job_retention_days": 30,
"open_responses_store_ttl": "0",
"agent_pool_enabled": true,
"agent_pool_default_model": "qwen3.6-40b-claude-4.6-opus-deckard-heretic-uncensored-thinking-neo-code-di-imatrix-max",
"agent_pool_embedding_model": "granite-embedding-107m-multilingual",
"agent_pool_max_chunking_size": 400,
"agent_pool_chunk_overlap": 0,
"agent_pool_enable_logs": false,
"agent_pool_collection_db_path": "",
"agent_pool_vector_engine": "chromem",
"agent_pool_database_url": "",
"agent_pool_agent_hub_url": "https://agenthub.localai.io",
"localai_assistant_enabled": true,
"instance_name": "MyCoolAI",
"instance_tagline": ""
}