# karukan | Hitoshi Togasaki | Knowledge Base | Instagit

Japanese Input Method System for Linux, macOS, Neural Kana-Kanji Conversion Engine

GitHub Stars: 643

Repository: https://github.com/togatoga/karukan

---

## Articles

### [How Karukan's JSON-RPC Protocol Handles Sync vs Async Communication](/togatoga/karukan/json-rpc-sync-async-communication-karukan)

Understand how Karukan's JSON-RPC protocol differentiates sync and async communication using the presence or absence of the id field for requests and notifications.

- Tags: internals
- Published: 2026-07-03

### [How Karukan's Learning Cache Eviction Works When Exceeding the Maximum Entries](/togatoga/karukan/learning-cache-eviction-max-entries-karukan)

Discover how Karukan's learning cache evicts entries when exceeding the maximum limit. See how low-scoring items are removed based on recency and frequency.

- Tags: internals
- Published: 2026-07-03

### [JIS かな Key Detection in Karukan: Returning to Hiragana Mode on macOS](/togatoga/karukan/jis-kana-key-detection-hiragana-mode-macos-karukan)

Learn how Karukan on macOS uses JIS かな key detection to seamlessly return to hiragana mode. Understand the event interception and keysym translation that keeps your input smooth and efficient.

- Tags: internals
- Published: 2026-07-03

### [How Karukan Manages and Loads User Dictionaries from defaultuserdict.txt](/togatoga/karukan/user-dictionary-management-loading-karukan)

Learn how Karukan loads and manages user dictionaries from defaultuserdict.txt. Discover how Karukan merges and prioritizes your custom dictionaries for enhanced candidate generation.

- Tags: how-to-guide
- Published: 2026-07-03

### [How Preedit Text Rendering Works with Cursor Position Tracking in Karukan](/togatoga/karukan/preedit-text-rendering-cursor-tracking-karukan)

Understand preedit text rendering and cursor tracking in Karukan. Learn how Japanese text composition achieves precise caret placement using character-based indexing.

- Tags: internals
- Published: 2026-07-03

### [How Shift+Letter Triggers Alphabet Mode Entry on Linux Fcitx5 with Karukan](/togatoga/karukan/shift-letter-alphabet-mode-fcitx5-karukan)

Learn how Karukan on Linux Fcitx5 triggers alphabet mode entry with Shift+letter by bypassing romaji conversion for direct character insertion. Get instant typing.

- Tags: how-to-guide
- Published: 2026-07-03

### [How Candidate Pagination Works in Karukan's IME Engine](/togatoga/karukan/candidate-pagination-ime-engine-karukan)

Discover how Karukan's IME engine uses cursor-based pagination to efficiently manage conversion candidates. Explore wrap-around navigation with fixed-size pages and no memory reallocation.

- Tags: internals
- Published: 2026-07-03

### [How Karukan Determines Adaptive Model Selection Based on Input](/togatoga/karukan/conversion-strategy-adaptive-model-selection-karukan)

Learn how Karukan dynamically selects adaptive models based on runtime token count, candidate count, and latency flags for efficient conversions.

- Tags: deep-dive
- Published: 2026-07-03

### [Understanding the Jinen Format in Karukan: Unicode Tokens for LLM-Based Kanji Conversion](/togatoga/karukan/jinen-format-unicode-tokens-model-inference-karukan)

Discover the Jinen format in Karukan, using special Unicode tokens for efficient LLM-based Kanji conversion with llama.cpp models.

- Tags: deep-dive
- Published: 2026-07-03

### [How Karukan Handles Surrounding Text for Context-Aware Conversion with Left Context (lctx)](/togatoga/karukan/surrounding-text-context-aware-conversion-lctx-karukan)

Discover how Karukan leverages left context (lctx) to enhance context-aware text conversion. Learn how it builds and processes surrounding text for smarter language models.

- Tags: deep-dive
- Published: 2026-07-03

### [How Incremental Rechunking with ChunkPlan Optimizes Live Conversion Performance in Karukan](/togatoga/karukan/incremental-rechunking-chunkplan-performance-karukan)

Discover how Karukans ChunkPlan optimizes live conversion performance with incremental rechunking. Minimize reconversion work and keep latency low for faster edits.

- Tags: performance
- Published: 2026-07-03

### [How Karukan Supports Emoji Input: Kana Readings and Slack-Style :trigger: Queries](/togatoga/karukan/emoji-input-kana-slack-trigger-karukan)

