Home | Documentation | Feedback
AI-native application framework and runtime. Simply write a YAML file.
? Ready-to-use AI chatbot UI.
Dependencies
Features
Welcome to Aify, the AI-native application framework and runtime that allows you to ship your AI applications in seconds! With Aify, you can easily build and deploy AI-powered applications using a simple YAML file. In this guide, we will walk you through the steps to get started with Aify and create your first AI application.
To begin, make sure you have the following prerequisites installed on your system:
Once you have the prerequisites, you can install Aify by running the following command in your terminal:
pip install aify
You need to prepare a directory for your applications:
mkdir ./apps
Now you can start the aify service and then access http://localhost:2000 using a browser, and aify will greet you.
aify run ./apps
Now it's just a blank application, you can't use it for anything. Next, we will create a chatbot.
Creating a YAML file aify uses a YAML file to define your AI application. This file contains all the necessary configurations and settings for your application. Here's an example of a basic YAML file:
title: Chatbot
model:
vendor: openai
name: gpt-3.5-turbo
params:
api_key: <YOUR_OPENAI_API_KEY>
prompt: |
{{#system~}}
You are a helpful and terse assistant.
{{~/system}}
{{#each (memory.read program_name session_id n=3)}}
{{~#if this.role == 'user'}}
{{#user~}}
{{this.content}}
{{~/user}}
{{/if~}}
{{~#if this.role == 'assistant'}}
{{#assistant~}}
{{this.content}}
{{~/assistant}}
{{/if~}}
{{~/each}}
{{#user~}}
{{prompt}}
{{memory.save program_name session_id 'user' prompt}}
{{~/user}}
{{#assistant~}}
{{gen 'answer' temperature=0 max_tokens=2000}}
{{memory.save program_name session_id 'assistant' answer}}
{{~/assistant}}
variables:
- name: prompt
type: input
- name: answer
type: output
Here are some simple explanations about this YAML file:
Now go back to your browser and refresh the page. You will see the application you just created. You can have some conversations with it, just like ChatGPT.
Although aify provides a chatbot interface, its main purpose is not to provide a replacement for ChatGPT or a competitive conversation application.
The chatbot UI is only for convenient debugging of AI applications. Of course, you can indeed use it as a chatbot for daily use.
The main goal of aify is to provide an efficient framework for developing and deploying AI applications.
If your goal is to develop your own complex AI applications, you should pay more attention to the APIs and extension mechanisms provided by aify.
More examples: https://github.com/shellc/aify/tree/main/examples