Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community containers - add local ai #3495

Merged
merged 1 commit into from
Oct 18, 2023
Merged

community containers - add local ai #3495

merged 1 commit into from
Oct 18, 2023

Conversation

szaimen
Copy link
Collaborator

@szaimen szaimen commented Oct 6, 2023

@szaimen szaimen added 2. developing Work in progress enhancement New feature or request labels Oct 6, 2023
@szaimen szaimen added this to the next milestone Oct 6, 2023
@szaimen szaimen force-pushed the enh/noid/add-local-ai branch 2 times, most recently from b4c40e3 to 755531a Compare October 6, 2023 19:43
@FlattusBlastus
Copy link

Would like to test this one

@szaimen szaimen force-pushed the enh/noid/add-local-ai branch from 755531a to cd7a872 Compare October 18, 2023 10:56
@szaimen szaimen marked this pull request as ready for review October 18, 2023 11:34
@szaimen szaimen added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 18, 2023
@szaimen szaimen merged commit 3f5854c into main Oct 18, 2023
@delete-merged-branch delete-merged-branch bot deleted the enh/noid/add-local-ai branch October 18, 2023 11:36
@BluePixel4k
Copy link

I tried to add the local-ai cummunity-container but I got an error while "docker run ", that this container wasn't found:

The community container local-ai was not found!
You've set AIO_COMMUNITY_CONTAINERS but at least one container was not found.
It is set to 'fail2ban local-ai'.

What do I have to do?
Thanks in advance and for all your work! :)

@szaimen
Copy link
Collaborator Author

szaimen commented Oct 18, 2023

It is currently in develop channel. I let you know as soon as it is available in beta channel

@szaimen
Copy link
Collaborator Author

szaimen commented Oct 20, 2023

This is now released with v7.5.0 Beta. Testing and feedback is welcome! See https://github.com/nextcloud/all-in-one#how-to-switch-the-channel

@BluePixel4k
Copy link

Thank you!
I currently trying to get LocalAI working, but I get an error after requesting a task via the Nextcloud Assistant. The task failed and in the log I get this error:

[integration_openai] Warning: GuzzleHttp\Exception\ConnectException: cURL error 7: Failed to connect to localhost port 8080 after 0 ms: Couldn't connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost:8080/v1/models at <<closure>>

 0. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 158
    GuzzleHttp\Handler\CurlFactory::createRejection("*** sensitive parameters replaced ***")
 1. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 110
    GuzzleHttp\Handler\CurlFactory::finishError(["GuzzleHttp\\Handler\\CurlHandler"], "*** sensitive parameters replaced ***", ["GuzzleHttp\\Handler\\CurlFactory"])
 2. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php line 47
    GuzzleHttp\Handler\CurlFactory::finish(["GuzzleHttp\\Handler\\CurlHandler"], "*** sensitive parameters replaced ***", ["GuzzleHttp\\Handler\\CurlFactory"])
 3. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Middleware.php line 142
    GuzzleHttp\Handler\CurlHandler->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 4. /var/www/html/lib/private/Http/Client/DnsPinMiddleware.php line 114
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 5. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php line 35
    OC\Http\Client\DnsPinMiddleware->OC\Http\Client\{closure}("*** sensitive parameters replaced ***")
 6. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Middleware.php line 31
    GuzzleHttp\PrepareBodyMiddleware->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 7. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php line 71
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 8. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Middleware.php line 66
    GuzzleHttp\RedirectMiddleware->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 9. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/HandlerStack.php line 75
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
10. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Client.php line 333
    GuzzleHttp\HandlerStack->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
11. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Client.php line 169
    GuzzleHttp\Client->transfer("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
12. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Client.php line 189
    GuzzleHttp\Client->requestAsync("*** sensitive parameters replaced ***")
13. /var/www/html/lib/private/Http/Client/Client.php line 230
    GuzzleHttp\Client->request("*** sensitive parameters replaced ***", "http://localhost:8080/v1/models", ["/mnt/ncdata/fi ... e])
14. /var/www/html/custom_apps/integration_openai/lib/Service/OpenAiAPIService.php line 355
    OC\Http\Client\Client->get("http://localhost:8080/v1/models", [240,["Nextcloud ... ]])
15. /var/www/html/custom_apps/integration_openai/lib/Service/OpenAiAPIService.php line 66
    OCA\OpenAi\Service\OpenAiAPIService->request("admin", "models")
16. /var/www/html/custom_apps/integration_openai/lib/Controller/OpenAiAPIController.php line 47
    OCA\OpenAi\Service\OpenAiAPIService->getModels("admin")
17. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 230
    OCA\OpenAi\Controller\OpenAiAPIController->getModels()
18. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 137
    OC\AppFramework\Http\Dispatcher->executeController(["OCA\\OpenAi\\C ... "], "getModels")
19. /var/www/html/lib/private/AppFramework/App.php line 183
    OC\AppFramework\Http\Dispatcher->dispatch(["OCA\\OpenAi\\C ... "], "getModels")
20. /var/www/html/lib/private/Route/Router.php line 315
    OC\AppFramework\App::main("OCA\\OpenAi\\Co ... r", "getModels", ["OC\\AppFramewo ... "], ["integration_op ... "])
21. /var/www/html/lib/base.php line 1068
    OC\Route\Router->match("/apps/integration_openai/models")
22. /var/www/html/index.php line 36
    OC::handleRequest()

GET /apps/integration_openai/models
from 176.198.7.78 by admin at 2023-10-21T10:01:19+00:00

I added the container via the beta channel added the three example models to the models.yaml file and rebooted the docker containers.
After all containers are started, I looked in the "Machine translation" tab and could see the LocalAI connection. In the "Connected accounts" tab the LocalAI URL is "http://nexcloud-aio-local-ai:8080" - is this correct? I changed it to "http://localhost:8080" and "http://xxx.xxx.xxx.xxx:8080" (xxx -> local server ip), but the error also occur.
Did I do something wrong?

Additional info: the nexcloud server is behind e separate reverse proxy.

@Zoey2936
Copy link
Collaborator

it needs to be nextcloud-aio-local-ai

@BluePixel4k
Copy link

@Zoey2936 thx for clarifying this.
I changed it back to "http://nexcloud-aio-local-ai:8080" and rebooted the whole Nextcloud vm and now I get another error after requesting an AI function (it takes a while):

[integration_openai] Warning: GuzzleHttp\Exception\ServerException: Server error: `POST http://nextcloud-aio-local-ai:8080/v1/chat/completions` resulted in a `500 Internal Server Error` response:
{"error":{"code":500,"message":"could not load model - all backends returned error: 25 errors occurred:\n\t* could not l (truncated...)
 at <<closure>>

 0. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Middleware.php line 72
    GuzzleHttp\Exception\RequestException::create("*** sensitive parameters replaced ***")
 1. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php line 209
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 2. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php line 158
    GuzzleHttp\Promise\Promise::callHandler("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 3. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/TaskQueue.php line 52
    GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}("*** sensitive parameters replaced ***")
 4. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php line 251
    GuzzleHttp\Promise\TaskQueue->run(true)
 5. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php line 227
    GuzzleHttp\Promise\Promise->invokeWaitFn()
 6. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php line 272
    GuzzleHttp\Promise\Promise->waitIfPending()
 7. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php line 229
    GuzzleHttp\Promise\Promise->invokeWaitList()
 8. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/promises/src/Promise.php line 69
    GuzzleHttp\Promise\Promise->waitIfPending()
 9. /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Client.php line 189
    GuzzleHttp\Promise\Promise->wait()
10. /var/www/html/lib/private/Http/Client/Client.php line 301
    GuzzleHttp\Client->request("post", "http://nextclou ... s", ["/mnt/ncdata/fi ... "])
11. /var/www/html/custom_apps/integration_openai/lib/Service/OpenAiAPIService.php line 357
    OC\Http\Client\Client->post("http://nextclou ... s", [240,["Nextcloud ... "])
12. /var/www/html/custom_apps/integration_openai/lib/Service/OpenAiAPIService.php line 139
    OCA\OpenAi\Service\OpenAiAPIService->request("*** sensitive parameters replaced ***", "chat/completions", ["*** sensitive  ... "], "POST")
13. /var/www/html/custom_apps/integration_openai/lib/TextProcessing/SummaryProvider.php line 33
    OCA\OpenAi\Service\OpenAiAPIService->createChatCompletion("*** sensitive parameters replaced ***")
14. /var/www/html/lib/public/TextProcessing/Task.php line 101
    OCA\OpenAi\TextProcessing\SummaryProvider->process("*** sensitive parameters replaced ***")
15. /var/www/html/lib/private/TextProcessing/Manager.php line 143
    OCP\TextProcessing\Task->visitProvider(["OCA\\OpenAi\\T ... "])
16. /var/www/html/lib/private/TextProcessing/TaskBackgroundJob.php line 56
    OC\TextProcessing\Manager->runTask(["OCP\\TextProcessing\\Task"])
17. /var/www/html/lib/public/BackgroundJob/Job.php line 81
    OC\TextProcessing\TaskBackgroundJob->run([6])
18. /var/www/html/lib/public/BackgroundJob/QueuedJob.php line 57
    OCP\BackgroundJob\Job->start(["OC\\BackgroundJob\\JobList"])
19. /var/www/html/lib/public/BackgroundJob/QueuedJob.php line 47
    OCP\BackgroundJob\QueuedJob->start(["OC\\BackgroundJob\\JobList"])
20. /var/www/html/cron.php line 152
    OCP\BackgroundJob\QueuedJob->execute(["OC\\BackgroundJob\\JobList"], ["OC\\Log"])

at 2023-10-21T11:11:31+00:00

@szaimen
Copy link
Collaborator Author

szaimen commented Oct 21, 2023

var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/guzzle/src/Middleware.php

This looka like a comoatibility issue between fulltextsearch and openai. Can you disable fulltexsearch from the aio interface and check if that makes it work?

@BluePixel4k
Copy link

BluePixel4k commented Oct 21, 2023

I have just tested it, but sadly it still didn't work.

[integration_openai] Warning: GuzzleHttp\Exception\ServerException: Server error: `POST http://nextcloud-aio-local-ai:8080/v1/chat/completions` resulted in a `500 Internal Server Error` response:
{"error":{"code":500,"message":"could not load model - all backends returned error: 25 errors occurred:\n\t* could not l (truncated...)
 at <<closure>>

 0. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 69
    GuzzleHttp\Exception\RequestException::create("*** sensitive parameters replaced ***")
 1. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 204
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 2. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 153
    GuzzleHttp\Promise\Promise::callHandler("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 3. /var/www/html/3rdparty/guzzlehttp/promises/src/TaskQueue.php line 48
    GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}("*** sensitive parameters replaced ***")
 4. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 248
    GuzzleHttp\Promise\TaskQueue->run(true)
 5. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 224
    GuzzleHttp\Promise\Promise->invokeWaitFn()
 6. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 269
    GuzzleHttp\Promise\Promise->waitIfPending()
 7. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 226
    GuzzleHttp\Promise\Promise->invokeWaitList()
 8. /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php line 62
    GuzzleHttp\Promise\Promise->waitIfPending()
 9. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 187
    GuzzleHttp\Promise\Promise->wait()
10. /var/www/html/lib/private/Http/Client/Client.php line 301
    GuzzleHttp\Client->request("post", "http://nextclou ... s", ["/mnt/ncdata/fi ... "])
11. /var/www/html/custom_apps/integration_openai/lib/Service/OpenAiAPIService.php line 357
    OC\Http\Client\Client->post("http://nextclou ... s", [240,["Nextcloud ... "])
12. /var/www/html/custom_apps/integration_openai/lib/Service/OpenAiAPIService.php line 139
    OCA\OpenAi\Service\OpenAiAPIService->request("*** sensitive parameters replaced ***", "chat/completions", ["*** sensitive  ... "], "POST")
13. /var/www/html/custom_apps/integration_openai/lib/TextProcessing/SummaryProvider.php line 33
    OCA\OpenAi\Service\OpenAiAPIService->createChatCompletion("*** sensitive parameters replaced ***")
14. /var/www/html/lib/public/TextProcessing/Task.php line 101
    OCA\OpenAi\TextProcessing\SummaryProvider->process("*** sensitive parameters replaced ***")
15. /var/www/html/lib/private/TextProcessing/Manager.php line 143
    OCP\TextProcessing\Task->visitProvider(["OCA\\OpenAi\\T ... "])
16. /var/www/html/lib/private/TextProcessing/TaskBackgroundJob.php line 56
    OC\TextProcessing\Manager->runTask(["OCP\\TextProcessing\\Task"])
17. /var/www/html/lib/public/BackgroundJob/Job.php line 81
    OC\TextProcessing\TaskBackgroundJob->run([7])
18. /var/www/html/lib/public/BackgroundJob/QueuedJob.php line 57
    OCP\BackgroundJob\Job->start(["OC\\BackgroundJob\\JobList"])
19. /var/www/html/lib/public/BackgroundJob/QueuedJob.php line 47
    OCP\BackgroundJob\QueuedJob->start(["OC\\BackgroundJob\\JobList"])
20. /var/www/html/cron.php line 152
    OCP\BackgroundJob\QueuedJob->execute(["OC\\BackgroundJob\\JobList"], ["OC\\Log"])

at 2023-10-21T14:44:18+00:00

And at the same time I get always this PHP Error (but this is maybe only an Assistant thing?):

[PHP] Error: Undefined variable $notificationActionLabel at /var/www/html/custom_apps/assistant/lib/Listener/TaskFailedListener.php#46

at 2023-10-21T14:44:18+00:00

@szaimen
Copy link
Collaborator Author

szaimen commented Oct 21, 2023

And at the same time I get always this PHP Error (but it could be only a Assistant thing?):

[PHP] Error: Undefined variable $notificationActionLabel at /var/www/html/custom_apps/assistant/lib/Listener/TaskFailedListener.php#46

at 2023-10-21T14:44:18+00:00

Yeah sounds like it. Should probably be reported to https://github.com/nextcloud/assistant/issues

@szaimen
Copy link
Collaborator Author

szaimen commented Oct 21, 2023

{"error":{"code":500,"message":"could not load model - all backends returned error: 25 errors occurred:\n\t* could not l (truncated...)

Looks like mudler/LocalAI#1076

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants