A complete chess engine with UCI interface and Lichess bot integration, built around your custom evaluation functions.
🎯 Your Custom Evaluation Engine
- 25+ evaluation rules and heuristics
- Minimax with alpha-beta pruning
- Position-aware scoring system
🔍 Advanced Search
- Iterative deepening
- Transposition table
- Move ordering and killer moves
- Quiescence search
⏱️ Smart Time Management
- Adaptive time allocation
- Position-complexity aware
- Emergency time handling
🌐 Lichess Integration
- Automatic challenge handling
- Real-time game playing
- Chat integration
🖥️ UCI Compatible
- Works with Arena, ChessBase, etc.
- Standard UCI protocol
- Configurable engine options
python setup.pypython uci_interface.py# Set your token
export LICHESS_TOKEN=your_token_here
# Run the bot
python lichess_bot.pypython package_exe.pyEdit config.py to customize:
- Engine strength and search depth
- Lichess bot behavior
- Time management settings
- Evaluation parameters
evaluation_engine.py- Your custom evaluation functionsmain_engine.py- Main engine controller with searchuci_interface.py- UCI protocol implementationtime_manager.py- Time control managementlichess_bot.py- Lichess API integrationconfig.py- Configuration settings
- Create Lichess account (don't play any games)
- Go to https://lichess.org/account/oauth/token
- Create token with "Bot Play" scope
- Upgrade to bot account:
curl -d "" https://lichess.org/api/bot/account/upgrade \ -H "Authorization: Bearer YOUR_TOKEN"
- Use PyInstaller to create .exe files
- Package with
python package_exe.py - Distribute executables to users
- Deploy on Heroku, Railway, or DigitalOcean
- Use environment variables for tokens
- Run 24/7 for continuous bot operation
- Test with Arena or other UCI GUIs
- Challenge your bot on Lichess
- Analyze games to improve evaluation
- Open Arena Chess GUI
- Install new engine
- Select
ChessBot_UCI.exe - Start playing!
# Direct token
python lichess_bot.py your_token
# Environment variable
export LICHESS_TOKEN=your_token
python lichess_bot.pytime_control = {
'wtime': 300000, # 5 minutes
'btime': 300000,
'winc': 3000, # 3 second increment
'binc': 3000
}Engine not responding?
- Check Python version (3.8+ required)
- Verify all dependencies installed
- Test with
python uci_interface.py
Lichess bot not connecting?
- Verify API token is correct
- Check account is upgraded to bot
- Ensure no firewall blocking connections
Packaging issues?
- Install latest PyInstaller
- Check all files are present
- Use spec file for complex builds
Feel free to improve the evaluation functions or add new features:
- Opening book integration
- Endgame tablebase support
- Neural network evaluation
- Multi-threading search
- Advanced pruning techniques
Open source - feel free to use and modify!