Sorry if it's confusing how the AI works. I'll update the page to make it clearer.
But basically, whether you play in the browser or desktop, if you have Player2 running in the background, the game connects to it when you chat, which then sends your messages to their AI model.
So it's like this: Game -> Player2 app -> Player2 AI model
As for the connection issues, it might be a problem with Player2's servers, or maybe a security thing if your browser blocks connections to 127.0.0.1 (localhost).