2026-08-15 08:35:36 +08:00
|
|
|
# 9Router MIBP Version
|
2026-04-29 11:34:39 +07:00
|
|
|
|
2026-08-15 08:35:36 +08:00
|
|
|
A local AI routing gateway with provider fallback and token-saving features. This is a fork of [decolua/9router](https://github.com/decolua/9router).
|
2026-07-05 17:45:04 +07:00
|
|
|
|
2026-08-15 08:35:36 +08:00
|
|
|
## Installation
|
2026-07-05 17:45:04 +07:00
|
|
|
|
2026-08-15 08:35:36 +08:00
|
|
|
### Option 1: Docker
|
2026-03-06 16:58:50 +07:00
|
|
|
|
2026-08-15 08:35:36 +08:00
|
|
|
Pull the image:
|
2026-08-07 12:48:39 +08:00
|
|
|
|
|
|
|
|
```bash
|
2026-08-15 08:35:36 +08:00
|
|
|
docker pull mhiqrambhrng/9router-mibp-version:latest
|
2026-08-07 12:48:39 +08:00
|
|
|
```
|
|
|
|
|
|
2026-08-15 08:35:36 +08:00
|
|
|
Run the container:
|
2026-05-13 18:22:31 +07:00
|
|
|
|
2026-01-20 13:16:34 +07:00
|
|
|
```bash
|
2026-08-15 08:35:36 +08:00
|
|
|
mkdir -p 9router-data
|
2026-05-13 18:22:31 +07:00
|
|
|
docker run -d \
|
|
|
|
|
--name 9router \
|
|
|
|
|
-p 20128:20128 \
|
2026-08-15 08:35:36 +08:00
|
|
|
-v 9router-data:/app/data \
|
2026-05-13 18:22:31 +07:00
|
|
|
-e DATA_DIR=/app/data \
|
2026-08-15 08:35:36 +08:00
|
|
|
-e PORT=20128 \
|
|
|
|
|
-e HOSTNAME=0.0.0.0 \
|
|
|
|
|
-e NODE_ENV=production \
|
|
|
|
|
-e JWT_SECRET=<generate-with-openssl-rand-hex-32> \
|
|
|
|
|
-e INITIAL_PASSWORD=<your-dashboard-password> \
|
|
|
|
|
-e API_KEY_SECRET=<generate-with-openssl-rand-hex-32> \
|
|
|
|
|
-e MACHINE_ID_SALT=<generate-with-openssl-rand-hex-32> \
|
|
|
|
|
mhiqrambhrng/9router-mibp-version:latest
|
2026-05-13 18:22:31 +07:00
|
|
|
```
|
|
|
|
|
|
2026-08-15 08:35:36 +08:00
|
|
|
Or using Docker Compose (a `docker-compose.yml` is included in this repo):
|
2026-05-13 18:22:31 +07:00
|
|
|
|
|
|
|
|
```bash
|
2026-08-15 08:35:36 +08:00
|
|
|
cp .env.example .env # fill in JWT_SECRET, INITIAL_PASSWORD, API_KEY_SECRET, MACHINE_ID_SALT
|
2026-08-06 03:11:31 +08:00
|
|
|
docker compose up -d
|
2026-06-20 10:09:50 +07:00
|
|
|
```
|
|
|
|
|
|
2026-08-15 08:35:36 +08:00
|
|
|
Dashboard opens at `http://localhost:20128/dashboard`.
|
2026-06-20 10:09:50 +07:00
|
|
|
|
2026-08-15 08:35:36 +08:00
|
|
|
### Option 2: Manual (from source)
|
|
|
|
|
|
|
|
|
|
Requirements: Node.js 22 or newer.
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
git clone https://github.com/mhiqrambg/9router-mibp-version.git
|
|
|
|
|
cd 9router-mibp-version
|
|
|
|
|
|
|
|
|
|
cp .env.example .env
|
|
|
|
|
# Edit .env: set JWT_SECRET, INITIAL_PASSWORD, API_KEY_SECRET, MACHINE_ID_SALT
|
|
|
|
|
|
|
|
|
|
npm install
|
|
|
|
|
|
|
|
|
|
# Development server
|
|
|
|
|
npm run dev
|
|
|
|
|
|
|
|
|
|
# Or production build
|
|
|
|
|
npm run build
|
|
|
|
|
npm run start
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Dashboard opens at `http://localhost:20128/dashboard`.
|
|
|
|
|
|
|
|
|
|
## More Information
|
|
|
|
|
|
|
|
|
|
- Upstream project: [https://github.com/decolua/9router](https://github.com/decolua/9router)
|
|
|
|
|
- Upstream docs: [DOCKER.md](DOCKER.md) • [ARCHITECTURE.md](docs/ARCHITECTURE.md)
|