1. AI creation system
The SparkAi creation system is an Ai intelligent question and answer system and Midjourney painting system developed based on ChatGPT. It supports the OpenAI-GPT full model + the domestic AI full model. The overall test of the source code system in this issue is very perfect. It can be said that SparkAi is currently the only domestic ChatGPT docking OpenAI software system. So how to build and deploy AI creation ChatGPT? Let me write a detailed graphic tutorial here! This system uses Nestjs+Vue+Typescript framework technology to continuously integrate AI capabilities into this system. Supports GPT-4-Turbo model, supports DALL-E3 Vincentian graph, supports the latest GPT-4-Turbo model, GPT-4-1106-Preview multi-modal model. Supports GPT-4 picture conversation capability to upload pictures and understand pictures and understand conversations.
"SparkAi system details and construction and deployment documents":
https://www.yuque.com/yuqueyonghutq9yt2/egy0d0/ah9sq89lgl6b7s4w
OpenAI GPT full model + domestic AI full model
Added support for Dall-E3 painting (can directly communicate with Wenshengtu)
Added the ability to support GPT-4 picture dialogue, upload pictures and understand the dialogue through image recognition
Can support 5 pictures uploaded to the conversation at the same time
1.1 AI model questions
1.2 AI painting
Midjourney partial redraw (Vary Region) online editing function
1.3 Core functions of the program
Already supports OpenAI GPT full model + domestic AI full model + Midjourney painting pool system!
AI questioning: The program already supports GPT3.5, GPT4.0 questioning, OpenAIGPT full model + domestic AI full model, and supports GPT online questioning
It has supported the OpenAIGPT full model + the domestic AI full model, and has supported the domestic AI models Baidu Wenxinyiyan, Microsoft Azure, Alibaba Cloud Tongyi Qianwen model, Tsinghua Zhipu AIChatGLM, iFlytek Spark model, and Tencent Hunyuan model wait!
AI painting: Midjourney painting (fully customized parameter adjustment), Midjourney drawing from pictures, Dall-E3 painting
Supports the latest GPT-4 multi-modal model, OpenAI GPT-4-Turbo-With-Vision-128K model
SupportGPT-4 picture dialogue capability (upload pictures and recognize them to understand the dialogue)
Added new support for dialogue plug-in system, and will gradually add plug-in functions to expand AI capabilities.
The new KEY supports independent configuration of consumption rates. For example, GPT4-32K is more expensive than GPT4 and should consume more quotas.
WeChat official account + email + mobile number registration and login
One-click intelligent mind map generation
Application Square supports users to customize the front-end to add private or shared
AI Painting Square (Gallery)
Invitation + agent distribution model, user daily check-in function
Session records are saved synchronously
Supports docking with WeChat official payment, Yipay, code payment, Hupijiao payment, etc.
Customized aggregated membership packages and card secret systems
Other core features
Other free version feature updates will follow.
1.4 Update log
SparkAi latest major version update log:
【V3.3.1】Update function (updated on November 24, 2023)
Added support for GPT-4-Turbo-Vision plug-in
Added support for GPT-4 image dialogue capabilities (upload images and recognize images to understand the dialogue), which can support up to 5 images being uploaded simultaneously for dialogue.
OpenAI DALL-E3 has optimized dialogue format and picture size ratio, and the effect is consistent with OpenAI PLUS
Optimize and merge the billing method of DALL-E3 and GPT-4-Turbo-Vision into GPT-4-Turbo, just configure the gpt-4-1106-Preview model.
Added the setting of the number of concurrent executions of the MJ painting system. The number of concurrent executions of the system can be set in the background.
Added Alibaba Cloud OSS storage that can be configured with custom domain names so that users can directly preview images
Added a new large model Agent agent to multiple plug-ins to call processing tasks and summarize the returned results.
Fix GPT networking question failure and instability issues (new networking functions will be developed later to control the networking module)
Optimize the timeout of MJ's single painting query to 4 minutes to deal with the problem that MJ's official slow painting is too slow and may cause painting failure.
Fixed the problem that the painting storage does not use the Discord-CND proxy of the painting pool, causing storage failure in some cases.
The new DALL-E3 Vincentian Diagram continuous dialogue allows you to put forward modification opinions on the same picture. The calling timing of the DALL-E3 Vincentian Diagram plug-in is dynamically selected by the large model to understand user questions. Synchronized with OpenAI, supports gpt-4, gpt-4-1106-preview, gpt-4-0613, gpt-3.5-turbo, gpt-3.5-turbo-1106, gpt-3.5-turbo-0613 model calling.
2. System module demonstration
2.1 Quick experience
SparkAi official demo site:
Management backend:
https://ai.sparkaigf.com/sparkai/admin
Test account: admin, 123456
2.2 System documentation
If you cannot access, please check "SparkAi system details and construction and deployment documents" to get the latest address.
3. System function modules
3.1 ChatGPT model questions
Support GPT networking to ask questions
3.2 Prompt application
3.2.1 Prompt application
3.2.2 Custom Prompt application
Support user-defined Prompt applications
3.3 Support Midjourney painting
-
Supports synchronized official image regeneration instructions
-
Synchronize the official Vary command to enhance the contrast of a single image Vary(Strong) | Vary(Subtle)
-
Synchronize with the official Zoom command to infinitely zoom a single picture Zoom out 2x | Zoom out 1.5x
-
Added Midjourney partial redraw (Vary Region) online editing function
3.3.2 Use pictures to create pictures
3.4 Dall-E3 painting (can directly communicate with Wenshengtu)
3.5 Mind mind map generation
3.6 AI Gallery
3.7 AI system management (part)
There are too many functions in other and backend pages, so they will not be displayed. Directly access the demo site and demo backend.
4. Build and deploy tutorial
4.1 Basic env environment configuration
In the code, we provide a basic environment variable file configuration fileenv.example. Before using it, remove the suffix and change it to .env file is enough. We only need to configure the following things in the env environment configuration file.
Authorization code authorization ip configuration
Mail service configuration
mysql database These three items are basic configurations. Mysql and authorization are necessary. Only when mysql and authorization are configured can the project be started successfully. The mail service can be added later.
4.2 env file code
# 服务器ip
SPARK_AI_HOST=
# 授权码
SPARK_AI_KEY=
# mysql
DB_HOST=localhost
DB_PORT=3306
DB_USER=数据库用户名
DB_PASS=数据库密码
DB_DATABASE=数据库名
DB_LOG=false
DB_SYNC=true
# mailer 邮件服务
MAILER_HOST=smtp.163.com
MAILER_PORT=465
MAILER_USER=发信邮箱
MAILER_PASS=邮箱发信密钥
MAILER_FROM=发信邮箱
# Redis
REDIS_PORT=6379
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=
REDIS_DB=0
# jwt token
JWT_SECRET=chat-spark
# jwt token 过期时间
JWT_EXPIRESIN=7d
# 接口文档前缀
SWAGGERPREFIX=/docs
# 自定义端口
PORT=9520
5. Environment installation
Preconditions:
Domestic or overseas servers are available, the minimum configuration is2H2G, it is recommended2H4G Even higher
Pagoda installed successfully
Required environment:
Nginx >= 1.19.8
MySQL >= 5.7 or MySQL 8.0
PHP-7.4 (optional)
PM2 Manager >=5.5
Redis 7.0.11
Node version:>=16.19.1
5.1 Node version
Use PM2 to switch Node versions (required)
Changing Node version:v16.19.1
5.2 Install pnpm module
5.3 Install Redis
6. Deploy and run
6.1 Create a new site
Enter Pagoda - > Website -> Add site
6.2 Turn on HTTPS
6.2.1 Use your own ssl certificate
6.2.2 Let's Encrypt certificate application
If you do not have your own domain name certificate, use the Pagoda free certificate and apply for it Let's Encrypt
6.3 Upload SparkAi system source code
Delete the default files generated by the pagoda creation site
Upload and decompress the program compressed package to the root directory of the website
6.3.1 Configure .env file
Double-click directly in the pagoda .env.example to edit the file, or edit in terminal vim
After the configuration is completed, delete the file suffix and the file name is .env
6.3.2 Check and verify Node related environment
At this time, open the terminal again and determine whether we need a node-related environment.
node -v
npm -v
pnpm -v
6.4 Start the project
6.4.1 Open port
Pagoda panel security open9520 port and3306 port
6.4.2 Install dependencies
Use the terminal to switch to the website directory
cd /www/wwwroot/网站目录
Or enter the ssh terminal directly in the root directory of the website
Use pnpm i command to install dependencies
pnpm i
6.4.3 Start the project
Start the project using the pnpm start command
pnpm start
6.4.4 View startup log
Enter pm2 log to view the detailed log. If you see the picture below, it means success!
pm2 log
6.4.5 Add reverse proxy
Add 9520 port reverse proxy. Pagoda Security needs to open this port, otherwise it will not be accessible
7. Use the system
Deployment completed! Now you can access the system through the domain name
7.1 Management background
The default front-end address is the domain name address. The default back-end address is: https://domain name address/sparkai/admin
The default super administrator account is super, spark123
7.2 Modify the default password of the super administrator
After logging in, please change the default password of the super administrator first.
7.3 Construction completed
8. Backend configuration & system version update
8.1 Backend configuration
For system configuration tutorials and other tutorials, please go to the system details deployment document or the original tutorial on the blog
8.2 System version update
For system version update tutorial, please go to the system details deployment document or the original blog tutorial