| 1 | <div align="center"> |
| 2 | |
| 3 | # Elffuss Translator |
| 4 | |
| 5 | **Real-time conversation translation, 100% in your browser.** |
| 6 | |
| 7 | It listens, tells speakers apart, translates and speaks back. |
| 8 | No server, no account, no paid API — nothing you say ever leaves your machine. |
| 9 | |
| 10 | [**▶ Open the app**](https://translator.elffuss.com) · [Elffuss](https://elffuss.com) · Apache-2.0 |
| 11 | |
| 12 | </div> |
| 13 | |
| 14 | > Elffuss Translator now lives in the UtopiaIA organization on GitHub, at github.com/utopia-ia/elffuss-translator. It moved from github.com/KikoCis/elffuss-translator on 23 October 2026; the old address redirects. |
| 15 | |
| 16 | --- |
| 17 | |
| 18 | ## Live skills: a meeting facilitator that costs nothing |
| 19 | |
| 20 | The translator does more than translate. It can hand the conversation to |
| 21 | [Elffuss Claw](https://github.com/utopia-ia/elffuss-claw), which runs a **live audio skill** |
| 22 | and works while you talk. Pick one when you hit **Skills en vivo**: |
| 23 | |
| 24 | | | Skill | What it does | |
| 25 | |---|---|---| |
| 26 | | 🎯 | **Sales copilot** | Feeds you the exact line to say and tracks the call's objectives. | |
| 27 | | 📇 | **Customer card** | Fills a customer record by itself from what the client says. Exports to Excel. | |
| 28 | | 🧑🏫 | **Meeting facilitator** | Topics, decisions and action items, live. Exports. | |
| 29 | | 📝 | **Summary & ideas** | A running summary plus the ideas that come up. | |
| 30 | |
| 31 | Each skill paints its own **surface**: a live view that renders *inside the translator*, |
| 32 | next to the subtitles — not just a notification. It updates as the conversation goes on |
| 33 | and, where it makes sense, exports what it captured as a spreadsheet. |
| 34 | |
| 35 |  |
| 36 | |
| 37 | <div align="center"><sub> |
| 38 | |
| 39 | **Staged recreation** of the flow (scripted dialogue and timings), not a screen recording of a live run · |
| 40 | [full video with audio](docs/demo.mp4) |
| 41 | |
| 42 | </sub></div> |
| 43 | |
| 44 | Skills are defined as plain `SKILL.md` files and are **self-editing**: ask in Claw's chat for |
| 45 | "add an email field" or "keep the advice shorter" and the skill rewrites itself. |
| 46 | |
| 47 | ## How the surface gets there |
| 48 | |
| 49 | The two apps live on different origins, so the pipe is `postMessage` with origin checks on |
| 50 | both ends. The skill's view is **projected** from Claw into the translator and rendered in a |
| 51 | sandboxed iframe (`allow-scripts` only — never `allow-same-origin`, so it can't reach back |
| 52 | into the page that hosts it): |
| 53 | |
| 54 | ``` |
| 55 | translator ──[hablante + texto]──▶ Claw ──▶ model ──▶ CONSEJO / DATOS |
| 56 | ▲ │ |
| 57 | └───[surface html + state]────────┘ (rendered sandboxed, right-hand panel) |
| 58 | ``` |
| 59 | |
| 60 | This is written up as a small spec — see **[Skill Surface Protocol](https://github.com/utopia-ia/elffuss-claw)**. |
| 61 | |
| 62 | ## What it does |
| 63 | |
| 64 | - **Conversation mode**: one microphone, hands free. It finds the turns by energy, tells |
| 65 | **who is speaking** from their voice, and routes each turn into the other language. |
| 66 | - **Subtitles** with the original and the translation underneath, growing downward like a real call. |
| 67 | - **Voice**: reads the translation out loud — or mute it and keep translating and subtitling. |
| 68 | - **Half duplex**: it doesn't listen to itself while speaking. Without this it loops, translating its own voice. |
| 69 | - **Battery aware**: pauses in the background and recovers on its own (and never pauses while a live skill is running). |
| 70 | - **Actually offline**: download the models once, they stay cached, and it works with no network. |
| 71 | |
| 72 | ## The stack, all ONNX in the browser |
| 73 | |
| 74 | | Piece | Model | |
| 75 | |---|---| |
| 76 | | **ASR** | `whisper-base` (WebGPU, falls back to WASM) | |
| 77 | | **Diarization** | `pyannote-segmentation-3.0` (speech/silence) + `wespeaker-voxceleb-resnet34-LM` (speaker embeddings) | |
| 78 | | **Translation** | The browser's on-device Translator API, with `opus-mt` (transformers.js) as fallback | |
| 79 | | **Voice** | The system's `speechSynthesis` | |
| 80 | |
| 81 | Runs on [transformers.js](https://github.com/huggingface/transformers.js) and ONNX Runtime Web. |
| 82 | No framework and no build step: HTML and ES modules, served as static files. |
| 83 | |
| 84 | ## Using the diarizer on its own |
| 85 | |
| 86 | `diarize.mjs` is standalone: |
| 87 | |
| 88 | ```js |
| 89 | import { loadDiarizer, diarize, makeSpeakerBook, speakerVec } from './diarize.mjs'; |
| 90 | |
| 91 | const D = await loadDiarizer(transformers, { device: 'webgpu' }); |
| 92 | |
| 93 | // (a) split a recorded clip into turns |
| 94 | const turns = await diarize(D, audio16k); // [{ start, end, speaker }] |
| 95 | |
| 96 | // (b) live: assign each chunk to a stable speaker |
| 97 | const book = makeSpeakerBook({ tau: 0.5, maxSpeakers: 2 }); |
| 98 | const { label } = book.assign(await speakerVec(D, chunk16k)); // 'S1' | 'S2' |
| 99 | ``` |
| 100 | |
| 101 | Segmentation → per-window embeddings → cosine clustering. Two chunks from the same speaker |
| 102 | land around 0.8 similarity; different speakers, about 0.15. |
| 103 | |
| 104 | ## Honest edges |
| 105 | |
| 106 | - **The first load is a download.** You ship the model to the user once; after that it lives in cache. |
| 107 | - **Separating simultaneous voices on a mono mic is not reliable** — the louder speaker dominates the |
| 108 | embedding. Turn-by-turn diarization does work; real overlap needs one capture per speaker. |
| 109 | - **Whisper hallucinates on silence.** There's an energy gate and a filter for the usual filler |
| 110 | ("Subtitles by…"), but some still slips through. |
| 111 | - **Chrome/Edge** for WebGPU. Without it, it falls back to CPU and gets slower. |
| 112 | - Voice quality is whatever the operating system provides, which varies a lot by language. |
| 113 | |
| 114 | ## Files |
| 115 | |
| 116 | | | | |
| 117 | |---|---| |
| 118 | | `index.html` | The whole app: UI, capture, pipeline, live-skill picker and the pipe to Claw. | |
| 119 | | `diarize.mjs` | Diarization engine (segmentation + embeddings + clustering). | |
| 120 | |
| 121 | ## Hosting it yourself |
| 122 | |
| 123 | Static files; any server works. One catch: **`.mjs` must be served as JavaScript**, or the |
| 124 | browser refuses the module. In nginx: |
| 125 | |
| 126 | ```nginx |
| 127 | location ~ \.mjs$ { default_type text/javascript; } |
| 128 | ``` |
| 129 | |
| 130 | Serve it over HTTPS — the microphone and WebGPU require it outside `localhost`. |
| 131 | |
| 132 | ## License |
| 133 | |
| 134 | Apache-2.0. |