Read this in Simplified Chinese (简体中文说明)
UniAI, a unified API-based platform, streamlines interactions with diverse and complex AI models.
UniAI integrates a range of AI models and utilities to facilitate easier access and management.
UniAI integrates several leading AI models, including:
- IFLYTEK/Spark
- THUDM/ChatGLM-6B
- ZHIPU/ChatGLM-Turbo
- OpenAI/GPT
- Stable Diffusion
- OpenAI/DALL-E
- Midjourney
Discover how UniAI is utilized and experience it firsthand:
Ensure you have the following NPM
libs installed:
- Node.js (version 16 or higher) - nvm Installation Guide
- Docker & Docker-compose
- LibreOffice for document conversion (libreoffice-convert)
- pdf-to-img (canvas-node) - Canvas NPM Package
Create an .env
file at the project root path:
touch ./.env
Fill the .env
file with the following environment variables:
# Application Configuration
ADMIN_TOKEN= # Default admin token, can be modified in config table
# OPENAI GPT Configuration
OPENAI_API=http://8.214.93.3 # OpenAI API URL or proxy
OPENAI_KEY= # OpenAI API key
# GLM Configuration
GLM_LOCAL_API=http://10.144.1.2:8100
GLM_REMOTE_API_KEY=
# iFlyTek SPARK
FLY_APP_ID=
FLY_API_KEY=
FLY_API_SECRET=
# baidu wenxin workshop
BAIDU_API_KEY=
BAIDU_SECRET_KEY=
# PostgreSQL Database Configuration
DB_DIALECT=postgres
POSTGRES_HOST=localhost # PostgreSQL host URL
POSTGRES_PORT=5432 # PostgreSQL port
POSTGRES_USER=postgres # PostgreSQL user
POSTGRES_PASS=postgres # PostgreSQL password
POSTGRES_DB=uniai # PostgreSQL database name
# For Docker start pgvector
POSTGRES_DATA_PATH=./data
# Redis Cache Configuration
REDIS_HOST=localhost # Redis cache host URL
REDIS_PORT=6379 # Redis cache port
REDIS_PASS=redis
REDIS_DB=0
# WeChat Configuration
WX_APP_ID= # WeChat app ID
WX_APP_SECRET= # WeChat app secret
# MINIO Storage Configuration
MINIO_ACCESS_KEY=
MINIO_SECRET_KEY=
MINIO_END_POINT=localhost
MINIO_PORT=9000
MINIO_BUCKET=uniai
# For Docker start Minio
MINIO_DATA_PATH=./data
MINIO_ROOT_USER=root
MINIO_ROOT_PASS=12345678
# Stable Diffusion Configuration
STABLE_DIFFUSION_API=http://10.144.1.7:3400
# Mid Journey Configuration
MID_JOURNEY_API= # Visit https://github.com/novicezk/midjourney-proxy
MID_JOURNEY_TOKEN= # MidJourney proxy token
# GeeTest
GEE_TEST_ID=
GEE_TEST_KEY=
Node-gyp Installation
npm -g install node-gyp
LibreOffice Installation
- Ubuntu:
sudo apt install libreoffice
- Mac:
brew install libreoffice
Node-Canvas Support
- Reference: Canvas NPM Documentation
- Install dependencies as per your operating system.
Using Yarn (Recommended over npm)
npm -g install yarn
yarn
For databases like PostgresSQL (pgvector), Docker and Docker-compose can be used for setup:
sudo apt install docker.io docker-compose
Docker Commands for Database Services
- Start pgvector:
yarn docker up pgvector
- Start Redis:
yarn docker up redis
- Start Minio (local OSS):
yarn docker up minio
Important Notes
- Ensure proper permissions for Docker volumes.
- Configure Minio after Docker initialization.
- Default Docker settings are available in
.env
.
Minio Access:
- URL:
http://localhost:9000
- Default Username:
root
- Default Password:
12345678
Development Mode
- Initializes the database.
yarn dev
Production Mode
- Compile TypeScript files and start the application.
yarn tsc
yarn start
yarn clean
before yarn dev
if tsc
was previously run.
yarn clean
Access UniAI's APIs through common Web HTTP methods, including SSE. For detailed documentation, visit UniAI API Documentation.
UniAI integrates various AI models, focusing on NLP and CV domains. Specific models need to be deployed independently. Download URLs and guides are provided.
- OpenAI GPT, GLM/ChatGLM, IFLYTEK/SPARK
- OpenAI DALL-E, Stable Diffusion, MidJourney
UniAI is planning to expand its capabilities across:
- Prediction APIs
- Training APIs
- Prompting APIs
- Resource Management APIs
Contributions are welcome! For development-related queries, contact Youwei at huangyw@iict.ac.cn.
Powered by Egg.js TypeScript