---
title: "BookVerse AI — Book Summaries That Run Without an API Key"
description: "BookVerse AI by Shreyansh Kumar Singh turns any book into a study guide and tutor — and keeps working with no API key via graceful fallbacks."
url: https://www.shreyanshkumarsingh.com/projects/bookverse-ai-book-summaries
author: Shreyansh Kumar Singh
updated: 2026-10-08
---

# BookVerse AI: step inside any book — even with no API key

By Shreyansh Kumar Singh. Source available on GitHub (proprietary license).

**How can an AI book-summary app keep working when no API key is available?**

BookVerse AI keeps working without an API key by treating the model as optional: with no provider configured it serves grounded, structured previews from an offline path, and when a configured model or database is slow or down, timeouts and a circuit breaker drop it to the fallback instead of hanging. Configure Groq, OpenAI, Gemini or a local Ollama and the same app generates full study guides.

- **API keys required:** 0
- **Model paths:** Groq · OpenAI · Gemini · Ollama (+ offline)
- **Circuit breaker:** Opens after 2 failures, for 30 s
- **Seed library:** 10 public-domain books
- **Stack:** Next.js 16 · TypeScript · Tailwind · zod · SQLite · Supabase · Vitest · Playwright

## The problem it solves

Most AI demos are a single API call wrapped in a UI — remove the key, or let the provider stall, and the whole product is a spinner. A study tool has to be dependable before it can be clever.

## What he built

### A study guide from a title

Enter a book and get a structured summary, chapter breakdown, key lessons, a timeline, a radial mind map, a character map and an AI tutor grounded in the book's content. Ten public-domain books are seeded and served instantly; summaries are paraphrased and transformative, never reproduced text.

### Provider-agnostic AI layer

One provider interface over Groq, OpenAI, Gemini, any OpenAI-compatible endpoint, or local Ollama. A status badge turns green only when the configured model is actually reachable — verified against the provider's model list, not just the presence of a key.

### Untrusted model output, validated

Generated JSON is extracted from prose, then normalised with zod: every field has a fallback, strings and arrays are clamped, and the mind map is repaired so it always has exactly one root. Results are cached so a book is generated once.

## The hardest decision: Degrade honestly instead of failing hard

Every external dependency — hosted database, remote model, session refresh — is wrapped in a timeout and a circuit breaker. A dead Supabase costs about two slow requests per 30-second window and then nothing, because the circuit opens after two consecutive failures and calls go straight to the local SQLite fallback.

The same rule shapes the UI: when the app is running on its offline path it says so, with a badge, rather than passing previews off as model output.

## The result

A Next.js 16 app that runs fully on first `npm run dev` — embedded SQLite, offline AI previews, a localStorage shelf — and scales up to hosted models, Supabase persistence and accounts by adding environment variables, with rate limiting, request-scoped logging and Vitest and Playwright test suites along the way.

Stack: Next.js 16, React, TypeScript, Tailwind, Groq, Ollama

- [Source on GitHub](https://github.com/Shreyanskumarsingh20/BookVerseAi)

---

Shreyansh Kumar Singh — AI & Full-Stack Engineer, Pune, India. Contact: shreyanshkumarsingh208@gmail.com or https://www.shreyanshkumarsingh.com/contact (call and WhatsApp buttons). More: https://www.shreyanshkumarsingh.com/llms.txt · https://www.shreyanshkumarsingh.com/sitemap.xml
