Skip to main content

Run your own AI

Project description

ownAI

With 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 visit https://ownai.org.

Table of Contents

Features

  • Host and manage AI applications
  • Web-based interface for interacting with AI models
  • Support for AI customization to suit specific needs
  • Create and manage additional knowledge for AIs
  • Open-source and community-driven

Installation

ownAI 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:

  1. Clone the repository:
git clone https://github.com/own-ai/ownAI.git
  1. Enter the project directory:
cd ownAI
  1. Create a virtual environment and activate it:
python3 -m venv venv
source venv/bin/activate
  1. Install requirements:
pip install -r requirements.txt
  1. Configure the server by copying the .env.template file to .env and then editing the .env file.

  2. Initialize the database:

flask db upgrade
  1. Register a new user:
flask add-user
  1. Start the server:
flask run

Now, you should be able to access the ownAI web interface at http://localhost:5000.

Production setup

For 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 setup

If you want to contribute to the ownAI frontend, you can set up a development environment as follows:

  1. Install Node.js and npm.
  2. Install the frontend dependencies:
npm install
  1. Start the development server (this already includes starting the Flask backend server):
npm run dev

Usage

To start interacting with your own AI, visit the web interface at http://localhost:5000 and follow these steps:

  1. Log in using the credentials you set up during installation.

  2. Click on the ownAI logo in the upper left corner to open the main menu.

  3. Choose "AI Workshop" and click the "New AI" button.

  4. Load an Aifile (see below for details and in the examples directory for examples).

  5. Optionally customize the AI to suit your needs.

  6. Optionally select "Knowledge" from the main menu to upload additional knowledge (if your AI chain supports it).

  7. Select "Interaction" from the main menu and enter your input text or data in the provided input box.

AI files

ownAI uses .aifile files to store and load the specification and configuration of AIs. In the examples directory you can find many different examples to run various AI models locally or to use external providers.

Please also refer to the readme file in the examples directory.

If you want to get started quickly and run your AIs by yourself, please have a look at the ctransformers, gpt4all and huggingface_pipeline examples. 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 the aifilemaker.py script, which you can use as a starting point.

Updating

To update ownAI, simply pull the latest changes from the repository and run:

source venv/bin/activate
pip install -r requirements.txt
flask db upgrade

Run with Docker

If you have Docker installed, you can run ownAI in a Docker container. Otherwise please follow the installation section.

To run ownAI with Docker, first configure the server by downloading the .env.template file. Rename the file to docker.env and 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-file ./docker.env -p 5000:5000 ownai/ownai

This is only required for the first run. To start the server again just run:

docker start ownai

Contributing

We welcome contributions from the community. To contribute, please:

  1. Fork the repository
  2. Create a new branch for your feature or bugfix
  3. Commit your changes
  4. Open a pull request

Please follow the coding style guidelines and ensure your changes are well-documented. Thank you very much for your contribution!

License

ownAI is released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ownAI-0.3.0.tar.gz (267.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ownAI-0.3.0-py3-none-any.whl (262.4 kB view details)

Uploaded Python 3

File details

Details for the file ownAI-0.3.0.tar.gz.

File metadata

  • Download URL: ownAI-0.3.0.tar.gz
  • Upload date:
  • Size: 267.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for ownAI-0.3.0.tar.gz
Algorithm Hash digest
SHA256 adf2f24400f5cf22758e53bbd53efcd6be59de491b9fc08ce279ec87405df8a0
MD5 7175ede3a56515f941697342a574ebfa
BLAKE2b-256 4064132a456ab0021b407f0aebcc4b42a37f67cc3e3e35ac02bd12a4b6504a05

See more details on using hashes here.

File details

Details for the file ownAI-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ownAI-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 262.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for ownAI-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d02f00b5c8420bb7d544ae021ac763ed3f9953247cd737d6d70d315f379748c
MD5 574f163d27c637fd9b01c7a3deaa170c
BLAKE2b-256 8887101127220befb9dcaf7a0f428c03750fd5d02a9b2a12c894c34d05787846

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page