Skip to content

Commit

Permalink
local-ai-cc: adjust some things
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L. <[email protected]>
  • Loading branch information
szaimen committed Jan 20, 2025
1 parent 35ff787 commit 7ef2f07
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
28 changes: 16 additions & 12 deletions community-containers/local-ai/local-ai.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,23 @@
"documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/local-ai",
"image": "szaimen/aio-local-ai",
"image_tag": "v2",
"internal_port": "8080",
"internal_port": "8000",
"restart": "unless-stopped",
"ports": [
{
"ip_binding": "%APACHE_IP_BINDING%",
"port_number": "8000",
"protocol": "tcp"
}
],
"environment": [
"TZ=%TIMEZONE%",
"MODELS_PATH=/models"
"MODELS_PATH=/models",
"API_KEY=%LOCAL_AI_API_KEY%",
"LOCALAI_ADDRESS=:8000"
],
"secrets": [
"LOCAL_AI_API_KEY"
],
"volumes": [
{
Expand All @@ -22,22 +34,14 @@
"source": "nextcloud_aio_localai_images",
"destination": "/tmp/generated/images/",
"writeable": true
},
{
"source": "%NEXTCLOUD_DATADIR%",
"destination": "/nextcloud",
"writeable": false
}
],
"enable_nvidia_gpu": false,
"nextcloud_exec_commands": [
"mkdir '/mnt/ncdata/admin/files/nextcloud-aio-local-ai'",
"touch '/mnt/ncdata/admin/files/nextcloud-aio-local-ai/models.yaml'",
"echo 'Scanning nextcloud-aio-local-ai folder for admin user...'",
"php /var/www/html/occ files:scan --path='/admin/files/nextcloud-aio-local-ai'",
"php /var/www/html/occ app:install integration_openai",
"php /var/www/html/occ app:enable integration_openai",
"php /var/www/html/occ config:app:set integration_openai url --value http://nextcloud-aio-local-ai:8080",
"php /var/www/html/occ config:app:set integration_openai url --value http://nextcloud-aio-local-ai:8000",
"php /var/www/html/occ config:app:set integration_openai api_key --value $LOCAL_AI_API_KEY",
"php /var/www/html/occ app:install assistant",
"php /var/www/html/occ app:enable assistant"
]
Expand Down
8 changes: 1 addition & 7 deletions community-containers/local-ai/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ This container bundles Local AI and auto-configures it for you.

### Notes
- Make sure to have enough storage space available. This container alone needs ~7GB storage. Every model that you add to `models.yaml` will of course use additional space which adds up quite fast.
- After the container was started the first time, you should see a new `nextcloud-aio-local-ai` folder when you open the files app with the default `admin` user. In there you should see a `models.yaml` config file. You can now add models in there. Please refer [here](https://github.com/mudler/LocalAI/blob/master/gallery/index.yaml) where you can get further urls that you can put in there. Afterwards restart all containers from the AIO interface and the models should automatically get downloaded by the local-ai container and activated.
- Example for content of `models.yaml` (if you add all of them, it takes around 10GB additional space):
```yaml
# Stable Diffusion in NCNN with c++, supported txt2img and img2img
- url: github:mudler/LocalAI/blob/master/gallery/stablediffusion.yaml
name: Stable_diffusion
```
- After the container was started the first time, you can open `http://ip.address.of.server:8000` and log in with the api key that you can retrieve when running...
- To make it work, you first need to browse `https://your-nc-domain.com/settings/admin/ai` and enable or disable specific features for your models in the openAI settings. Afterwards using the Nextcloud Assistant should work.
- See [this guide](https://github.com/nextcloud/all-in-one/discussions/5430) for how to improve AI task pickup speed
- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers how to add it to the AIO stack
Expand Down

0 comments on commit 7ef2f07

Please sign in to comment.