This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle
What I Built
I asked Gemma 4 E4B (an open model) to explain 29 real blunders and mistakes from club games. Its notes suggested Stockfish's top alternative zero times, and one note in four recommended a move that isn't even legal. Then I gave it Stockfish's facts instead of the raw game, and it named the right move 29 times out of 29.
That gap is the whole product.
Second is a game-review assistant for chess coaches. A coach pastes a student's games (or just their Lichess or Chess.com username) and a couple of minutes later gets a review sheet they can teach from:
- The 3 or 4 moments that decided the game, on board diagrams showing the move played, the better move and the opponent's threat
- A short explanation of each moment in words a 10-year-old understands
- A question to ask the student in class, and a rule of thumb to remember
- Homework for the week
- A WhatsApp-ready note for the parents, in Hindi, Hinglish, Tamil, English or any other language
- An annotated PGN to drop straight into a Lichess study
Everything runs on an ordinary laptop with open models: Stockfish does the chess, Gemma 4 E4B (through Ollama) writes the words, and a verifier in plain Python makes sure the words only say what Stockfish confirmed.
In chess, a second is the analyst who does the preparation so the player can focus on playing. That's the job here: the coach keeps teaching, Second does the Sunday-night homework checking.
Who would pay for this?
Chess coaching has exploded in India since Gukesh became world champion, and a lot of the coaches are strong club players and college students teaching on the side, which makes it a side hustle in its own right. The lessons are paid. The part after the lessons isn't: opening every student's games, finding the turning points, and writing something a kid (and their parents) will actually read. A coach with 20 students who each play two games a week has 40 games to go through. At five minutes a game, that's more than three hours of unpaid work every week.
Second turns each of those games into about 90 seconds of laptop time, while the coach does something else.
Here's how I'd sell it. The software is GPL and free to self-host, forever. Coaches pay for the parts they don't want to do themselves: a one-click installer, their academy's name on the printouts, automatic weekly import of every student's online games, and support. Around โน299 a month per coach (about $3.15). That price works because a review costs nothing to produce: the models run on the coach's own laptop, so there's no bill growing with every game.
Demo
- Live demo: https://chess-second.onrender.com (free Render instance, so it can take a minute to wake up)
- Sample reviews: https://chess-second.onrender.com/samples (real games from the open Lichess database, reviewed on my laptop, with notes for parents in any language like Hindi, English, Tamil)
A real run on my laptop, sped up (the real thing takes about 90 seconds): paste a game, Stockfish checks every move, Gemma writes the notes, the verifier checks them, and the review comes out with a note for parents in Hindi(can be any language).
Each key moment gets two boards: the position before the move (red: what was played, green: what was better) and after it (orange: the opponent's best reply, yellow: the piece left undefended).
And the part parents actually read:
Code
dragon-slayer27
/
chess-second
Game reviews for chess coaches: Stockfish finds the mistakes, an open-weight Gemma 4 explains them, and a verifier checks every claim. Runs on a laptop.
โ Second: a chess coach's AI second
Stockfish finds it. Gemma explains it. Code checks it.
Try it: https://chess-second.onrender.com (public demo, free instance, so give it a minute to wake up) ยท sample reviews
Second turns your students' games into review sheets you can teach from: the turning points on board diagrams, a kid-friendly explanation of each one, a question to ask in class, a rule of thumb, homework, and a WhatsApp-ready note for parents in their own language.
It runs on an ordinary laptop with open models (Stockfish + Gemma 4 through Ollama), so students' games and names never leave the coach's machine, and a review costs nothing.
In chess, a second is the analyst who does the preparation so the player (or the coach) can focus on the game. That is the job here: the coach still teaches, Second does the Sunday-night homework checking.
Why the model is
โฆHow I Built It
First experiment: Gemma on its own is a terrible chess coach
My very first test gave Gemma 4 E4B one line of facts about the most famous beginner blunder there is: "The student played 3... Nf6 and allowed Qxf7#. Better was g6." I asked for a coaching note.
It titled the note "Don't Fall for the Quick Knockout: Avoiding the Back-Rank Trap". It isn't a back-rank mate. It warned about a "discovered attack". There isn't one. On the second try the headline was "Tactical Blunder: Avoiding the Queen Sacrifice". The queen takes a pawn and it's checkmate; nothing is sacrificed.
That's harmless in a chatbot. It's not harmless on a sheet of paper a 10-year-old will believe, from a coach the child's parents are paying for accuracy.
So the model never analyses anything
The rule in Second is simple: the language model only writes words. Everything chess is decided by code.
PGN / Lichess / Chess.com
-> Stockfish: every position, best 2 lines, depth 14
-> Facts: python-chess works out what actually happened
-> Gemma 4: headline, explanation, question, tip, summary, parent note
-> Verifier: is every claim in the facts?
yes -> review
no -> Gemma gets the list of problems and tries again
3 failed tries -> plain note built from the facts
1. Stockfish checks every move. A move is flagged when the player's winning chances drop by 10 points or more (15 or more for a blunder), using the same win-chance curve and thresholds as Lichess.
2. Code turns the analysis into facts. For each critical moment, python-chess works out what actually happened and writes it down as plain sentences: which piece was left undefended and by what it's attacked, whether the reply is a fork, whether there's a forced mate (and whether it's a back-rank mate), what the better move captures, and how much material each line wins or loses. Here's the real fact sheet for a blunder from one of the sample games (a 1531-rated blitz game from the Lichess database):
Move played: 19. Rxe5 (a blunder)
- Before Rxe5 the position was winning for you; after it, the position was losing for you.
- After Rxe5, your queen on d6 is attacked by the queen on g6 and nothing defends it.
- After Rxe5, your rook on e5 can be taken by the knight on d7, which is worth less.
- Your opponent's best reply is Qxd6, which captures your queen on d6.
- If your opponent finds the best line (Qxd6, Re4, fxe4, Bxd6), you lose about 8 points of material.
- The better move was Qxe7, which captures the opponent's knight on e7 for free.
- Following the best line (Qxe7, e4, Be2, h3), you would win about 3 points of material.
KEY FACT: After Rxe5, your queen on d6 is attacked by the queen on g6 and nothing defends it.
And what Gemma wrote from it:
Don't leave your queen attacked. After you played Rxe5, your queen on d6 was attacked by the queen on g6 and had no defense. A better move was Qxe7, which lets you take the knight for free.
Ask Ananya: Before you moved, what was happening to your queen on d6?
Rule of thumb: Always check if your pieces are safe before making a move.
3. Gemma writes the notes for the student's level (beginner, intermediate, advanced): a headline, two or three sentences, a question that lets the student find the idea themselves, and a rule of thumb. Then a summary, homework and the note for parents.
4. The verifier checks specific chess claims against the engine facts. Every move, square, "mate in N", move number and evaluation in the note has to appear in the facts. So does every named tactic: a note can only say "fork", "pin", "sacrifice", "back rank" or "discovered attack" if the facts do. Claims like "you lose your queen" or "the knight on f4 is hanging" have to match a piece the facts say was actually lost or undefended. The parent note can't contain chess notation, and if it's meant to be in Hindi it has to actually be in Devanagari. If anything fails, Gemma gets told exactly what was wrong and tries again. After three failures, Second uses a plain note assembled from the facts, so nothing invented ever reaches a student.
TACTIC_RE = re.compile(
r"\b(back[- ]rank|fork(?:s|ed|ing)?|pin(?:s|ned|ning)?|skewer\w*|discovered (?:attack|check)\w*|"
r"sacrific\w*|smothered|stalemate\w*|en passant|zwischenzug|deflect\w*|decoy\w*|overload\w*|x-ray)\b",
re.I,
)
...
for match in TACTIC_RE.finditer(text):
word = match.group(1).lower()
root = next(root for prefix, root in TACTIC_ROOTS if word.startswith(prefix))
if not allowed.mentions(root):
issues.append(Issue("wrong_tactic", match.group(0)))
Measuring it
I sampled 16 real games between 1000 and 1700 rated players from the Lichess open database (CC0) and took the biggest blunder or mistake for each side: 29 moments. Each one was explained three ways by the same model on the same laptop:
- Plain Gemma: the moves so far plus "this move was a blunder, explain it". This is what happens when you paste a game into a chatbot.
- Gemma + engine facts: Second's fact sheet, first answer, no verifier.
- Second: facts, verifier, retries, fallback.
| Plain Gemma | Gemma + facts | Second | |
|---|---|---|---|
| Suggests a concrete move | 14/29 | 29/29 | 29/29 |
| Names Stockfish's top alternative | 0/29 | 29/29 | 29/29 |
| Mentions a piece move that isn't legal on the board | 7/29 | 0/29 | 0/29 |
| Makes a chess claim the engine didn't confirm | 18/29 | 0/29 | 0/29 |
| Median time per note | 11.9 s | 12.2 s | 12.2 s |
One example. After a beginner played 14. g4:
- Plain Gemma: "A better move would have been to play 14. Nf7, putting more pressure on Black's position." Nf7 isn't a legal move in that position.
- Second: "After your move g4, the game became bad for you. If you had played Nxh6 instead, you would have won about 2 points of material."
The honest finding surprised me: the facts did almost all the work. With a good fact sheet, Gemma's first answer passed the verifier every single time in this run, so the verifier never had to step in. I'm keeping it anyway. It's the seatbelt for the day grounding isn't enough, and it's what lets me say "nothing invented reaches a student" instead of "probably nothing". Every note and every score is in eval/results.json.
Prompting lessons from a 4B model
- Tell it what matters. My first notes were all correct and all bland ("Watch out for big mistakes!"). In one early review the facts said a knight fork was coming (Nxc2+, hitting the king and the rook) and Gemma talked about the pawn on c2 instead. The fix was letting code pick a single KEY FACT per moment and requiring the explanation to lead with it.
- Say who the reader is. The first Hindi "note for parents" started "เคชเฅเคฐเคฟเคฏ Aarav" ("Dear Aarav"): it was written to the kid. Now the prompt says to write to the parent and talk about the child in the third person, and to name one thing to practise this week.
-
Don't give the model the kid's name at all. Gemma writes
[STUDENT]and Second fills in the name afterwards. Locally it doesn't matter much, but it means the hosted demo never sends a child's name to anyone.
The verifier was wrong too, at first
On the first sample game, the verifier proudly reported "4 invented details caught". I went to look, and every one was my bug, not Gemma's. The summary said the student "castled on move 5" and had "75.1% accuracy". Both were true, and both were in the facts I'd given Gemma, but the summary checker only knew about the key moments, so it rejected them three times. Worse, the whole summary then fell back to the English template, even though the parents had asked for Hindi.
Two fixes. The summary is now checked against exactly the fact sheet Gemma was shown. And fallbacks happen per field: if only the summary sentence is bad, it gets replaced, and a perfectly good Hindi note for parents is kept.
Making a 4B model fast on a normal laptop
I run gemma4:e4b-it-qat (6.1 GB) in Ollama on an Intel Core Ultra 5 laptop with 16 GB of RAM and no discrete graphics card. By default Ollama ignored the integrated Intel Arc GPU. Setting OLLAMA_IGPU_ENABLE=1 turned on Vulkan and took prompt processing from ~31 to ~315 tokens per second. A whole game now takes about 90 seconds in the web app, from clicking "Review" to the finished page: around 20 for Stockfish and around 12 per note for Gemma. A full review uses roughly 2,000 to 3,000 prompt tokens and about 550 output tokens, all of them free.
Render
The same Docker image runs the public demo on Render's free plan. A free instance doesn't have the memory to hold Gemma, so the demo runs Stockfish in the container and asks Gemma 4 26B A4B on Google AI Studio for the notes. Because Gemma is an open model family, the prompts, the verifier and the model family are the same as on the laptop; only where the weights run changes. The demo takes one public game at a time; students' games belong on the coach's laptop. With the bigger hosted Gemma it's also quick: a 21-move game came back in under 30 seconds, every note passing the verifier on the first try.
Built with GitHub Copilot
I built Second with GitHub Copilot's agent in VS Code as a pair programmer. It helped brainstorm and check the idea, wrote most of the code and tests, installed Ollama and Gemma on my laptop, ran the evaluation, and found the Intel GPU speed-up in Ollama's logs. GitHub Actions runs the tests against a real Stockfish and builds and smoke-tests the Render Docker image on every push.
Why Does Open Innovation Matter?
The hard part is already open source. The strongest chess engine in the world, Stockfish, is free software. A 4B language model can't play chess, and doesn't need to: open source already solved chess analysis, so all the model has to do is talk. Second is a thin layer of glue between two open projects.
Kids' data stays at home. A coach's students are children, and India's Digital Personal Data Protection Act, 2023 puts extra rules on children's personal data, including verifiable consent from a parent. With Second on the coach's own laptop, the games and names aren't handed to yet another company on top of that: no third-party processor, nothing leaving the country, nothing extra to explain to a worried parent.
No bill, no card, no account. Hosted models are cheap per game these days, but every one of them needs an account, an API key and usually an international credit card, which plenty of small coaches in India don't have, and the bill grows with every student. On the coach's laptop, the 40th game of the week costs exactly what the first one did: nothing. For a โน299-a-month product, that's the only cost number that never needs checking again.
No lock-in, and permission to sell. Gemma 4 is released under Apache 2.0, so I can build a paid product on it without asking anyone. The same prompts run on Gemma on a laptop, on Ollama Cloud or on Google AI Studio, and I can swap in a bigger Gemma the day a coach has a bigger machine.
Open data made the evaluation possible. The Lichess database is CC0. I could test on real club games, publish every note and every score, and link each example back to the original game.
It works offline. Tournament halls are famous for bad Wi-Fi. Second doesn't need any.
My Agent Session
This project was built in one long session with GitHub Copilot's agent: brainstorming, setup, code, tests, evaluation and this write-up's numbers. The commit history and eval/results.json show the work.
My First User
My first user was a friend who plays chess well. He tried Second and said that he found it pretty good for being used by coaches. It was encouraging to get that first positive response from someone outside the build process, rather than relying only on automated tests and my own expectations.
His feedback was brief, so I'm treating it as an encouraging first reaction, not a detailed accuracy review. The benchmark measures specific technical checks; this was the first step towards finding out how the product feels to another chess player.
The next step is to put it in a coach's weekly routine: review a student's games, use the questions during a lesson, and find out which parts actually save preparation time. That's the test I want before turning the proposed paid offering into a business.
Prize Categories
- Best Use of Gemma: Gemma 4 E4B (QAT) runs locally through Ollama and writes every note, summary and multilingual parent note, grounded in engine facts and checked by a verifier. Gemma 4 26B A4B on Google AI Studio powers the public demo.
- Best Use of GitHub Copilot: built end to end with GitHub Copilot's agent; GitHub Actions runs the tests with a real Stockfish and builds and smoke-tests the Render Docker image on every push.
-
Best Use of Render: the public demo is a Docker web service deployed on Render from a
render.yamlBlueprint.





Top comments (0)