Skip to main content

Interactive CLI for kenkui — convert ebooks to audiobooks locally

Project description

kentui

Python Platform License PyPI

Freaky fast audiobook generation from ebooks. No GPU. No nonsense.

kentui is the interactive CLI for kenkui — an ebook-to-audiobook converter powered by Kyutai's pocket-tts, running entirely on CPU.

kentui handles the interactive parts: configuration wizard, voice management, chapter selection, and progress display. The actual conversion engine is kenkui, which kentui depends on.


✨ Features

  • Freaky fast audiobook generation
  • No GPU needed, 100% CPU
  • Super high-quality text-to-speech
  • Interactive hub with live status panel and Escape to go back
  • Multi-voice narration — different voices for different characters, powered by an LLM
  • Chapter-voice mode — assign a distinct voice to each chapter
  • Voice pool template — persistent global defaults for automatic voice assignment
  • Credits chapter — synthesized audio appended to every m4b
  • Three tiers of voices: compiled, built-in, and custom
  • Flexible chapter selection with presets and manual override
  • Broadcast-quality audio post-processing chain
  • Supports EPUB, MOBI/AZW, and FB2

🚀 Quick Start

Requirements

  • Python 3.12+

Install

pip install kentui

Or with uv / pipx:

uv tool install kentui
pipx install kentui

Compiled voices (~36 MB) are downloaded automatically the first time you run a conversion. Voice and cache maintenance live in kentui system.

Run

kentui book.epub

That's it. An interactive wizard walks you through the setup, then kentui runs the job and shows a live progress bar. You'll get a book.m4b alongside your ebook when it's done.


📚 Usage

Interactive wizard (default)

kentui book.epub

Opens a configuration hub showing a live status panel of your current settings, then a menu:

┌─ Current Settings ───────────────────────────────────────────┐
│  Mode:          Multi-voice                                   │
│  NLP:           Anthropic · claude-haiku-4-5                 │
│  TTS Provider:  pocket-tts · local                           │
│  Narrator:      sarah                                         │
│  Chapters:      content-only (42 selected)                   │
│  Quality:       temp 0.8 · 30 LSD steps · 96k               │
└───────────────────────────────────────────────────────────────┘

  > Submit Job
    Narrator Voice →
    Chapters →
    Narration Mode →
    Series →
    Advanced Options →
    Cancel

Press Escape at any step to go back. All settings persist to ~/.config/kenkui/last_job_profile.toml and pre-load on the next run.

Headless mode

Pass a config file with -c to skip the wizard entirely:

kentui book.epub -c my-config.toml

Exits 0 on success, 1 on failure.

System manager

kentui system

Opens the maintenance hub for voice and cache management. This keeps the public CLI small while preserving advanced workflows inside the app.


🎙️ Narration Modes

Single voice

The default. One voice narrates everything.

Multi-voice (character narration)

kenkui uses an NLP pipeline to identify characters and assigns each a distinct voice. The narrator gets its own voice too.

Two NLP backend families are available: Ollama (local, default) and cloud providers (Anthropic, OpenAI, Google, OpenRouter, or LiteLLM).

Ollama (default)

Requirements:

  • Ollama running locally (ollama serve)
  • NLP model pulled (default: llama3.2) — ollama pull llama3.2
  • spaCy model — downloaded automatically if missing

Cloud providers

Run kentui config and answer yes to "Configure a cloud NLP provider API key?" to set up credentials.

Default models:

Provider Default model
anthropic claude-sonnet-4-6
openai gpt-4o
google gemini/gemini-2.0-flash
openrouter anthropic/claude-sonnet-4-6
litellm anthropic/claude-sonnet-4-6

How voice assignment works:

After the scan completes, voices are assigned using a three-tier priority system:

  1. Series record — named character → pinned voice (highest priority)
  2. Voice pool template — role + gender + rank → voice
  3. Round-robin pool — any remaining characters

Chapter-voice mode

Assign a distinct voice to each chapter. The wizard presents each chapter title and lets you pick a voice.


🗂️ Voice Pool Template

The voice pool template (~/.config/kenkui/voice_pool.toml) pre-assigns voices by character role, gender, and rank. It applies automatically to every multi-voice job.

[protagonist.male]
1 = "david"
2 = "james"
pool = ["oliver", "ethan"]

[protagonist.female]
1 = "sarah"
pool = ["emma", "claire"]

[supporting.male]
pool = ["oliver", "ethan", "marcus"]

[minor]
pool = []  # fallback: any non-excluded voice

🎙️ Voice System

