openbattle
v1.0.3
Published
AI model battle arena for comparing and testing different LLMs
Maintainers
Readme
OpenBattle
OpenBattle is a CLI tool for running multi-model AI battles and relay-style answer synthesis.
Install
npm install -g openbattleQuick Start
- Configure provider and models:
openbattle connect- Manage active models:
openbattle models- Start a battle:
openbattle battle --topic "How should we design API versioning?"Battle Modes
relay(default): models collaborate in sequence (draft -> improve -> review) and produce one final answer.classic: multi-round interaction mode for broader comparison.
Example:
openbattle battle --mode relay --topic "Build a caching strategy"
openbattle battle --mode classic --rounds 3 --topic "Compare React and Vue"Useful Commands
openbattlestart interactive REPLopenbattle connectconfigure API key and modelsopenbattle modelstoggle active modelsopenbattle battlerun a battle sessionopenbattle export --format markdownexport latest battle logopenbattle configopen local config file
Relay Options
openbattle battle \
--mode relay \
--quality-threshold 9 \
--stabilization-delta 0.3 \
--model-timeout-ms 120000--quality-threshold: stop when score reaches threshold--stabilization-delta: stop when improvement is small--max-relay-rounds: default is active model count--model-timeout-ms: timeout per model call
Config Path
Default config path:
~/.config/openbattle/openbattle.jsonCreation behavior:
openbattle connectwill create the file if it does not exist.openbattle configwill also create the file before opening.- Other commands read defaults in memory when the file is missing.
Config File Structure
Example:
{
"version": "1.0.0",
"active_models": [
"gpt-4",
"claude-3-5-sonnet"
],
"models": [
{
"id": "gpt-4",
"provider": "openai",
"api_key": "sk-***",
"enabled": true
},
{
"id": "claude-3-5-sonnet",
"provider": "anthropic",
"api_key": "sk-ant-***",
"enabled": true
}
],
"battle_settings": {
"max_rounds": 3,
"peer_review": true
}
}Field reference:
version: config schema/application version string.active_models: model IDs currently active in battles.models: configured model list with provider, api key, and enable flag.battle_settings.max_rounds: default rounds for classic mode.battle_settings.peer_review: whether peer-review is enabled.
License
ISC
