withcatai / catai

Run AI ✨ assistant locally! with simple API for Node.js 🚀
https://withcatai.github.io/catai/
MIT License
456 stars 30 forks source link

[Suggestion] User mode and developer mode (with more control) #26

Closed Koliham closed 1 year ago

Koliham commented 1 year ago

Hi, it would be good to have some kind of user mode and developer mode, which can be toggled with an environment variable. So you have more parameters to choose from in developer mode and when you are ready, you ship it in user mode with a simple interface.

ido-pluto commented 1 year ago

Actually, I created something like that, currently, this is in the preview. You can install this version like that:

npm i -g catai@1

I did not release that because I need more feedback, I am unsure what bug there is and what more would be good. If you have feedback, it will be much appreciated :)

Koliham commented 1 year ago

Got an error installing it with "npm i -g catai@1"

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'catai@1.0.1',
npm WARN EBADENGINE   required: { node: '>=19' },
npm WARN EBADENGINE   current: { node: 'v18.16.0', npm: '9.5.1' }
npm WARN EBADENGINE }
npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/catai
npm ERR! command failed
npm ERR! command sh -c node scripts/migration/index.js
npm ERR! node:internal/process/promises:288
npm ERR!             triggerUncaughtException(err, true /* fromPromise */);
npm ERR!             ^
npm ERR!
npm ERR! [Error: ENOENT: no such file or directory, scandir '/root/catai/models'] {
npm ERR!   errno: -2,
npm ERR!   code: 'ENOENT',
npm ERR!   syscall: 'scandir',
npm ERR!   path: '/root/catai/models'
npm ERR! }
npm ERR!
npm ERR! Node.js v18.16.0

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-06-21T19_05_01_337Z-debug-0.log

My current models directory is in /home/myusername/catai/models Did version 1 change the models path?

ido-pluto commented 1 year ago

No, but it migrates changes from version 0 to 1.

Try to update nodejs to version 20, and try again.

Did you run this with sudo? That weird he thinks your home directory is root

Koliham commented 1 year ago

I had permission issues with some folders:

npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/catai/scripts/cli.js' -> '/usr/bin/catai'
npm ERR!  [Error: EACCES: permission denied, symlink '../lib/node_modules/catai/scripts/cli.js' -> '/usr/bin/catai']

But I was finally able to install it:

ido-pluto commented 1 year ago

You can set the environment variable 'CATAI_ADMIN_SETTINGS' to false. I will check the dialog model, what is the height of your screen?

ido-pluto commented 1 year ago

Fixed, on version 1.0.2