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

推荐订阅源

博客园_首页
H
Help Net Security
腾讯CDC
宝玉的分享
宝玉的分享
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
爱范儿
爱范儿
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
D
Docker
V
V2EX
Last Week in AI
Last Week in AI
G
Google Developers Blog
IT之家
IT之家
C
Check Point Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
GitHub - Arthur-Ficial/translate: On-device translator fo...
franze · 2026-06-23 · via Hacker News: Show HN

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.