<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shaurya Srivastava</title>
    <description>The latest articles on DEV Community by Shaurya Srivastava (@shaurya_srivastava_027f4e).</description>
    <link>https://dev.to/shaurya_srivastava_027f4e</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4161394%2F69feeaf5-95b8-4677-81b6-595adfd34c5b.jpg</url>
      <title>DEV Community: Shaurya Srivastava</title>
      <link>https://dev.to/shaurya_srivastava_027f4e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shaurya_srivastava_027f4e"/>
    <language>en</language>
    <item>
      <title>I Built My Friend a Free, Offline Chess Coach with Stockfish and a Local LLM</title>
      <dc:creator>Shaurya Srivastava</dc:creator>
      <pubDate>Sun, 04 Oct 2026 19:42:03 +0000</pubDate>
      <link>https://dev.to/shaurya_srivastava_027f4e/i-built-my-friend-a-free-offline-chess-coach-with-stockfish-and-a-local-llm-5a3h</link>
      <guid>https://dev.to/shaurya_srivastava_027f4e/i-built-my-friend-a-free-offline-chess-coach-with-stockfish-and-a-local-llm-5a3h</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-weekend-2026-10-01"&gt;Hacktoberfest Weekend Challenge: Build for a Friend&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built a chess game analyzer for my friend. He loves chess, but he doesn't play often enough to pay for a subscription just to find out what he did wrong after a game or a puzzle.&lt;/p&gt;

&lt;p&gt;His request was simple: &lt;em&gt;"I want software that analyzes my moves and tells me what I did wrong."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So I built that. You upload a game (a PGN file from Lichess or Chess.com), and the app:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;marks every move as best, excellent, good, inaccuracy, mistake, or blunder&lt;/li&gt;
&lt;li&gt;shows the position with arrows for your move and the engine's better move&lt;/li&gt;
&lt;li&gt;explains each mistake in one or two plain sentences&lt;/li&gt;
&lt;li&gt;lets you ask a coach questions about the move you are looking at&lt;/li&gt;
&lt;li&gt;counts your &lt;strong&gt;recurring problems&lt;/strong&gt; across the game (for example "7 hung pieces")&lt;/li&gt;
&lt;li&gt;checks single puzzle positions: enter a position and your move, and it tells you how good the move was&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lichess already offers free engine analysis, so I'm not claiming nobody can analyze games for free. What this adds is plain-language reasons, a summary of repeated mistakes, and a tool that runs locally and keeps the analysis on your machine.&lt;/p&gt;

