←back to thread

Web Translator API

(developer.mozilla.org)
97 points kozika | 1 comments | | HN request time: 0.276s | source
Show context
rhabarba ◴[] No.44375303[source]
You had me at "Browser compatibility".
replies(2): >>44375411 #>>44377716 #
Raed667 ◴[] No.44375411[source]
Chrome embeds a small LLM (never stops being a funny thing) in the browser allowing them to do local translations.

I assume every browser will do the same as on-device models start becoming more useful.

replies(2): >>44375422 #>>44375891 #
Asraelite ◴[] No.44375891[source]
What's the easiest way to get this functionality outside of the browser, e.g. as a CLI tool?

Last time I looked I wasn't able to find any easy to run models that supported more than a handful of languages.

replies(6): >>44376224 #>>44376260 #>>44376411 #>>44376506 #>>44378599 #>>44380230 #
JimDabell ◴[] No.44376411[source]
That depends on what counts as “a handful of languages” for you.

You can use llm for this fairly easily:

    uv tool install llm

    # Set up your model however you like. For instance:
    llm install llm-ollama
    ollama pull mistral-small3.2

    llm --model mistral-small3.2 --system "Translate to English, no other output" --save english
    alias english="llm --template english"

    english "Bonjour"
    english "Hola"
    english "Γειά σου"
    english "你好"
    cat some_file.txt | english
https://llm.datasette.io
replies(2): >>44376778 #>>44377999 #
usagisushi ◴[] No.44376778[source]
Tip: You might want to use `uv tool install llm --with llm-ollama`.

ref: https://github.com/simonw/llm/issues/575

replies(1): >>44376958 #
1. JimDabell ◴[] No.44376958[source]
Thanks!