AI模型聚合管理中转分发系统,一个应用管理您的所有AI模型,支持将多种大模型转为统一格式调用,支持OpenAI、Claude、Gemini等格式,可供个人或者企业内部管理与分发渠道使用。

JustSong ab1f8a2bf4 Initial commit 2 years ago
.github ab1f8a2bf4 Initial commit 2 years ago
common ab1f8a2bf4 Initial commit 2 years ago
controller ab1f8a2bf4 Initial commit 2 years ago
middleware ab1f8a2bf4 Initial commit 2 years ago
model ab1f8a2bf4 Initial commit 2 years ago
router ab1f8a2bf4 Initial commit 2 years ago
web ab1f8a2bf4 Initial commit 2 years ago
.gitignore ab1f8a2bf4 Initial commit 2 years ago
Dockerfile ab1f8a2bf4 Initial commit 2 years ago
LICENSE ab1f8a2bf4 Initial commit 2 years ago
README.en.md ab1f8a2bf4 Initial commit 2 years ago
README.md ab1f8a2bf4 Initial commit 2 years ago
go.mod ab1f8a2bf4 Initial commit 2 years ago
go.sum ab1f8a2bf4 Initial commit 2 years ago
main.go ab1f8a2bf4 Initial commit 2 years ago

README.en.md

中文 | English

gin-template logo

# Gin Template _✨ Template for Gin & React projects ✨_

license release release GoReportCard

Download · Tutorial · Feedback · Demo

Features

  • Built-in user management.
  • Built-in file management.
  • GitHub OAuth.
  • WeChat official account authorization (need wechat-server).
  • Email verification & password reset.
  • Request rate limiting.
  • Static files caching.
  • Mobile friendly UI.
  • Token based authorization.
  • Use GitHub Actions to build releases & Docker images.
  • Cloudflare Turnstile user validation.

Deployment

Manual deployment

  1. Download built binary from GitHub Releases or build from source:

    git clone https://github.com/songquanpeng/gin-template.git
    go mod download
    go build -ldflags "-s -w" -o gin-template
    ````
    2. Run it:
    

    shell chmod u+x gin-template ./gin-template --port 3000 --log-dir ./logs ```

    1. Visit http://localhost:3000/ and login. The username for the initial account is root and the password is 123456.

    Deploy with Docker

    Execute: docker run -d --restart always -p 3000:3000 -v /home/ubuntu/data/gin-template:/data -v /etc/ssl/certs:/etc/ssl/certs:ro justsong/gin-template

    Data will be saved in /home/ubuntu/data/gin-template.

    Configurations

    The system works out of the box.

    You can configure the system by set environment variables or specify command line arguments.

    After the system starts, use root user to log in to the system and do further configuration.

    Environment Variables

    1. REDIS_CONN_STRING: when set, Redis will be used as the storage for request rate limitation instead of memory storage.
    2. Example: REDIS_CONN_STRING=redis://default:redispw@localhost:49153
    3. SESSION_SECRET: when set, a fixed session key will be used so that the logged-in users' cookie remains valid across system reboots.
    4. Example: SESSION_SECRET=random_string
    5. SQL_DSN: when set, the target SQL database will be used instead of SQLite.
    6. Example: SQL_DSN=root:123456@tcp(localhost:3306)/gin-template

    Command line Arguments

    1. --port <port_number>: specify the port number, the default value is 3000.
    2. Example: --port 3000
    3. --log-dir <log_dir>: specify the log dir, if not set, the log won't be saved.
    4. Example: --log-dir ./logs
    5. --version: print the version and exit.