Loqui includes a Humanize writing workspace at /humanize: a meaning-preserving rewrite tool with conversational, crisp, warm, and polished voices, plus optional writing-sample matching. A compact editorial rubric removes recurring AI-writing patterns, while deterministic checks protect facts and intent. The same validated engine is available to AI agents through a local MCP server. It reuses the existing Groq and Cerebras model routing; configure either provider key as usual.
Instant streaming voice translation across 9 languages — German, English, Ukrainian, French, Polish, Spanish, Latin, Italian, and Swedish — speak in any of them, get a live translation in another, routed through ultra-fast LLMs (Cerebras, Groq, Google Gemini, OpenAI). Optional server-side speech recognition (Whisper) and voice dubbing (OpenAI TTS) make it work in any browser.
See plan.md for the architecture write-up.
- Any-direction translation among 🇩🇪 German, 🇬🇧 English, 🇺🇦 Ukrainian, 🇫🇷 French, 🇵🇱 Polish, 🇪🇸 Spanish, 🏛️ Latin, 🇮🇹 Italian, and 🇸🇪 Swedish, with an Auto source mode that detects the spoken language for you.
- Live streaming — finalized speech streams token-by-token; interim speech gets a debounced preview. Per-segment time-to-first-token is shown (typically ~150–300 ms).
- Two voice-input engines — ⚡ Live (browser Web Speech API, lowest latency, Chrome/Edge) and ☁️ Whisper (server-side speech-to-text, works in any browser). Typed input works too.
- Voice playback / dubbing — 🔊 speaks any translation, and an auto-play toggle dubs each segment as it finishes. Uses server-side OpenAI TTS when configured, with a browser voice fallback.
- Multi-model routing — every provider is driven through one OpenAI-compatible streaming client; adding a model is a one-entry change to the registry. Models auto-enable per API key.
- External displays — a 📺 Send to display toggle broadcasts each translation over SSE
(
/api/display/stream) to any connected display client: the fullscreen/displaysubtitle page (tablet or kiosk browser parked at the TV), or a Raspberry Pi–driven LED matrix ticker (hardware guide + client indisplay-client/). - Chat history — sign in with GitHub and sessions are saved; browse/delete on
/history. - Evals —
/evalsscores translation quality across models (chrF + optional LLM-as-judge) and validates speech recognition with a read-aloud word-error-rate test. - Light / dark / system theme switcher.
Next.js 15 (App Router) · React 19 · TypeScript · Tailwind CSS · Auth.js (NextAuth v5) · SQLite (better-sqlite3).
npm install
cp .env.example .env # add at least one provider key (see below)
npm run dev # http://localhost:3000Voice input works best in Chrome or Edge; the ☁️ Whisper engine works anywhere (needs OPENAI_API_KEY).
| Variable | Purpose |
|---|---|
AUTH_SECRET |
Auth.js secret — generate with npx auth secret |
AUTH_GITHUB_ID / AUTH_GITHUB_SECRET |
GitHub OAuth app (callback: <origin>/api/auth/callback/github) |
CEREBRAS_API_KEY |
Cerebras — Gemma 4 31B, GPT-OSS 120B (ultra-fast) |
GROQ_API_KEY |
Groq — Llama 3.1 8B Instant, Llama 3.3 70B |
LOQUI_HUMANIZE_MODEL |
Optional server-side preferred Groq/Cerebras model ID for MCP humanization |
GOOGLE_AI_API_KEY |
Google — Gemini 3.1 Flash Lite, Gemini 2.5 Flash |
OPENAI_API_KEY |
OpenAI — GPT-4o mini translation, Whisper STT and TTS dubbing |
LOQUI_DB_PATH |
Optional — SQLite path (default ./data/loqui.db) |
LOQUI_DISPLAY_TOKEN |
Optional — shared secret for the external-display feed (/api/display/stream) |
Set at least one provider key — models auto-enable based on which keys are present.
Server-side speech-to-text and text-to-speech require OPENAI_API_KEY. The demo works without
signing in; GitHub login is only needed to save history.
The local stdio MCP server exposes humanize_text, humanize_batch, and
validate_humanization. It loads Loqui's normal server-only environment configuration, emits
only MCP frames on stdout, and neither logs nor stores submitted text.
npm run mcpSee docs/mcp.md for client configuration, complete schemas, examples, privacy behavior, and troubleshooting.
With Groq or Cerebras configured, run the built-in reference set against each enabled humanization model:
npm run eval:humanizerThe command compares the same prompt with and without the adapted rubric, then writes a local
JSON record under data/evals/. Each model/variant summary includes reference chrF,
fact-preservation and editorial pass rates, errors, and end-to-end latency. Use
npm run eval:humanizer -- --output path/to/report.json to select another output path.
Loqui ships with railway.json (Nixpacks). To deploy:
- Create a project and service, and attach a volume mounted at
/dataso the SQLite database persists across redeploys. - Set
LOQUI_DB_PATH=/data/loqui.db,AUTH_SECRET, and your provider keys. - Deploy (
railway up, or connect the GitHub repo).next startbinds to Railway's$PORT.
Any Node host works; on ephemeral/serverless platforms, swap src/lib/db.ts for Postgres or Turso
(the storage interface is intentionally small).
npm run dev # dev server
npm run build # production build
npm start # run the production build
npm run lint # lint
npm run mcp # local stdio MCP server
npm run eval:humanizer # baseline-vs-rubric quality and latency record
npm test # unit and MCP integration tests
npm run typecheckContributions are welcome — see CONTRIBUTING.md and our Code of Conduct.
MIT © Ruslan Strazhnyk
See THIRD_PARTY_NOTICES.md for adapted third-party material.