cat articles/mac-translate-cli-trn

trn: A Fast Local Translation Command for macOS Tahoe

After updating my Mac to macOS Tahoe 26, I became interested again in the APIs behind Apple's on-device intelligence features. Apple Intelligence is the visible product name, but the more interesting part for developers is that some of the underlying system capabilities are exposed as ordinary frameworks.

Translation is one of those capabilities. On Tahoe, the Translation framework can use two different strategies: a low-latency path and a high-fidelity path that uses Apple Intelligence when available. I wanted to see how practical that was from a small local tool, so I built mac-translate-cli.

It provides a command named trn.

What trn Does

trn is deliberately small. It only translates text. It uses the macOS built-in Translation framework and exposes it as a command-line tool.

On macOS Tahoe 26.4 or later, it can be installed with Homebrew:

brew tap hotchpotch/mac-translate-cli https://github.com/hotchpotch/mac-translate-cli
brew install hotchpotch/mac-translate-cli/trn

Basic usage:

trn --to ja "Hello world!"
#=> こんにちは、世界!

It also reads from standard input:

echo "Hello world!" | trn --to ja
cat notes.txt | trn --to en
pbpaste | trn --to ja | pbcopy

When --from is omitted, trn detects the source language from the input. Longer input is split into chunks, translated concurrently, and written back in the original order. The default concurrency is 4.

The command depends on the language packages installed in macOS. If a required package is supported but missing, trn reports that it should be installed from System Settings.

Why low Is the Default

trn has two quality modes:

trn --from en --to ja --quality low "Hello world!"
trn --from en --to ja --quality high "Hello world!"

low is the default. It uses Apple's lower-latency traditional translation models. high uses Apple Intelligence high-fidelity translation when available.

I initially expected high to be the obvious default. After checking English/Japanese translation quality and speed, I changed my mind. The qualitative results were not simply "high is better." In a small hand-checked evaluation, direct English/Japanese translation averages were almost the same:

Directionhigh averagelow average
English to Japanese3.83 / 53.84 / 5
Japanese to English4.35 / 54.32 / 5

The details are in the translation quality report. It is not a comprehensive benchmark, but it was useful for making the default choice. low was sometimes better on practical terminology, including some finance and software examples. high was not uniformly better.

Neither mode should be trusted blindly. Proper names, roles, honorifics, and long round trips still produced drift and broken fragments. For publication, legal, financial, education, emergency, or other sensitive text, the output needs human review.

For ordinary English/Japanese translation, though, low was good enough often enough, and the speed difference was too large to ignore.

Speed

I translated the current mac-translate-cli README.md from English to Japanese five times for each quality mode.

ItemValue
MachineMacBook Pro, Mac16,5
ChipApple M4 Max
CPU16 cores: 12 performance cores and 4 efficiency cores
Memory128 GB
OSmacOS 26.5
trn0.1.2
InputREADME.md, 5,591 characters / 5,924 bytes
Commandtrn --from en --to ja --quality <low|high> < README.md
Concurrencydefault, 4
QualityMean wall timeInput speedRelative speed
low3.560 s1,570.6 chars/s11.91x faster
high42.383 s131.9 chars/s1.00x

For this README-sized input, low felt like a normal local utility. high felt like invoking a much heavier model. That is why trn defaults to low, while still keeping high available when I want to compare whether the high-fidelity path helps a specific text.

What This Suggests About the Mac

The interesting part of trn is not the CLI itself. It is that a system-level on-device model can be exposed through a tiny tool and still feel fast enough to use casually.

This does not mean local models replace large cloud models. Remote LLMs are still much stronger for many tasks. But smaller local models are becoming practical, even around the 1B-parameter scale, and Apple can optimize the hardware, OS, model runtime, and application APIs together.

Compared with buying expensive NVIDIA GPUs, a Mac is not cheap, but it is also not an exotic machine. Many developers already use one. If useful local models continue to become available at the OS level, and if normal apps and small tools can call them with low friction, that is a strong direction for the Mac as an edge machine-learning platform.

trn is a small example: a focused local tool, backed by system-level machine learning, that improves everyday UX without requiring a remote service.

cat related_articles/mac-translate-cli-trn.yaml

  1. Releasing a Japanese StaticEmbedding Model for Practical 100x Faster Text EmbeddingsI released static-embedding-japanese, a fast non-Transformer embedding model for Japanese and English text, and evaluated it on JMTEB.
  2. Releasing Small, Fast, and Practical Japanese Rerankers: tiny, xsmall, small, and base v2I released tiny, xsmall, small, and base v2 Japanese rerankers designed for practical CPU and Apple silicon latency with competitive quality.
  3. Building a Machine Learning PC with Two RTX 5090 GPUsNotes from building a two RTX 5090 machine learning PC in Japan, including power supply constraints, cooling, parts, and multi-GPU training tradeoffs.