How lyihub/liars-bar-llm works
• Game Engine Layer:
• game.py: The main entry point handling the game loop.
• player.py: Implements the LLM-based agent logic which makes decisions (e.g., choosing cards to play or challenging).
• llm_client.py: Manages the connection/configuration for making calls to external LLM APIs (using New API or One API as noted).
• multi_game_runner.py: Allows batch execution of multiple game rounds.
• game_record.py: Handles persistence of game data (saving and extracting game records as JSON).
• Analysis Tools Layer:
• game_analyze.py: Aggregates and prints overall game statistics.
• player_matchup_analyze.py: Extracts and analyzes game records of AI vs. AI matchups.
• json_convert.py: Converts game records from JSON files into human-readable text.
• Supporting/Data Storage:
• Demo Data Directories under demo_records:
▪ game_records: Raw JSON game logs.
▪ converted_game_records: Converted text versions of game records.
▪ matchup_records: Detailed matchup logs between specific AI models.
• prompt directory: Contains template texts used for shaping the LLM’s outputs.
Relationships and Data Flows
• Players created in player.py depend on prompts stored under the prompt folder; indicate a relationship between player.py and prompt templates.
Important Architectural Patterns
• Modular Design: Each script or module handles one specific responsibility (e.g., API wrapper, game record management, analysis/visualization), which helps with scaling or modifying specific components.
• Extensibility: The design supports easy addition of new AI models (players) or modifications to prompts by isolating them in their own modules and configuration—the prompt directory helps highlight this.
Relevant Technologies/Frameworks
• Python is the primary language.
• The project leverages the “New API” or a similar API management tool for unified LLM calls.
• Conda (or pip) is used for dependency management (e.g., openai package is required).