Powered by the eponymous node.js library uniai.
Simplified Chinese (简体中文说明) 🇨🇳
UniAI MaaS aims to implement a model as a service platform integrated multi AI models, allowing developers to focus on developing AI-related applications.
The platform supports a vector database, and an object storage service which enables users to upload, parse, and manage office files.
In addition to text generation models, it also offers multi-modal models such as image generation and recognition.
UniAI MaaS supports custom application development for integration with platforms like WeChat Mini Programs.
UniAI, powered by the node.js library of the same name uniai, provides seamless access and management of a diverse range of AI models and utilities. To incorporate UniAI into your project, you can install it via npm or Github.
Front end: https://github.com/uni-openai/lechat-pro
UniAI integrates multiple AI models, including:
- IFLYTEK/Spark
- THUDM/ChatGLM-6B
- ZHIPU/GLM
- MoonShot/moonshot
- OpenAI/GPT
- Baidu/WenXin workshop
- Google/Gemini
- Stability AI
- OpenAI/DALL-E
- Midjourney
Discover how UniAI is utilized and experience it firsthand:
To launch the mini app, use WeChat to scan the following QR code.
👍 We recommend: https://lechat.cas-ll.cn
- Multi-model Chat
- Office file upload and parse
- Image generation
- Image recognition
Ensure you have the following NPM
libs installed:
- Node.js (version >= 18) - 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:
# Platform default admin token
ADMIN_TOKEN=
# OPENAI GPT
OPENAI_API= # openai proxy
OPENAI_KEY= # openai key
# Google AI studio
GOOGLE_AI_API= # google proxy
GOOGLE_AI_KEY= # google key
# ZHIPU AI
# ZHIPU_AI_API= #zhipu proxy
ZHIPU_AI_KEY= # zhipu key
GLM_API= # local deployed glm6b
# SPARK
FLY_APP_ID= # iflytek app id
FLY_API_KEY= # ilfytek api key
FLY_API_SECRET= # iflytek api secret
# baidu wenxin workshop
# BAIDU_API=http://192.168.41.52:5300
BAIDU_API_KEY=
BAIDU_SECRET_KEY=
# Moonshot
# MOONSHOT_API=http://192.168.41.52:5400
MOONSHOT_KEY=
# Stable Diffusion
STABLE_DIFFUSION_API=
# Midjourney
MJ_API= # https://github.com/novicezk/midjourney-proxy
MJ_IMG_PROXY= # proxy to discord cdn images
MJ_TOKEN= # mj token
# stability ai
STABILITY_KEY=
# PostgreSQL database
DB_DIALECT=postgres
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASS=postgres
POSTGRES_DB=uniai
# Redis cache
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASS=redis
REDIS_DB=0
# WeChat
WX_APP_ID= # wechat miniapp id
WX_APP_SECRET= # wechat miniapp secret
WX_MCH_ID=
WX_PAY_PRIVATE=
WX_PAY_CERT=
WX_PAY_KEY=
# MINIO storage
MINIO_END_POINT=localhost
MINIO_ACCESS_KEY=
MINIO_SECRET_KEY=
MINIO_PORT=9000
MINIO_BUCKET=uniai
# gee code test
GEE_TEST_ID=
GEE_TEST_KEY=
# aliyun SMS account
ALI_KEY_ID=
ALI_KEY_SECRET=
ALI_SMS_TEMPLATE=
ALI_SMS_SIGN=
# For Docker start pgvector
POSTGRES_DATA_PATH=./data
# For Docker start Minio
MINIO_DATA_PATH=./data
MINIO_ROOT_USER=root
MINIO_ROOT_PASS=12345678
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
Sharp Support
yarn add sharp --ignore-engines
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
Youwei Huang huangyw@iict.ac.cn
Institute of Intelligent Computing Technology, Suzhou, CAS
Powered by Egg.js
Copyright (c) 2022-present, Youwei Huang