lichess-bot-devs / lichess-bot

A bridge between Lichess bots and chess engines
GNU Affero General Public License v3.0
714 stars 436 forks source link

Custom Engine based on user games #986

Open realBravo opened 1 week ago

realBravo commented 1 week ago

Is there a way to make a custom engine based on my games with both black and white. I want to always be playing chess if you catch my drift. I've looked into it and it seem I have to make my own custom engine that is trained off my games but im not sure how to get them off lichess. How do i do that?

AttackingOrDefending commented 1 week ago

I don't think the games you have played as a human will be enough to train a NN engine and this will also be hard. Some easier solutions would be:

  1. Use the lichess opening explorer through lichess-bot (and after that use Maia).
    • Advantages: No coding
    • Disadvantages: Only for openings, will be somewhat slow
  2. Download all your games and build an opening book out of them (and after that use Maia) (You can do this by going to your Profile on lichess and clicking Export Games and then using cbuild).
    • Advantages: Not only for the opening, fast
    • Disadvantages: Will require some more work

Both of these solutions will need you to get to the exact position to play the move you would have played, and not just a similar position.

realBravo commented 5 days ago

I have cbuild install how do i use it. I've gone through the readme and set everything up. What now.

realBravo commented 5 days ago

for option one do i just download maia and turn lichess-opening-explorer to true

AttackingOrDefending commented 4 days ago

I have cbuild install how do i use it. I've gone through the readme and set everything up. What now.

After downloading your games as a pgn file, create an environment in cbuild (pipenv run python cbuild.py -e user --variant standard) the put the pgn file in the envs/user/source folder. Then run python cbuild.py -e user -f and then envs/user/source folder. Then run python cbuild.py -e user -b and you will have a bin book created in the envs/user/book folder.

for option one do i just download maia and turn lichess-opening-explorer to true

Download Maia (and Leela) (see here), and then in your config.yml under lichess_opening_explorer change enabled to true, source to player, player_name to YOUR LICHESS USERNAME and lower min_games to 1 or 2.