&lt;p&gt;My goal wasn't to build another chess engine. It was to build something that explains mistakes in a way a casual player can learn from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/bOCa-Sw1icE" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/shauryasri14" rel="noopener noreferrer"&gt;
        shauryasri14
      &lt;/a&gt; / &lt;a href="https://github.com/shauryasri14/Chess-Move-Analyzer" rel="noopener noreferrer"&gt;
        Chess-Move-Analyzer
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A free, offline chess analyzer built for a friend who can't justify paying for game review. Stockfish judges every move, code tags the cause (hung piece, missed capture, missed mate), and a local LLM via Ollama explains it in simple words. Your games never leave your machine.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;♟ Chess Move Analyzer&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Free, offline chess game review that tells you what you did wrong, in plain language.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Stockfish judges every move, code tags the cause, and a small local LLM (via Ollama) explains it. No account, no subscription, no game limit, and your games never leave your machine.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Built for a friend who loves chess but doesn't play often enough to justify paying for game analysis
&lt;em&gt;Submission for the Hacktoberfest Weekend Challenge: Build for a Friend.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Why this exists&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Casual players finish a game or a puzzle and want one thing: &lt;em&gt;what did I do wrong?&lt;/em&gt; Many tools lock full analysis behind a paid plan, which doesn't make sense for someone who plays a few games a month.&lt;/p&gt;
&lt;p&gt;This project gives that analysis for free, on your own computer:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stockfish&lt;/strong&gt; (open-source engine) decides which moves were mistakes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code&lt;/strong&gt; finds the likely cause: a hung piece, a missed capture…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/shauryasri14/Chess-Move-Analyzer" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;To run it yourself: &lt;code&gt;docker compose up --build&lt;/code&gt;, then open &lt;code&gt;http://localhost:8501&lt;/code&gt;. Setup without Docker is in the README.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Open-source pieces&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Piece&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://stockfishchess.org/" rel="noopener noreferrer"&gt;Stockfish&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Evaluates each position; the change in evaluation is used to classify the move. One of the strongest open-source chess engines.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/niklasf/python-chess" rel="noopener noreferrer"&gt;python-chess&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Reads PGN, builds boards, and communicates with Stockfish&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt; with &lt;code&gt;gemma3:4b&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Runs the language model locally to explain mistakes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://streamlit.io" rel="noopener noreferrer"&gt;Streamlit&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The web interface&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Docker Compose&lt;/td&gt;
&lt;td&gt;One command starts the app and Ollama&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The pipeline&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PGN → Stockfish evaluates each position → code classifies and tags mistakes → local LLM explains → summary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The most important design rule: the model never judges the chess.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Small language models are bad at evaluating chess positions, so the work is split:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Stockfish&lt;/strong&gt; evaluates each position once. The evaluation after one move is reused as the evaluation before the next.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code&lt;/strong&gt; turns the evaluation drop into a label (for example, 300+ centipawns lost is a blunder) and finds the likely cause: a &lt;strong&gt;hung piece&lt;/strong&gt;, a &lt;strong&gt;missed capture&lt;/strong&gt;, or a &lt;strong&gt;missed mate&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The LLM&lt;/strong&gt; receives only these facts and explains them in one or two sentences. It is told not to invent moves.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The "Ask the coach" chat works the same way: every question carries the current position, the evaluations, the engine's line, and the neighbouring moves. A &lt;strong&gt;"What the coach sees"&lt;/strong&gt; panel shows exactly what the model is given, so you can check its input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Details that mattered&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Evaluations are clamped to ±15 pawns, so trimming a huge lead isn't called a blunder.&lt;/li&gt;
&lt;li&gt;Thresholds are editable in the sidebar and re-label instantly, with no engine rerun.&lt;/li&gt;
&lt;li&gt;If Ollama isn't running, the app falls back to template explanations instead of breaking.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Honest limitations&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The cause tags are simple heuristics and can miss exchange sequences or pins.&lt;/li&gt;
&lt;li&gt;A 4B model can still phrase things badly sometimes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The best engine is open source.&lt;/strong&gt; Stockfish gives strong analysis for free, and paying for analysis was exactly my friend's problem.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No account, subscription, or game limit.&lt;/strong&gt; He can analyze one game a month or fifty.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;His games stay on his machine.&lt;/strong&gt; The model runs locally and the app works offline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I could control the coach.&lt;/strong&gt; With a local model I wrote the system prompt, limited it to engine facts, showed its input, and could swap models freely. A closed API would make that harder and add a cost per question.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  My Friend's Reaction
&lt;/h2&gt;

&lt;p&gt;When I first showed my friend the project, his first reaction was, “Bro, this would be way better if it worked directly on Chess.com.” I was like, “Yeah, I know, but at least appreciate what I made!” 😭&lt;/p&gt;

&lt;p&gt;A little later, he actually played a game, exported it from Chess.com, and uploaded the PGN to my app. He went through the analysis himself, and once he saw everything actually working, he was genuinely impressed. He liked that he could go through the game move by move and see not just that a move was bad, but what he did wrong and what he could have played instead.&lt;/p&gt;

&lt;p&gt;He uses Chess.com quite regularly and usually ends up using his free analysis/trial features pretty early in the month. So being able to just run this locally and analyze his games whenever he wants was something he actually found useful.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
