hime

An AI-native input method for Chrome: type English anywhere, get natural Japanese inline. Grew into a full streaming translation layer for the browser.

Typing Japanese when you speak it conversationally but can’t write kanji fluently means living in a copy-paste loop with a translate tab, like it’s 2009. Hime fixes that where you type. Hit a hotkey in any text field, and your English is replaced inline with natural Japanese, register matched: casual English becomes casual Japanese, business English becomes 敬語.

An English business email drafted in a Japanese compose form

The same field after one hotkey: polite keigo Japanese, replaced inline with undo preserved

It grew well past the input method. Hime now translates whole pages in place with streaming per-node paint, back-translates search results as they arrive, OCRs and overlays image text, and carries translate intent across a clickthrough so the destination page arrives already translated. All of it bring-your-own-key with zero backend: the service worker owns every network call and keys never touch the page.

A Japanese technical article, translation streaming in with live progress

The same page fully rewritten in English, layout untouched, one click back to the original

Under the hood

Streaming JSON from an LLM into a live page rewrite is a parsing problem in disguise. Hime hand-rolls an incremental extractor that only paints a value once its closing quote is structurally confirmed by backslash-run parity, so multibyte Japanese never tears mid-glyph. The timeout numbers are measured rather than assumed: Chrome’s service-worker kill timer was traced over CDP and the per-attempt deadline locked at 25 seconds, with primary-to-backup model failover that only re-sends failed batches.

Testing this honestly required a live harness: a zero-dependency Node script that launches headless Chrome, attaches the DevTools Protocol to both the page and the extension service worker, injects config into the extension’s own storage, and streams every console line from both worlds into one log. It caught two production defects that all 389 unit tests at the time missed.

The live-capture harness driving a real translation round-trip, page and service-worker logs interleaved

Work quantified

Eight shipped milestones, 30 phases, 449 tests in about 20 seconds, zero runtime dependencies.

The full suite: 449 tests, 446 passing, 3 skipped, zero failures

← All projects