Skip to content
/ UniAI Public
forked from uniai-lab/uniai-maas

One United API, Multiple AI models

Notifications You must be signed in to change notification settings

Mrkk1/UniAI

 
 

Repository files navigation

UniAI

Read this in Simplified Chinese (简体中文说明)

Framework

Overview

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.

Integrated Models

UniAI integrates several leading AI models, including:

Samples

Discover how UniAI is utilized and experience it firsthand:

wechat miniapps

System Requirements

Ensure you have the following NPM libs installed:

Getting Started

Configuration

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=

Installation Steps

Node-gyp Installation

npm -g install node-gyp

LibreOffice Installation

  • Ubuntu: sudo apt install libreoffice
  • Mac: brew install libreoffice

Node-Canvas Support

Using Yarn (Recommended over npm)

npm -g install yarn
yarn

Starting the Database

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

Running UniAI

Development Mode

  • Initializes the database.
yarn dev

Production Mode

  • Compile TypeScript files and start the application.
yarn tsc
yarn start

⚠️ Important: Avoid compiling TypeScript files in development mode. Use yarn clean before yarn dev if tsc was previously run.

Cleaning Up

yarn clean

Documentation

Access UniAI's APIs through common Web HTTP methods, including SSE. For detailed documentation, visit UniAI API Documentation.

Available Models

UniAI integrates various AI models, focusing on NLP and CV domains. Specific models need to be deployed independently. Download URLs and guides are provided.

NLP Models

  • OpenAI GPT, GLM/ChatGLM, IFLYTEK/SPARK

CV Models

  • OpenAI DALL-E, Stable Diffusion, MidJourney

Future Enhancements

UniAI is planning to expand its capabilities across:

  • Prediction APIs
  • Training APIs
  • Prompting APIs
  • Resource Management APIs

future features

Contributing

Contributions are welcome! For development-related queries, contact Youwei at huangyw@iict.ac.cn.

Powered by Egg.js TypeScript

About

One United API, Multiple AI models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.3%
  • HTML 3.7%