Skip to content

Repository files navigation

publish-cli

Live-translate an EPUB on your machine and share a reading link on your local network.

Do you speak english? … I’m french… I’m french

Features

  • Live translation — segments are translated in batches; the shared EPUB updates as work progresses
  • Stable memory — resume later without redoing finished segments (keyed by file + index)
  • LAN share — QR code + tokenized URL; phone browser reader (epub.js)
  • Reading bookmark — last position restored across reloads / new share tokens
  • MLX only — runs via mlx_vlm.server on Apple Silicon

Prerequisites

Need Notes
macOS Apple Silicon MLX is the only backend
Python 3 + mlx-vlm used to serve the model
Rust (stable) only if building from source
python3 -m pip install -U mlx-vlm

What if mlx-vlm is missing?

publish does not bundle models or mlx-vlm. It looks for a python3 that can import mlx_vlm, optionally downloads/verifies weights, then starts python -m mlx_vlm.server.

Situation Behavior
No python3 Fails immediately with install hints
python3 found, no mlx_vlm Fails immediately with pip install mlx-vlm + PUBLISH_PYTHON hint
PUBLISH_PYTHON set but broken Fails immediately
Weights missing Download / verify phase with progress, then server start
Server load Compact loading model … line; details in a size-capped temp log
Something already on the LLM port Reuses it (no spawn)

Install

One-liner (prebuilt binary)

curl -fsSL https://raw.githubusercontent.com/promptegrity/publish-cli/master/install.sh | bash

Installs into ~/.local/bin (override with PREFIX=/usr/local).
Fork: PUBLISH_REPO=you/publish-cli bash …

Supported prebuilds: macOS Apple Silicon, Linux x86_64 (Linux still needs you to run an MLX-capable setup or point at a remote server — primary target is Apple Silicon).

From source

cargo install --path .
# or: cargo install --git https://github.com/promptegrity/publish-cli

Publishing a release (maintainers)

git tag v0.1.1
git push origin v0.1.1

Quick start

--lang is required.

publish translate book.epub --lang fr
publish translate book.epub --lang es

Defaults: LAN share on, keep share until Ctrl-C.

# no LAN share
publish translate book.epub --lang fr --no-share

# translate then exit
publish translate book.epub --lang fr --no-keep-share

# other quant / local path
publish translate book.epub --lang fr \
  --model mlx-community/gemma-4-12B-it-8bit
publish translate book.epub --lang fr \
  --mlx-model ~/models/gemma-4-12B-it-mxfp4

# stats / share only
publish status --epub book.epub
publish share --epub book.epub

Data directory

How Location
Default platform data dir + publish-cli (e.g. ~/Library/Application Support/publish-cli on macOS)
Override --data-dir /path or env PUBLISH_DATA_DIR
<data-dir>/
  epub-memory/<book_id>.json
  epub-work/<book_id>/…

Environment

Variable Purpose
PUBLISH_DATA_DIR Same as --data-dir
PUBLISH_PYTHON Force the Python used for mlx_vlm.server
PUBLISH_MLX_MODEL_PATH Local model directory (must contain config.json)

Architecture (short)

EPUB scan → MLX (OpenAI-compatible HTTP on :8080)
         → memory + live rebuild
         → optional LAN HTTP server + in-browser reader

Limitations

  • Translation quality depends on the local MLX model
  • Respect EPUB / book copyright and licensing
  • LAN share is for a trusted network (URL token, not a public CDN)
  • Cold start can download/load multi‑GB weights

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md.

License

MIT

About

Live-translate an EPUB and share it over your LAN

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages