Installation Guide¶
文档版本: 1.0.0
最后更新: 2025-08-19
Git 提交: c1aa5b0f
作者: Lincoln
This guide will walk you through installing and setting up JAiRouter in your environment.
System Requirements¶
- Java: 17 or higher
- Memory: Minimum 512MB RAM (1GB recommended for production)
- Storage: At least 100MB free disk space
- Network: Access to your AI model services
Installation Methods¶
Method 1: Download Pre-built JAR (Recommended)¶
- Download the latest release from GitHub Releases
- Extract the archive to your desired directory
- Run the application:
Method 2: Build from Source¶
Clone the repository:
Build the project:
Run the application:
Method 3: Docker Deployment¶
Pull the Docker image:
Run the container:
Configuration¶
Basic Configuration¶
Create a configuration file application.yml
:
server:
port: 8080
model:
services:
chat:
load-balance:
type: round-robin
instances:
- name: "qwen2.5:7b"
baseUrl: "http://localhost:11434"
path: "/v1/chat/completions"
weight: 1
Environment Variables¶
You can override configuration using environment variables:
Configuration File Location¶
JAiRouter looks for configuration files in the following order:
./config/application.yml
(current directory)./application.yml
(current directory)classpath:application.yml
(embedded in JAR)
Verification¶
After starting JAiRouter, verify the installation:
Health Check:
API Documentation: Visit
http://localhost:8080/swagger-ui/index.html
in your browserService Status:
Troubleshooting¶
Common Issues¶
Port Already in Use:
Java Version Issues:
Memory Issues:
Log Files¶
Check the application logs for detailed error information:
# View logs in real-time
tail -f logs/jairouter.log
# Search for errors
grep ERROR logs/jairouter.log
Next Steps¶
Now that JAiRouter is installed and running, proceed to the Quick Start Guide to make your first API call.