Commit 5747465
authored
feat: add /var/log/proxy mount and CLI parameters for non-interactive mode (#229)
* feat: add /var/log/proxy mount and CLI parameters for non-interactive mode
1. Mount /var/log/proxy from container to $DATA_FOLDER/logs on host
- Enables access to gateway access logs for external monitoring
- Useful for token tracking and session analysis
2. Add comprehensive CLI parameters for non-interactive configuration:
- --non-interactive/--batch: Run in batch mode without prompts
- Port configuration: --http-port, --https-port, --console-port
- Container options: --container-name, --image-repo, --image-tag
- Data folder: --data-folder
- Auto-routing: --auto-routing, --auto-routing-default-model
- LLM Provider API Keys for 20+ providers
Examples:
# Non-interactive with Dashscope
./get-ai-gateway.sh start --non-interactive --dashscope-key sk-xxx
# With auto-routing
./get-ai-gateway.sh start --non-interactive \
--dashscope-key sk-xxx --auto-routing --auto-routing-default-model qwen-turbo
* feat: add route subcommand for managing auto-routing rules
Add 'route' command with subcommands to manage model routing rules:
Commands:
route add - Add a new routing rule
route list - List all routing rules
route remove - Remove a routing rule by ID
Options:
--model Target model for routing
--trigger Trigger phrase(s), e.g. '深入思考|deep thinking'
--pattern Custom regex pattern (alternative to trigger)
--rule-id Rule ID to remove
Examples:
# Add rule for complex reasoning
./get-ai-gateway.sh route add --model claude-opus-4.5 --trigger '深入思考|deep thinking'
# Add rule for coding
./get-ai-gateway.sh route add --model qwen-coder --trigger '写代码|code:'
# List rules
./get-ai-gateway.sh route list
# Remove rule
./get-ai-gateway.sh route remove --rule-id 0
Features:
- Hot-reload configuration without container restart
- Python YAML editing for reliability (with sed fallback)
- Pattern auto-generation from trigger phrases
- Container connectivity check1 parent 8b661df commit 5747465
1 file changed
Lines changed: 589 additions & 4 deletions
0 commit comments