Discover how Karukan supports emoji input with kana readings and Slack style :trigger: queries via its unified EmojiRewriter and pre-computed lookup tables.

- Tags: deep-dive
- Published: 2026-07-03

### [Candidate Priority Order in Karukan's IME: Learning, User Dict, Model, System Dict, Rewriter](/togatoga/karukan/candidate-priority-order-karukan-ime)

Understand Karukan's IME candidate priority order: Learning, User Dict, Model, System Dict, and Rewriter. Discover how your input is prioritized for efficient text prediction.

- Tags: internals
- Published: 2026-07-03

### [How Karukan Builds Its System Dictionary from SudachiDict Using a Double-Array Trie](/togatoga/karukan/system-dictionary-sudachidict-double-array-trie-karukan)

Discover how Karukan builds its system dictionary from SudachiDict with a double-array trie. Learn about efficient dictionary construction for fast prefix matching.

- Tags: deep-dive
- Published: 2026-07-03

### [How Karukan Automatically Downloads and Caches HuggingFace Models on First Run](/togatoga/karukan/huggingface-model-download-cache-karukan-first-run)

Karukan automatically downloads and caches HuggingFace models on first run. Learn how this process streamlines your setup and ensures smooth operation for your neural kana-kanji conversion engine.

- Tags: how-to-guide
- Published: 2026-07-03

### [How the Karukan Swift/InputMethodKit Frontend Communicates with the Engine Process](/togatoga/karukan/swift-inputmethodkit-frontend-engine-communication-karukan)

Learn how the Karukan Swift InputMethodKit frontend communicates with its Rust engine using JSON-RPC over stdio. Understand the core communication mechanism for this macOS input method.

- Tags: internals
- Published: 2026-07-03

### [How Karukan Implements the fcitx5 Linux Frontend Using C FFI and C++ Addons](/togatoga/karukan/fcitx5-linux-frontend-ffi-cpp-addons-karukan)

Learn how Karukan uses C FFI and C++ addons to implement the fcitx5 Linux frontend, seamlessly integrating Rust with the IME logic without duplication. Explore the technical details.

- Tags: deep-dive
- Published: 2026-07-03

### [How the karukan-imserver JSON-RPC 2.0 Protocol Facilitates macOS Frontend Communication](/togatoga/karukan/karukan-imserver-json-rpc-macos-frontend)

Discover how the karukan-imserver JSON-RPC 2.0 protocol simplifies macOS frontend communication. Learn how it enables type-safe language interoperability between Swift and Rust.

- Tags: how-to-guide
- Published: 2026-07-03

### [How Karukan's Live Conversion Chunking Handles Japanese and Non-Japanese Text Boundaries](/togatoga/karukan/live-conversion-chunking-text-boundaries-karukan)

Discover how Karukan's live conversion chunking accurately separates Japanese and non-Japanese text boundaries, preserving original characters for superior neural model processing.

- Tags: internals
- Published: 2026-07-03

### [How Karukan's Learning Cache Works: Recency-Weighted Scoring and TSV Persistence](/togatoga/karukan/karukan-learning-cache-recency-scoring-tsv)

Discover how Karukan's learning cache uses recency-weighted scoring and TSV persistence to efficiently store and retrieve user conversion history.

- Tags: internals
- Published: 2026-07-03

### [How Karukan Implements Romaji-to-Hiragana Conversion Using a Trie and FSM](/togatoga/karukan/romaji-hiragana-conversion-trie-fsm)

Learn how Karukan implements romaji-to-hiragana conversion using a trie and FSM. Discover its two-stage pipeline for efficient and accurate Japanese text input.

- Tags: internals
- Published: 2026-07-03

### [How Karukan's Neural Kana-Kanji Conversion Integrates with llama.cpp for GGUF Inference](/togatoga/karukan/neural-kana-kanji-conversion-llama.cpp-gguf)

Learn how Karukan integrates with llama.cpp using the llama-cpp-2 Rust bindings for efficient GGUF inference. Discover its three-component architecture and IME API for kanji conversion.

- Tags: deep-dive
- Published: 2026-07-03

### [How Karukan’s IME State Machine Transitions Between Empty, Composing, and Conversion States](/togatoga/karukan/ime-state-machine-transitions-karukan)

Learn how Karukan's IME state machine transitions between Empty, Composing, and Conversion states. Understand key presses, candidate generation, and text commits.

- Tags: internals
- Published: 2026-07-03

