惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
Jina AI
Jina AI
月光博客
月光博客
博客园 - Franky
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
有赞技术团队
有赞技术团队
V
V2EX
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
腾讯CDC
D
DataBreaches.Net
Hugging Face - Blog
Hugging Face - Blog
Martin Fowler
Martin Fowler
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
WordPress大学
WordPress大学
C
Check Point Blog
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog

Hacker News

Probed — Talk to Your People HN Work GitHub - Northwood-Systems/foreman: Self-hosted LLM gateway. Cost effective, deterministic, and fast. Secure and private by default. A Visualization Language for the AI Era NoCrap — Neuroscience-Based Recovery Pods GitHub - weirdGuy/kastor: Declarative language and toolchain for AI agents: define agents, tools and prompts in HCL, then compile to frameworks or manage them on hosted platforms with plan/apply semantics. Abralo - Run multiple Claude Code agents in one window GitHub - mehranzand/repofleet: RepoFleet is an issue-centered CLI tool for managing Git workflows across multiple repositories. GitHub - exmergo/dex: Dex is the agent-native analytics engineering toolkit. Point it at your warehouse and your dbt project. It learns the landscape, authors your transformations, and tells you exactly what to fix when the schema drifts. Built for analytics engineers and data engineers who want more out of their coding agent. Pug — Open Source Product Analytics GitHub - instavm/tarit: A hypervisor and sandbox cloud for self-hosted AI agents and RL Chiptune Radio — Aleph Void, LLC Free Mermaid Live Editor & Diagram Maker GitHub - Salnika/dejavu: Stop showing coding agents the same command output twice. GitHub - hirasso/html-obfuscator: Obfuscate emails, phone numbers, and other sensitive data in PHP. Invisible to humans, hidden from bots until they interact. Davit — a native macOS UI for Apple containers Fenzo AI - The perfect course, every time. HTML Drive — Edit and Publish HTML from Google Drive GitHub - rowboatlabs/rowboat: Open-source AI coworker, with memory ZeroGate | Automated Cluster Scaling A tiny scale-free kernel language — Joa Ebert GitHub - arman-jalili/guardian-framework: Architecture Enforcement Framework for AI-Assisted Development Yamanote.fun PostgreSQL on AWS: Size & Benchmark EC2 Instances GitHub - zqiren/Orbital: the agent that never starts from zero GitHub - Rodiun/frugon: Free, local, open-source LLM cost analyzer — see where your LLM bill leaks, on your machine. Artificiety — A Fantasy World for AI Agents Ex Situ FlexInference: Drop your AI costs today WhimFiles - Find Any File in Seconds
GitHub - Arthur-Ficial/translate: On-device translator fo...
franze · 2026-06-23 · via Hacker News

macOS 26+ Swift 6 License: MIT Tests: 136 On-device

A deterministic, on-device translator for macOS. A UNIX-style command and a drop-in HTTP server for DeepL, LibreTranslate, and Google v2 — all running 100% on-device using Apple's Translation framework.

translate is a tiny macOS CLI built as a UNIX filter: stdin in, stdout out, stderr for errors and optional progress. It uses Apple's on-device Translation framework on macOS Tahoe, auto-detects the source language with NaturalLanguage, reuses a single translation session per run, and batches work wherever possible. With --serve it exposes the same engine over HTTP, byte-compatible with DeepL /v2/*, LibreTranslate /translate /detect /languages, and Google /language/translate/v2/* — so existing client libraries point at it unchanged.

No cloud calls, no API keys, no telemetry, no LLMs, no third-party translation libraries. Apple's Translation framework is a deterministic neural translation engine — same input, same output, every time.

What it is

Mode Command Purpose
UNIX tool translate --to en Pipe-friendly filter, exit codes, JSON/NDJSON output
HTTP server translate --serve Drop-in for DeepL, LibreTranslate, Google v2 clients

Requirements

  • macOS 26 Tahoe or newer
  • Apple silicon Mac
  • Swift 6 toolchain (Command Line Tools with the macOS 26.4 SDK)
  • Translation language models installed — see docs/install-translation-models.md

