What I learnt self-publishing on Amazon KDP for both Kindle and Print
Beginnings
It all started a few years ago when one of my two amazing grandmothers was diagnosed with Alzheimer’s. She had taught me so much. She would never understand my life’s calling: the design and application of prediction algorithms. It was too late for her. But it did not have to be too late for the rest of my family and everyone else in my life.
So I started writing. It was embarrassingly bad. I piled up draft version after draft version. Reading my first version made me so ashamed that it took me a week to get back to it. I filled a spiral-bound notebook with diagrams and chapters. I focused on my work at Auto1 and left my book project to the side.

In April 2025, I broke my collarbone playing a game of spikeball. For anyone who doesn’t know spikeball, people generally don’t break bones. I had to undergo two surgeries with general anaesthesia.
Being an optimist, I contemplated the possibility of not waking up after the operation. I was very satisfied with my life. My only regret was that I had not shared the beauty of Machine Learning with enough people. The day before the surgery, I typed a blog article on the topic: a gentle introduction to ML. This would have to do in the absence of a book. I shared it with my dad and friends.
As most would have expected, I woke up from the surgeries, determined not to waste any more time. I would get to the office early and write for 25 minutes before the workday. Draft after draft, I got to a working version.
I reviewed it a few times. Just before finishing it, I lost faith in the idea. I dropped the project and procrastinated for about 4 months. I focused on recovery, working, and enjoying life.
Then in December 2025, it was cold, and I had a bit of time. I decided to stop procrastinating and finish what I had started. I published the book with GitHub Pages and shared it on Reddit. I expected to have my post fall quietly into the existential vacuum of the internet. To my surprise, the post was upvoted and shared more than 500 times, with very positive feedback.
Feedback
A few users asked me where they could buy it. At first, I did not get the question. The book was available for free on the internet. Why would you want to buy it?
This got me thinking, what if I could share this book in print? A project becoming a physical object. I started liking the idea.
I then asked Gemini for options. This was the first time I was hearing about Amazon Kindle Direct Publishing (Amazon KDP). I do not think that I would have felt confident going ahead with this option without the support of LLMs at every step of the way.
With KDP, I could distribute my book on Kindle and in print. I did not have to worry about printing copies, paying anything in advance, or shipping them.
I still needed to generate a print-ready PDF and an EPUB file for Kindle.
The only artefact I had at this point was an online book hosted on GitHub Pages. There was still a lot to do. Or so I thought.
Book as code
I had written the book with Quarto, a static site generator. This is what I use for this blog, and I was already familiar with this technology.
This is an example of what the book definition would look like in a _quarto.yml file. Each of these links leads to chapter-specific markdown files.
project:
type: book
output-dir: docs
book:
title: "Machine Learning Intuition"
author: "Eliott Kalfon"
date: "1/04/2026"
chapters:
- text: "Epigraph"
file: epigraph.qmd
- index.qmd
- part: "Introduction to Machine Learning"
chapters:
- intro.qmd
- chapters/defining-prediction.qmd
- chapters/types-ml.qmd
- chapters/ai-ml-ds.qmd
- chapters/data-space.qmd
- chapters/distance.qmd
It turns out that I could use the same source code to generate a print-ready PDF and an EPUB. This blew my mind. Beyond infrastructure as code, I had stumbled upon “book as code”. I love code, and I love version control.
When you write a Microsoft Word document, you write the content of the document and manage its formatting by selecting fonts and editing margins. With this approach, I would need one document for each format (EPUB or Print) as the margins and sizes would be different.
What I did instead was to write my book as code using the Quarto markdown syntax. I could then use this source code to generate an ebook, an EPUB, and a print PDF. For each of these, only the format would change; the source would stay the same.
I only picked Quarto markdown as I was already familiar with it (and because I do not like clicks in a commercial UI). There, I got lucky.
Selling the book
This process still took me about three months. By then, the buzz generated by my book had passed. I could see that on the page views. The book was not available for sale when people were reading my book online.

In the weeks leading up to the release, I shared a few posts on LinkedIn and my newsletter. I also set the Kindle price to \(1\) for the first week. The goal was to gather as many early positive reviews as possible. I also bothered most people I knew to get a review from them.
I had read that this was important. In 6 months, I sold about 134 copies of both ebook and print. Basically the next Twilight.

Note that I did not do anything to sell more copies. After the release, I did not post anything on LinkedIn or on my newsletter. Six months later, it is the first time I am referring to it in public.
What about the money?
Publishing a book with Amazon KDP was a way to reach more people. At my small scale, it is definitely not a way to make money. I also happen to live in Germany, a country in which most of this income will be taxed anyway.
Kindle ebook breakdown:
- List price: \(\text{USD } 5.00\)
- Delivery cost: \(\text{USD } 0.60\)
- Royalty base: \(5.00 - 0.60 = 4.40\)
- KDP Royalty 70%: \(0.70 \cdot 4.40 = 3.08\)
Print book breakdown
- List price: \(\text{USD } 12.00\)
- 60% Share (\(0.60 \cdot 12.00\)): \(\text{USD } 7.20\)
- Print Cost (As specified): \(-\text{USD } 4.00\)
- KDP Royalty (\(7.20 - 4.00\)): \(\text{USD } 3.20\)
Removing taxes and fees, this gets to just above \(\text{USD } 1\) per copy sold. 100% worth it, but you have to enjoy the process. Intrinsic motivation is key.
Looking back
I would have procrastinated less. It feels so good to share a finished project with the world. The feedback I got from readers warmed my heart. This book is a tangible reminder that I can do things that help others in this world.
When I talk about Machine Learning at work, I can just point people to a chapter or the entire book. It is a bit pedantic, but it saves me a lot of time. I can now also write blog posts on more technical topics without having to go through the basics or adding links to dry Wikipedia pages. Wikipedia is great, and I would recommend donating a small amount every year.
On a personal level, writing is a way of thinking, of making sure that I fully understand what I am talking about. I remember having difficulty explaining what the Gini impurity coefficient was. If you can’t explain it, you probably don’t know it well enough. After years of building Machine Learning solutions in the industry, this was a humbling experience.
If this story made you curious, you can find my book here. If you do not like Amazon, it is also available on Gumroad.
Have you considered writing? What has been holding you back?
