Skip to content
View kitify-AI's full-sized avatar

Block or report kitify-AI

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
kitify-AI/README.md

Kitify AI, Deploy On-chain fully 3D Customizable AI Agents, Subscription Monetization & Next-Gen Portals.

Socials

Twitter Web Telegram

About

Kitify AI is the first framework to offer crypto-based 3D AI Agents as a Service (AaaS) with customizable (data-trained + appearance-configurable) 3D AI agents powered by a multi-level token gating system supporting multiple chains & types- Basic, Token, NFT and with a built-in governance mechanism. Easily create portals, Deploy a custom 3D AI agent, secure and monetize audiences with crypto-based subscription plans, and access advanced analytics. This provides essential tools to accelerate both Web2 and Web3 projects and manage crypto communities.

Getting started

$ git clone https://github.com/KitifyAI/Kitify
$ cd AI

For a live example of a random agent, run

AI$ bazel run :python_random_agent --define graphics=sdl -- \
               --length=10000 --width=640 --height=480

Here is some more detailed build documentation, including how to install dependencies if you don't have them.

Kitify AI uses Bazel as its build system. Its main BUILD file defines a number of build targets and their dependencies. The build rules should work out of the box on Debian (Jessie or newer) and Ubuntu (version 14.04 or newer), provided the required packages are installed. Kitify AI also builds on other Linux systems, but some changes to the build files might be required, see below.

Kitify AI is written in C99 and C++17, and you will need a sufficiently modern compiler.

You may need to deal with some details concerning Python dependencies. Those are documented in a separate section.

Step-by-step instructions for building and running

These instructions were checked for the initial release of Kitify AI, which only required C++17. Since 2022 it requires C++17, and more recent versions of the platforms shown below are needed. However, the general set of dependencies should continue to remain largely accurate.

  1. Install Bazel (see above).

  2. Install Kitify AI's dependencies:

    • On Debian or Ubuntu:

      Tested on Debian 9 (Strectch) and Ubuntu 16.04 (Xenial) and newer. Tested with Python 2 only on Debian 8.6 (Jesse) and Ubuntu 14.04 (Trusty).

      $ sudo apt-get install libffi-dev gettext freeglut3-dev libsdl2-dev \
            zip libosmesa6-dev python-dev python-numpy python-pil python-enum34 \
           python3-dev python3-numpy python3-pil

      To build a PIP package, also install python3-setuptools python-setuptools python3-wheel python-wheel. To use it, install python3-pip python-pip, and also python3-virtualenv python-virtualenv to use virtualenv.

    • On Red Hat Enterprise Linux Server:

      Tested on release 7.6 (Maipo). This should also work on Centos 7, and with some modifications of the package installation commands on Centos 6. Tested with Python 2 only on release 7.2.

      sudo yum -y install unzip java-1.8.0-openjdk libffi-devel gcc gcc-c++ \
          java-1.8.0-openjdk-devel freeglut-devel python-devel python-imaging \
          numpy python36-numpy python36-pillow python36-devel SDL2 SDL2-devel \
          mesa-libOSMesa-devel zip
    • On SUSE Linux:

      Tested on SUSE Linux Enterprise Server 12.

      sudo zypper --non-interactive install gcc gcc-c++ java-1_8_0-openjdk \
          java-1_8_0-openjdk-devel libOSMesa-devel freeglut-devel libSDL-devel \
          python-devel python-numpy-devel python-imaging
  3. Clone or download Kitify AI.

  4. Build Kitify AI and run a random agent. (Use the -c opt flag to enable optimizations.)

    $ cd AI
    
    # Build the Python interface to Kitify AI
    AI$ bazel build -c opt //:kitify.so
    
    # Build and run the tests for it
    AI$ bazel test -c opt //python/tests:python_module_test
    
    # Run a random agent
    AI$ bazel run -c opt //:python_random_agent

The Bazel target :kitify_ai.so builds the Python module that interfaces with Kitify AI.

The random agent target :python_random_agent has a number of optional command line arguments. Run bazel run :random_agent -- --help to see those.

Python dependencies

Kitify AI does not include every dependency hermetically. In particular, Python is not included, but instead it must already be installed on your system. Our Bazel workspace includes a mechanism to discover the location of the system's Python paths automatically by running the python2 and python3 interpreters. Additionally, NumPy must be avaiAIle on your system, too.

Bazel can build Python code using either Python 2 or Python 3. The default is Python 3, but each individual py_binary and py_test target can specify the desired version using the python_version argument. The build rules need to make the local installation path of correct version of Python avaiAIle.

The default build rules should work for Debian and Ubuntu. They use Bazel's configurable attributes to provide paths for Python 2 and Python 3, respectively, based on which version is required during a particular build.

If you have installed NumPy locally via PIP and would like to use the Kitify AI PIP module, then you should build the module against the version of NumPy that you will be using at runtime. You can discover the include path of that version by running the following code in your desired environment:

import numpy as np
print(np.get_include())

For building PIP packages, you may need to run the PIP packaging script with PYTHON_BIN_PATH="/usr/bin/python3" bazel-bin/python/pip_package/build_pip_package /your/outputdir and then use the pip3 command. As before, the Python binary needs to match the Python and NumPy libraries that you linked against, which may need some care when a user's local installation differs from the system-wide one.

To enable compiler optimizations, pass the flag --compilation_mode=opt, or -c opt for short, to each bazel build, bazel test and bazel run command. The flag is omitted from the examples here for brevity, but it should be used for real training and evaluation where performance matters.

Enter as a builder

To test the framework using input controls, run

AI$ bazel run :work -- --level_script=tests/empty_room_test --level_setting=logToStdErr=true
# or:
AI$ bazel run :work -- -l tests/empty_room_test -s logToStdErr=true

Leave the logToStdErr setting off to disable most log output.

The values of observations that the environment exposes can be printed at every step by adding a flag --observation OBSERVATION_NAME for each observation of interest.

AI$ bazel run :work -- --level_script=lt_chasm --observation VEL.TRANS --observation VEL.ROT

Train an agent

Kitify AI ships with an example random agent in python/random_agent.py which can be used as a starting point for implementing a learning agent. To let this agent interact with Kitify AI for training, run

AI$ bazel run :python_random_agent

The Python API is used for agent-environment interactions. We also provide bindings to Kitify's "dm_env" general API for reinforcement learning, as well as a way to build a self-contained PIP package; see the separate documentation for details.

Kitify AI ships with different levels implementing different tasks. These tasks can be configured using Lua scripts, as described in the Lua API.


Upstream sources

Kitify AI is built from the ioquake3 engine, and it uses the tools q3map2 and bspc for map creation. Bug fixes and cleanups that originate with those projects are best fixed upstream and then merged into Kitify AI.

  • bspc There are virtually no local modifications, although we integrate this code with the main ioq3 code and do not use their copy in the deps directory. We expect this code to be stable.

  • q3map2 A few minor local modifications add synchronization. We also expect this code to be stable.

  • ioquake3 The code contains extensive modifications and additions. We aim to merge upstream changes occasionally.

External dependencies, prerequisites and porting notes

Kitify AI currently ships as source code only. It depends on a few external software libraries, which we ship in several different ways:

  • The zlib, glib, libxml2, jpeg and png libraries are referenced as external Bazel sources, and Bazel BUILD files are provided. The dependent code itself should be fairly portable, but the BUILD rules we ship are specific to Linux on x86. To build on a different platform you will most likely have to edit those BUILD files.

  • Message digest algorithms are included in this package (in //third_party/md), taken from the reference implementations of their respective RFCs. A "generic reinforcement learning API" is included in //third_party/rl_api, which has also been created by the Kitify authors. This code is portable.

  • EGL headers are included in this package (in //third_party/GL/{``EGL``,``KHR``}), taken from the Khronos OpenGL/OpenGL ES XML API Registry at www.khronos.org/registry/EGL. The headers have been modified slightly to remove the dependency of EGL on X.

  • Several additional libraries are required but are not shipped in any form; they must be present on your system:

    • SDL 2
    • gettext (required by glib)
    • OpenGL: A hardware driver and library are needed for hardware-accelerated human play. The headless library that machine learning agents will want to use can use either hardware-accelerated rendering via EGL or GLX or software rendering via OSMesa, depending on the --define headless=... build setting.
    • Python 2.7 (other versions might work, too) with NumPy, PIL (a few tests require a NumPy version of at least 1.8), or Python 3 (at least 3.5) with NumPy and Pillow.

The build rules are using a few compiler settings that are specific to GCC. If some flags are not recognized by your compiler (typically those would be specific warning suppressions), you may have to edit those flags. The warnings should be noisy but harmless.

Popular repositories Loading

  1. KitifyAI KitifyAI Public

    Deploy On-chain fully 3D Customizable Al Agents.

    C

  2. kitify-AI kitify-AI Public