mylxsw/aidea-server
AIdea 是一款支持 GPT 以及国产大语言模型通义千问、文心一言等,支持 Stable Diffusion 文生图、图生图、 SDXL1.0、超分辨率、图片上色的全能型 APP。
AIdea Server – What It Is
AIdea Server is an open‑source backend written in Go that powers the AIdea client app. It provides a self‑hostable API for chat‑style large language models (LLMs) and image‑generation models, exposing an OpenAI‑compatible REST interface so existing tools that speak the OpenAI protocol can call it directly.
Core Features
- Chat & Completion API – Wraps multiple LLM providers behind a unified OpenAI‑compatible endpoint, supporting streaming responses.
- Image Generation – Integrates popular image‑generation models (e.g., Stable Diffusion‑style services) through the same API surface.
- User & Billing Management – Built‑in token accounting, pricing tables, and payment integrations (Alipay, Apple, etc.) to monetize usage.
- Multi‑Channel Notifications – DingTalk bot, SMS (Alibaba Cloud, Tencent), and email alerts.
- Auxiliary AI Services – Text‑to‑speech (Qiniu), speech‑to‑text (Tencent), translation (Youdao).
- Task Queue & Scheduler – Asynchronous jobs (e.g., daily usage stats) run via an internal queue system.
- Rate Limiting & Security – JWT authentication, per‑user rate limits, and content‑safety checks via Alibaba Cloud services.
- OpenAI‑compatible API – Any third‑party client that understands the OpenAI API can talk to AIdea Server without modification.
Architecture & Code Layout
| Directory | Purpose |
|---|---|
api |
Implements the OpenAI‑compatible endpoints used by external tools. |
server |
Endpoints specific to the AIdea client application. |
cmd |
Main entry point (main.go). |
config |
Configuration structs and default config.yaml. |
pkg |
Public Go packages that can be imported by other projects. |
ai/ |
Provider‑specific model adapters (chat, image, etc.). |
repo/ |
Data‑access layer built on the in‑house Eloquent ORM (MySQL, etc.). |
service/ |
Business logic that doesn’t belong in controllers or repos. |
queue/ |
Simple task‑queue implementation with consumer workers. |
payment/, coins/ |
Billing, pricing tables, and virtual‑currency handling. |
misc, rate, token, uploader, … |
Utility modules (rate limiting, JWT, file upload, etc.). |
The project relies on two internal frameworks:
- Glacier Framework – a modular Go framework with dependency‑injection built on
go-ioc. - Eloquent ORM – a code‑generation‑based ORM inspired by Laravel, handling DB migrations and models.
Getting Started / Self‑Hosting
- Clone the repo and edit
config.yaml(or supply environment variables) to point to your database, Redis, and any AI provider keys. - Build:
go build -o build/debug/aidea-server cmd/main.go - Run the binary directly, or use the provided Docker deployment repo (
mylxsw/aidea-docker). - Optional – Follow the detailed guide in
docs/deploy.mdfor systemd or Nginx setup, or request assisted deployment viadocs/deploy‑vip.md.
A live demo instance is hosted at https://aidea.aicode.cc for quick testing.
Community & Support
- WeChat discussion group – QR code in the README; join by adding the ID
x-prometheus. - WeChat Official Account – Broadcasts and updates.
- GitHub – Issues and pull requests for the server, client, and Docker repo.
License
MIT – free for personal, academic, or commercial use.
TL;DR
AIdea Server is a Go‑based, self‑hostable backend that aggregates LLM and image‑generation services behind an OpenAI‑compatible API, adds user management, billing, and various notification channels, and can be deployed via Docker or directly on a Linux host.
Related
- Project
- Project
- Project
- Project