Client Configuration

Connection, game settings, command line and prompts

English · 简体中文

Client · Installation

[A. Connection](#connection) · [B. Game settings](#games) · [C. Command line](#command-line) · [D. Modes](#modes) · [E. Prompts](#prompts) ## A. Connection The default address is `http://localhost:8000` on the same PC: the game and Client run on Windows, and Server runs in local WSL2. Windows can reach WSL2 networking applications through `localhost`; see [Microsoft's WSL networking guide](https://learn.microsoft.com/en-us/windows/wsl/networking#accessing-linux-networking-apps-from-windows-localhost).
Remote hosts and connection troubleshooting - **Separate GPU host:** set `MODEL_BASE_URL` to `http://:8000` and make sure its listening port is reachable from the client. - **Local connection fails:** first run `curl -s http://localhost:8000/health` inside WSL2 to confirm readiness, then check the same URL from Windows. For WSL networking issues, use the official guide above to check localhost forwarding or connect through the WSL instance address. - **Existing settings:** `MODEL_API_URL` overrides `MODEL_BASE_URL`. Update or remove an old full API URL when switching deployments.
The client reads connection settings from environment variables. It also loads `.env` from `client/` and the current working directory; existing environment variables take precedence.
Environment variable Meaning Default
MODEL_BASE_URL Server base URL http://localhost:8000
MODEL_API_URL Full /v1/chat/completions URL; overrides MODEL_BASE_URL Unset
MODEL_NAME Model name Lumine2
MODEL_API_KEY API key Unset
MODEL_MAX_TOKENS Maximum generated tokens per request 512
MODEL_TIMEOUT Request timeout in seconds 60
Temperature and top-p are configured on the server; the client does not send sampling parameters. The service must expose `/health`, `/reset` and `/v1/chat/completions`, with context and reasoning settings reported by `/health`. ## B. Game Settings The configuration file is required. It defaults to `config.json` in `client/`; use `--config` to select another path. Defaults for these configuration fields live in that file rather than being built into the code.
Field Location Meaning
default_instruction Top level only, required Default task objective, substituted for <instruction>
instruction games.<game> only, optional Per-game objective; overrides default_instruction
default_handoff_release_keys Top level only, required Keys released immediately during a batch handoff
handoff_release_keys games.<game> only, optional Replaces the entire default handoff-key list for that game
process_name games.<game> only, optional Executable name for automatic window focus; omit to switch manually
Precedence is **CLI arguments** (`--instruction`, `--process-name`) **> per-game settings > top-level settings**. The `games` object is optional. Its keys must exactly match prompt filenames in `prompts/games/` without `.txt`, including the `_cn` / `_en` suffix; the English version is a separate game entry. Unmatched names produce a warning, and the game uses the top-level defaults. `process_name` is the executable name shown in Task Manager's Details tab. It can differ between releases: the Chinese Genshin Impact client uses `YuanShen.exe`, while the international client uses `GenshinImpact.exe`. If a process name is configured, the game must already be running; otherwise startup fails because no matching window is found. ```json { "default_instruction": "推进游戏主线剧情", "default_handoff_release_keys": ["W", "A", "S", "D"], "games": { "genshin_impact_cn": {"instruction": "推进游戏主线剧情,逐步探索和解锁地图"}, "cyberpunk_2077_cn": {"process_name": "Cyberpunk2077.exe"}, "my_game_en": {"handoff_release_keys": ["Up", "Down", "Left", "Right"]} } } ``` **Batch-handoff keys** (`default_handoff_release_keys` / `handoff_release_keys`): if an action batch finishes while the next batch is still being inferred, these keys are released immediately. Movement keys are typical choices to prevent continued movement. Other held keys remain pressed for up to another 100 ms while awaiting the next batch. If the next batch is already ready, no keys are released early. Key names follow `FORMAT_MAPPING` in `lumine2_client/model/action_protocol.py` and are case-insensitive, for example `Up`, `Shift`, `Space` and `LB`. Unknown settings, incorrect types and unsupported key names cause startup errors. ## C. Command-Line Arguments `lumine2-client`, `python run.py` and `python -m lumine2_client` accept the same arguments. Every argument is optional:
Argument Meaning Default
--game Prompt filename under prompts/games/, without .txt Choose interactively from the available games
--instruction Task instruction; overrides config.json Read from config.json
--process-name Game executable name, such as GTA5.exe, for automatic window focus; overrides process_name in the config Read from config.json; if absent, switch to the game manually
--start-delay Seconds to wait before controlling the game 5
--monitor-index Display to capture, numbered from 1 1
--max-steps Maximum inference steps; 0 runs continuously 0
--execution-data-path JSONL log path execution_data/general_game_async_<timestamp>.jsonl
--config Configuration file path client/config.json
Capture covers an entire display, not a single window. With multiple displays, use `--monitor-index` to select the one containing the game. Windows determines the numbering; display 1 is usually the primary display. ## D. Operating Modes The server's `/health` response selects the mode through its `reasoning` field, controlled by `--reasoning` / `--no-reasoning`. No client-side mode flag is needed.
Server mode Client mode Prompt ending
reasoning: true Reasoning prompts/modes/reasoning.txt
reasoning: false Instant prompts/modes/instant.txt
**Reasoning** Adaptive Thinking produces thoughts and actions when replanning is needed, and actions only otherwise. The server retains the latest `reasoning_history_rounds` thoughts. By default, `force_thinking_steps` and `action_window_frames` are both 120: after 119 frames without a thought, frame 120 forces one and clears all action frames, producing a sawtooth reset. If forced thinking is disabled (`--force-thinking-steps -1`) or its interval exceeds the action window, excess frames slide out; any new thought clears the action frames. Responses must include `reasoning_context`. **Instant** Instant produces actions only, with no retained thought history. The server keeps the latest `action_window_frames` frames and evicts the oldest when full. Requests carry `action_only: true`; the server blocks thought markers during decoding. Both modes require `/health` to provide `reasoning`, `force_thinking_steps`, `action_window_frames` and `max_len`. Reasoning mode additionally requires `reasoning_history_rounds`. Invalid server configuration causes an error at startup. ## E. Prompts and New Games The system prompt has two parts: - `prompts/games/.txt` is shared by both modes and contains the mode description, output format, controls, and gameplay instructions (ending before the `**Operating Mode**` / `**运行模式**` section). Built-in prompts follow the `_en.txt` / `_cn.txt` convention (e.g., `cyberpunk_2077_en.txt`, `genshin_impact_cn.txt`, `spider_man_2_en.txt`). - `prompts/modes/.txt` supplies the mode-specific ending: operating mode, objective, and—for Adaptive Thinking (`reasoning`)—history instructions. Prompts ending in `_en` automatically pair with `.en.txt`. After joining them, `` is replaced with the task objective and `` with the server's `reasoning_history_rounds`. **Adding or customizing prompts:** To add a new game, copy an existing file in `prompts/games/` to `prompts/games/_en.txt` (or `_cn.txt`) and adapt its controls and gameplay section. We recommend matching the system prompt language to the game's in-game language. You can also freely customize or expand any system prompt—for example, by adding game-specific knowledge, mechanics, tips, or strategies—to steer the agent's behavior and improve its performance.