Package: ownAI
ownAIWith ownAI you can run your own AIs.ownAI is an open-source platform written in Python using the Flask framework. It allows you to host and manage AI applications with a web interface for interaction. ownAI supports the customization of AIs for specific use cases and provides a flexible environment for your AI projects.For a demo installation and a managed private cloud service, please visithttps://ownai.org.Table of ContentsFeaturesInstallationProduction setupDevelopment setupUsageAI filesUpdatingRun with DockerContributingLicenseFeaturesHost and manage AI applicationsWeb-based interface for interacting with AI modelsSupport for AI customization to suit specific needsCreate and manage additional knowledge for AIsOpen-source and community-drivenInstallationownAI requires Python 3.8 or higher. Due to a dependency issue, it does not currently run on Python 3.11. To install and set up ownAI, follow these steps:Clone the repository:git clone https://github.com/own-ai/ownAI.gitEnter the project directory:cd ownAICreate a virtual environment and activate it:python3 -m venv venv
source venv/bin/activateInstall requirements:pip install -r requirements.txtConfigure the server by copying the.env.templatefile to.envand then editing the.envfile.Initialize the database:flask db upgradeRegister a new user:flask add-userOptionally: Set up your first AI. We recommend starting with the Llama 2 model and theHelpful Assistantexample.Download the model (this needs about 4 GB of disk space):flask download-model --repo "TheBloke/Llama-2-7B-Chat-GGUF" --filename "llama-2-7b-chat.Q4_K_M.gguf"Add the AI:flask add-ai --aifile ./examples/llamacpp/helpful_assistant.aifileStart the server:flask runNow, you should be able to access the ownAI web interface athttp://localhost:5000.Production setupFor a production setup, we recommend using a WSGI server such as Gunicorn.
If you followed the steps above, Gunicorn is already installed in your virtual environment.
To start the server, run:gunicorn -b 0.0.0.0:5000 --worker-class geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 "backaind:create_app()"We recommend using a reverse proxy such as nginx to handle HTTPS.Development setupIf you want to contribute to the ownAI frontend, you can set up a development environment as follows:Install Node.js and npm.Install the frontend dependencies:npm installStart the development server (this already includes starting the Flask backend server):npm run devUsageTo start interacting with your own AI, visit the web interface athttp://localhost:5000and follow these steps:Log in using the credentials you set up during installation.Click on the ownAI logo in the upper left corner to open the main menu.Choose "AI Workshop" and click the "New AI" button.Load an Aifile (seebelowfor details and in theexamples directoryfor examples).Optionally customize the AI to suit your needs.Optionally select "Knowledge" from the main menu to upload additional knowledge (if your AI chain supports it).Select "Interaction" from the main menu and enter your input text or data in the provided input box.AI filesownAI uses.aifilefiles to store and load the specification and configuration of AIs.
In theexamples directoryyou can find many different examples to run various AI models locally or to use external providers.Please also refer to thereadme filein the examples directory.If you want to get started quickly and run your AIs by yourself, please have a look at thellamacppexamples.
These allow you to run your own AIs on your machine with little or no further setup.If you want to create your own aifiles, have a look at theaifilemaker.pyscript, which you can use as a starting point.UpdatingTo update ownAI, simply pull the latest changes from the repository and run:source venv/bin/activate
pip install -r requirements.txt
flask db upgradeRun with DockerIf you have Docker installed, you can run ownAI in a Docker container.
Otherwise please follow theinstallationsection.To run ownAI with Docker, first configure the server by downloading the.env.templatefile.
Rename the file todocker.envand edit the file.
Then run the following command (replace<your-username>and<your-password>):docker run --name ownai --env OWNAI_ROOT_USER=<your-username> --env OWNAI_ROOT_PASSWORD=<your-password> --env OWNAI_DOWNLOAD_REPO="TheBloke/Llama-2-7B-Chat-GGUF" --env OWNAI_DOWNLOAD_FILE="llama-2-7b-chat.Q4_K_M.gguf" --env-file ./docker.env -p 5000:5000 ownai/ownaiThis is only required for the first run. To start the server again just run:docker start ownaiContributingWe welcome contributions from the community. To contribute, please:Fork the repositoryCreate a new branch for your feature or bugfixCommit your changesOpen a pull requestPlease follow the coding style guidelines and ensure your changes are well-documented.
Thank you very much for your contribution!LicenseownAI is released under theMIT License.