Install

git clone https://github.com/Arthur-Ficial/translate.git
cd translate
make install

make install copies the release binary to /usr/local/bin/translate and creates the short alias /usr/local/bin/ueb.

Quick Start: UNIX tool

echo "hallo welt" | translate --to en
translate --to de "hello world" "good night"
pbpaste | translate --to en | pbcopy
translate --to ja --format ndjson < sentences.txt | jq -r .dst
translate --install de-en
translate --detect-only < unknown.txt

Quick Start: HTTP server

translate --serve --port 8989

DeepL

Drop-in for DeepL clients (Python deepl, Node deepl-node):

import deepl
translator = deepl.Translator("any-token", server_url="http://localhost:8989")
print(translator.translate_text("Hallo Welt", target_lang="EN"))
curl -s -X POST http://localhost:8989/v2/translate \
  --data-urlencode "text=Hallo Welt" \
  --data-urlencode "target_lang=EN"
# {"translations":[{"detected_source_language":"DE","text":"Hello World"}]}

LibreTranslate

Drop-in for LibreTranslate clients (libretranslatepy, raw requests):

import requests
r = requests.post("http://localhost:8989/translate",
                  json={"q": "Hallo Welt", "source": "auto", "target": "en"})
print(r.json())
# {"detectedLanguage":{"confidence":97,"language":"de"},"translatedText":"Hello World"}

Google Cloud Translation v2

Drop-in for the v2 REST API. Override the base URL in your client.

curl -s -X POST "http://localhost:8989/language/translate/v2" \
  --data-urlencode "q=Hallo Welt" \
  --data-urlencode "target=en"
# {"data":{"translations":[{"detectedSourceLanguage":"de","translatedText":"Hello World"}]}}

Options

Flag Meaning
--to <lang> Target language, e.g. en, de, ja, de-AT
--from <lang> Source language; skips auto-detection
--detect-only Print detected language and confidence, then exit
--format <mode> plain (default), json, ndjson
--preserve-newlines Preserve newline structure; default
--no-preserve-newlines Allow paragraph-level reflow
--batch Treat each stdin line as an independent unit
--file <path> Translate a UTF-8 file; repeatable
--install <pair> Prepare/download a pair such as de-en
--installed List installed language pairs
--available List supported language pairs
--no-install Fail with exit 4 if a required model is missing
--langs <a,b,c> Detection hints for short ambiguous input
--quiet Suppress progress on stderr
--serve Run as HTTP server
--port <n> Server port (default 8989)
--host <addr> Server bind address (default 127.0.0.1)
--api-key <k> Optional client auth token

Why on-device?

On-device translation keeps source text local, reduces latency, works offline after models are installed, and needs no API key, account, usage quota, proxy, or billing setup. It is also easier to script safely: the same input, model version, and flags produce byte-stable output without a remote service changing behavior between runs.

Model management

translate --install de-en      # prepare a pair
translate --installed          # list installed pairs
translate --available          # list supported pairs on this OS

For scripts, prevent automatic model preparation:

translate --from de --to en --no-install < input.txt

If the model is missing, the command exits with code 4.

Protected text

translate does not translate fenced code blocks, inline backtick spans, URLs, or email addresses. Those spans pass through unchanged.

Exit codes

Code Meaning
0 OK
1 input or usage error
2 translation failure
3 unsupported OS
4 model not installed and --no-install set
5 unsupported language pair

Testing

make test                  # unit + Swift HTTP integration tests
make test-real-clients     # exercise the server with real Python clients
                           # (deepl, libretranslatepy, requests, google-cloud-translate)

The unit suite drives every codec and every endpoint via real loopback HTTP. The real-client suite proves drop-in compatibility with three production translation APIs.

See EXAMPLE.md for end-to-end CLI and server scenarios.

Benchmarks

Reference targets on Apple silicon with installed low-latency models:

Scenario Target
Cold start, installed model < 200 ms
Batch short sentences ≥ 500 sentences/sec
Typical resident memory < 300 MB
Network calls during translation 0

License

MIT — see LICENSE.