Voices come in three tiers:

Tier Source Auth required?
Compiled Downloaded from HuggingFace on first run No
Built-in Pocket TTS defaults bundled by kenkui No
Custom User-provided prompt sources compiled locally No

Built-in voices:

alba, marius, javert, cosette, jean, fantine, eponine, azelma,
anna, vera, charles, paul, george, mary, jane, michael, eve,
bill_boerst, caro_davy, peter_yearsley, stuart_bell

Voice manager

kentui system

Launches the interactive system manager. From there you can browse and audition voices, manage the exclusion pool, and inspect cache state.


⚙️ Configuration

# Create or edit the default config
kentui config

# Create a named config profile
kentui config fast-mode

# Use a named config
kentui book.epub -c fast-mode

Key settings

Key Default Description
workers cpu_count - 2 Parallel TTS worker processes
m4b_bitrate 96k Output audio bitrate
temp 0.7 Sampling temperature
lsd_decode_steps 1 LSD decode steps (higher = better quality, slower)
default_voice alba Fallback voice
default_chapter_preset content-only Default chapter filter preset
pause_line_ms 800 Pause between lines (ms)
pause_chapter_ms 2000 Pause between chapters (ms)
pause_scene_break_ms 4000 Pause at scene breaks (ms)
nlp_provider ollama NLP backend
nlp_model llama3.2 Model for speaker attribution
credits_enabled true Append synthesized credits audio

📖 Chapter Selection

Preset Description
content-only Body chapters only (default)
chapters-only Titled chapters only
with-parts Chapters and part headings
all Every item in the ebook
none Skip everything

After selecting a preset, the wizard shows a checkbox list of all chapters with the preset's defaults pre-selected.


🔊 Audio Post-Processing

kenkui applies a broadcast-quality effects chain: noise reduction → high-pass filter → low shelf EQ → presence boost → de-esser → compressor → limiter → autogain. All parameters are configurable via kentui config.


FAQ

Do I need a GPU? No. kenkui is 100% CPU-based.

What ebook formats does it support? EPUB, MOBI/AZW/AZW3/AZW4, and FB2.

What output format does it use? M4B, with chapters, metadata, and embedded covers.

Do I need Ollama for multi-voice? No. You can use Ollama locally or a cloud provider such as Anthropic, OpenAI, Google, OpenRouter, or LiteLLM. Run kentui config to set up provider credentials and defaults.

Does it upload my books anywhere? With the default Ollama backend: no. With a cloud NLP provider, the book text is sent to that provider's API for the character scan. Nothing else is uploaded.


🙏 Special Thanks

Thanks to Project Gutenberg for providing some of the public-domain books included with kenkui.


Voice Dataset Credits

kenkui's compiled voices are derived from two publicly available speech corpora.

CSTR VCTK Corpus

Veaux, Christoph; Yamagishi, Junichi; MacDonald, Kirsten. (2019). CSTR VCTK Corpus: English Multi-speaker Corpus for CSTR Voice Cloning Toolkit. University of Edinburgh. The Centre for Speech Technology Research (CSTR).

Licensed under Creative Commons Attribution 4.0 (CC BY 4.0). Commercial use is permitted with attribution.

EARS Dataset

Licensed under Creative Commons Attribution-NonCommercial 4.0 (CC BY-NC 4.0).

Note: Compiled voices sourced from EARS (identifiable by EARS in the voice name in the system voice manager) may not be used for commercial purposes. If you are building a commercial product with kenkui, use only VCTK-sourced or built-in voices.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kentui-0.2.0.tar.gz (91.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kentui-0.2.0-py3-none-any.whl (79.7 kB view details)

Uploaded Python 3

File details

Details for the file kentui-0.2.0.tar.gz.

File metadata

  • Download URL: kentui-0.2.0.tar.gz
  • Upload date:
  • Size: 91.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for kentui-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ef02b0604c6cf63b457d9034423a23266acc208d6a7fbb79c98544f0e7d2da27
MD5 c3937ff47c313ef6d41baf3b5997dad8
BLAKE2b-256 255ec281657844a9788a26d27493f898979070eb3f8e98cb9d5bd38ef2baa774

See more details on using hashes here.

File details

Details for the file kentui-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: kentui-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 79.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for kentui-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c2ae0e1212f05c01d8115f748a7cd940f21c9ad393067c0452733c9cbed9f61
MD5 b0c729a2a37f883402b95abb76056c39
BLAKE2b-256 9604650f175e26b40355ea79347a8810efb66824f1b037668f28a12649004190

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page