JAiRouter 是 AI Skill Hub 本期精选AI工具之一。综合评分 8.5 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
基于Spring Boot的AI模型服务路由和负载均衡网关
JAiRouter 是一款基于 Java 开发的开源工具,专注于 ai、java、llm 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
基于Spring Boot的AI模型服务路由和负载均衡网关
JAiRouter 是一款基于 Java 开发的开源工具,专注于 ai、java、llm 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 克隆仓库 git clone https://github.com/Lincoln-cn/JAiRouter cd JAiRouter # 查看安装说明 cat README.md # 按 README 完成环境依赖安装后即可使用
# 查看帮助 jairouter --help # 基本运行 jairouter [options] <input> # 详细使用说明请查阅文档 # https://github.com/Lincoln-cn/JAiRouter
# jairouter 配置说明 # 查看配置选项 jairouter --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export JAIROUTER_CONFIG="/path/to/config.yml"
<p align="center"> <img src="logo/JAiRouterLogo.png" alt="JAiRouter — AI Model Gateway" width="180"> </p>
<p align="center"> <strong>One OpenAI-compatible endpoint in front of every model backend you run.</strong> </p>
<p align="center"> Ollama · vLLM · GPUStack · Xinference · LocalAI · OpenAI · Claude · Gemini<br> Routing · load balancing · rate limiting · circuit breaking · failover · RBAC · audit · visual console </p>
<p align="center"> <a href="https://github.com/Lincoln-cn/JAiRouter/releases"> <img src="https://img.shields.io/github/v/release/Lincoln-cn/JAiRouter?style=flat-square" alt="Latest release"> </a> <a href="https://hub.docker.com/r/sodlinken/jairouter"> <img src="https://img.shields.io/docker/pulls/sodlinken/jairouter?style=flat-square&logo=docker" alt="Docker Pulls"> </a> <a href="https://github.com/Lincoln-cn/JAiRouter/blob/master/LICENSE"> <img src="https://img.shields.io/github/license/Lincoln-cn/JAiRouter?style=flat-square" alt="License"> </a> </p>
<p align="center"> <a href="README-ZH.md">中文</a> • <a href="https://jairouter.com">Docs</a> • <a href="https://github.com/Lincoln-cn/JAiRouter/issues">Issues</a> • <a href="https://github.com/Lincoln-cn/JAiRouter/discussions">Discussions</a> </p>
This README is written to be read by people and AI agents alike: the facts block below and the Repository map / Commands / HTTP surfaces sections are the machine-actionable core. Where the code and this file disagree, the code wins — please open an issue so we can fix the file.
product: JAiRouter
repository: Lincoln-cn/JAiRouter
checkout_dir: model-router # the local/git directory name differs from the product name
artifact: model-router # Maven artifactId
project_version: 3.5.3 # pom.xml
latest_release: v3.5.3 (2026-10-25)
stack:
backend: Java 17 + Spring Boot 3.5.5 (WebFlux / reactive)
frontend: Vue 3 + TypeScript + Vite, bilingual zh-CN / en-US
build: Maven wrapper — ./mvnw (Unix) · .\mvnw.cmd (Windows)
runtime:
default_port: 8080
console: /admin/
swagger_ui: dev profile only
required_env_in_prod: [JWT_SECRET, INITIAL_ADMIN_PASSWORD]
surfaces:
- /v1/** # client surface: OpenAI-native + Anthropic-compatible
- /api/** # management + legacy surface (RBAC-governed)
- /actuator/** # health, readiness, Prometheus
tests:
command: ./mvnw test -o
scale: ~4,100 test methods across ~400 test classes
license: Apache-2.0
Implemented and exercised by the test suite:
- Adapters — Ollama, vLLM, GPUStack, Xinference, LocalAI, OpenAI, Anthropic (native), Gemini (native), plus any OpenAI-compatible provider declared in adapter-definitions. - Load balancing — round-robin, weighted, least-connections, IP hash, consistent hash, EWMA latency-aware, random. - Rule engine — conditional routing on model, service type, header, client IP, weight and instance tags, with hit statistics; visual editing in the console. - Resilience — circuit breaker per instance, request-level failover to another healthy instance, rate limiting (token bucket / leaky bucket / sliding window), response cache for deterministic requests (opt-in, tenant-isolated keys). - Quota — multi-dimensional, multi-window ledger (MINUTE/HOUR/DAY/MONTH) with Redis distributed counting and local fallback (jairouter.quota.enabled, off by default). - Record governance — call history at three levels: metadata only, desensitized summary, or AES-256-GCM-encrypted full content; ADMIN-only decryption endpoint. - Observability — Prometheus metrics, OpenTelemetry tracing, slow-query analysis, error tracking, security alerts. Alert outlets are deliberately limited to Prometheus metrics + structured logs — the repository implements no push channels (email/webhook/IM); wire those up in Alertmanager or your log platform. - Persistence — H2 by default; PostgreSQL (with Flyway migrations) when DATABASE_URL points at it; Redis for shared state in multi-replica deployments. - Multi-replica — cross-replica event broadcast, shared rate-limit/quota counters, and a distributed lock for scheduled tasks (including the alert cooldown). - Console — Vue 3 SPA at /admin/: services, instances, adapters, rules, versions & rollback, quota, call history, tracing, alerts, API keys, RBAC, dark/light theme, zh-CN / en-US.
Deliberately not implemented: semantic (vector-similarity) cache and any in-repo notification delivery. See Status and recent work for the open ledger.
./mvnw clean package -DskipTests
cd frontend && npm ci && npm run type-check && npm run build ```
Windows: substitute .\mvnw.cmd for ./mvnw.
JAiRouter 是一个专为 AI 模型服务设计的统一网关。它能够通过一行代码快速接入 Ollama、vLLM、GPUStack 等多种主流模型服务,为开发者提供标准化的模型访问入口,简化了多模型环境下的管理复杂度。
JAiRouter 提供强大的功能矩阵:完全兼容 OpenAI 协议,所有 `/v1/*` 接口均可直接使用 OpenAI SDK 调用;内置高级负载均衡算法,支持 Round-robin、Weighted、Least-connections、IP-hash 及 Consistent-hash;具备完善的流量控制能力,支持 Token bucket、Leaky bucket 和 Sliding window 算法进行 Rate Limiting;同时集成 Circuit Breaker 熔断机制,实现自动故障转移(Failover)与身份验证管理。
您可以通过多种方式部署 JAiRouter。推荐使用 Docker 进行快速部署:运行 `docker run -d --name jairouter -p 8080:8080 sodlinken/jairouter:latest`;或者使用 Docker Compose,通过下载官方提供的 `docker-compose.yml` 文件并执行 `docker compose up -d` 启动;若需从源码构建,请使用 `git clone` 克隆仓库后,通过 Maven 进行编译打包。
通过 Quick Start 章节,您可以快速了解如何启动 JAiRouter 并将其配置为您的 AI 模型代理服务,实现从零到接入模型的极速体验。
您可以通过 Web Console 或 API 接口来配置您的第一个服务。JAiRouter 支持灵活的服务定义,确保您可以轻松管理后端不同的模型提供商及其对应的访问凭证。
JAiRouter 完美兼容 OpenAI API 标准。在调用时,只需将 OpenAI SDK 的 `base_url` 指向 JAiRouter 的地址(如 `http://localhost:8080/v1`),并将 `api_key` 设置为任意值即可。系统会自动处理底层的路由与鉴权逻辑,让您像调用 OpenAI 一样调用本地或私有部署的模型。
高质量的AI模型服务路由和负载均衡网关
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
经综合评估,JAiRouter 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | JAiRouter |
| 原始描述 | 开源AI工具:JAiRouter is a Spring Boot based model service routing and load balancing gatewa。⭐9 · Java |
| Topics | aijavallmmaasmodelasservice |
| GitHub | https://github.com/Lincoln-cn/JAiRouter |
| License | Apache-2.0 |
| 语言 | Java |
收录时间:2026-05-19 · 更新时间:2026-05-30 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。