2026-08-06 03:11:31 +08:00
|
|
|
# 9Router - FREE AI Router & Token Saver
|
2026-04-29 11:34:39 +07:00
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
9Router is a local AI routing gateway with provider fallback and token-saving features.
|
2026-07-05 17:45:04 +07:00
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
## Quick Start
|
2026-07-05 17:45:04 +07:00
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
### Install
|
2026-03-06 16:58:50 +07:00
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
#### Docker
|
2026-01-05 09:58:59 +07:00
|
|
|
|
|
|
|
|
```bash
|
2026-08-06 03:11:31 +08:00
|
|
|
cp .env.example .env
|
|
|
|
|
docker compose up -d
|
2026-01-05 09:58:59 +07:00
|
|
|
```
|
|
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
Dashboard: `http://localhost:20128/dashboard`
|
2026-01-31 13:44:19 +07:00
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
API endpoint: `http://localhost:20128/v1`
|
2026-02-04 11:38:27 +07:00
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
#### From Source
|
2026-02-06 22:41:39 +00:00
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
cp .env.example .env
|
|
|
|
|
npm install
|
|
|
|
|
PORT=20128 NEXT_PUBLIC_BASE_URL=http://localhost:20128 npm run dev
|
|
|
|
|
```
|
|
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
Before starting, set at least `JWT_SECRET` and `INITIAL_PASSWORD` in `.env`.
|
|
|
|
|
|
|
|
|
|
### Update
|
|
|
|
|
|
|
|
|
|
This fork follows `decolua/9router` through the `upstream` remote.
|
2026-02-06 22:41:39 +00:00
|
|
|
|
|
|
|
|
```bash
|
2026-08-06 03:11:31 +08:00
|
|
|
git fetch upstream
|
|
|
|
|
git checkout master
|
|
|
|
|
git merge upstream/master
|
|
|
|
|
git push origin master
|
2026-02-06 22:41:39 +00:00
|
|
|
```
|
|
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
To build and publish this fork's Docker image after updating the source:
|
2026-06-20 10:09:50 +07:00
|
|
|
|
|
|
|
|
```bash
|
2026-08-06 03:11:31 +08:00
|
|
|
git tag v1.0.0
|
|
|
|
|
git push origin v1.0.0
|
2026-06-20 10:09:50 +07:00
|
|
|
```
|
|
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
The GitHub Actions workflow builds and publishes:
|
2026-06-20 10:09:50 +07:00
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
```text
|
|
|
|
|
mhiqrambhrng/9router-mibp-version
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
On the server, update the running container with:
|
2026-06-20 10:09:50 +07:00
|
|
|
|
|
|
|
|
```bash
|
2026-08-06 03:11:31 +08:00
|
|
|
docker compose pull 9router
|
|
|
|
|
docker compose up -d
|
2026-06-20 10:09:50 +07:00
|
|
|
```
|
|
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
## Forks (9Router)
|
2026-06-20 10:09:50 +07:00
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
- [9Router upstream](https://github.com/decolua/9router)
|
|
|
|
|
- [9Router MIBP Version](https://github.com/mhiqrambg/9router-mibp-version)
|
2026-06-20 15:08:11 +07:00
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
## License
|
2026-06-20 15:08:11 +07:00
|
|
|
|
2026-08-06 03:11:31 +08:00
|
|
|
MIT License. See [LICENSE](LICENSE) for details.
|