/ Модель

Характеристики

Контекст
262 144 токена
Параметры
2,5 млрд
Размер весов
2,4 ГБ
Лицензия
Своя лицензия
Архитектура
plamo3 · dense
Базовая модель
plamo-3-translate-2b
Библиотека
mlx
Опубликована
27 окт 2026

plamo-3-translate-2b-MLX-4bit

Генерация текстаТекст → текст
2 086скачиваний за 30 дней2лайкавеса обновлены19 ноя 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Русское описание этой модели ещё готовится. Пока можно заглянуть в карточку модели от автора ниже.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

PLaMo 3 Translate 2B MLX-4bit

PFN™ translate model

日本語版のREADME / Japanese README

PLaMo 3 Translate 2B MLX-4bit is a version of PLaMo 3 Translate 2B with the weights quantized to 4 bits for MLX. See Choosing a Distribution Format to compare it with the other distribution formats.

PLaMo 3 Translate 2B is a translation-specialized LLM developed by Preferred Networks (PFN) that delivers world-class translation quality. It is built on PLaMo 3 NICT, a pretrained model developed through joint research by PFN and the National Institute of Information and Communications Technology (NICT). We further trained this base model on tens of billions of tokens of translation-focused data. For development details, see the tech blog.

PLaMo 3 Translate 2B supports translation among 53 languages (see Supported Languages). It can also take surrounding context and a glossary into account, and lets you choose between plain and polite style for Japanese output. The maximum length during training was 32,768 tokens for the input and output combined. The model can translate long passages in one go, but split anything longer so that the input and output together stay within this limit.

PLaMo 3 Translate 2B is available under the PLaMo Community License. Personal use, such as learning or hobby projects, and other non-commercial use, including academic use, are free of charge with no prior registration. See License for the terms of commercial use.

Benchmarks

PLaMo 3 Translate delivers world-class quality in both Japanese–English and multilingual translation. Even the 2B model outperforms the translation-specialized LLMs we compared against on every metric in the figure below.

Translation quality of PLaMo 3 Translate, TranslateGemma and HY-MT2

The top row shows Japanese–English translation quality as the average of PFTB, SaaS and WMT24++ COMET-22. The middle row shows translation between Japanese and 14 other languages, and the bottom row between English and 14 other languages, each as the average of FLORES+ chrF++ in both directions. Higher is better for all scores.

For the FLORES+ multilingual evaluation, we selected the following 15 of the 53 supported languages. Translation was evaluated in both directions between Japanese or English and each of the remaining 14 languages.

  • Japanese, English, Arabic, Indonesian, Italian, Dutch, Korean, Spanish, Thai, Chinese (Simplified and Traditional), German, French, Vietnamese, Russian

For details, see the tech blog.

Choosing a Model

Model List

PLaMo 3 Translate comes in four sizes: 0.8B, 2B, 8B and 31B. For each size, quantized and converted variants are provided in separate repositories.

SizeBF16FP8W4A16W4AFP8NVFP4GGUFMLX
0.8BBF16FP8W4A16W4AFP8NVFP4GGUFMLX-4bit
2BBF16FP8W4A16W4AFP8NVFP4GGUFMLX-4bit
8BBF16FP8W4A16W4AFP8NVFP4GGUFMLX-4bit
31BBF16FP8W4A16W4AFP8NVFP4GGUFMLX-4bit

For each model size, the tables compare the translation accuracy of BF16 with that of each distribution format. The value in parentheses under each score is the difference from BF16 of the same size (a negative value means lower accuracy). Higher is better for all scores.

For details on the evaluation metrics, see the tech blog.

Overall, GGUF Q2_K shows lower translation accuracy on some metrics, while the other formats stay close to BF16.

Size is the total size of the weight files.

31B

FormatSize (GB)PFTB (En↔Ja)SaaS (En→Ja)WMT24++ COMET-22 (En→Ja)FLORES+ chrF++ (Ja↔Multilingual)FLORES+ chrF++ (En↔Multilingual)
BF1663.510.62440.57860.879937.8156.61
FP832.310.6240(-0.0004)0.5803(+0.0017)0.8799(0.0000)37.79(-0.02)56.60(-0.01)
W4A1617.190.6258(+0.0014)0.5777(-0.0009)0.8805(+0.0006)37.74(-0.07)56.49(-0.12)
W4AFP817.190.6223(-0.0021)0.5716(-0.0070)0.8813(+0.0014)37.71(-0.10)56.53(-0.08)
NVFP418.660.6258(+0.0014)0.5748(-0.0038)0.8809(+0.0010)37.70(-0.11)56.49(-0.12)
GGUF BF1663.520.6241(-0.0003)0.5793(+0.0007)0.8799(0.0000)37.82(+0.01)56.59(-0.02)
GGUF Q4_K_M19.530.6237(-0.0007)0.5770(-0.0016)0.8810(+0.0011)37.84(+0.03)56.55(-0.06)
GGUF Q3_K_M15.860.6223(-0.0021)0.5780(-0.0006)0.8813(+0.0014)37.78(-0.03)56.54(-0.07)
GGUF Q2_K12.610.6126(-0.0118)0.5745(-0.0041)0.8801(+0.0002)37.36(-0.45)56.16(-0.45)
MLX 4bit18.660.6222(-0.0022)0.5779(-0.0007)0.8800(+0.0001)37.82(+0.01)56.58(-0.03)

8B

FormatSize (GB)PFTB (En↔Ja)SaaS (En→Ja)WMT24++ COMET-22 (En→Ja)FLORES+ chrF++ (Ja↔Multilingual)FLORES+ chrF++ (En↔Multilingual)
BF1617.060.61190.57500.880537.4556.22
FP89.410.6123(+0.0004)0.5764(+0.0014)0.8805(0.0000)37.40(-0.05)56.17(-0.05)
W4A165.710.6114(-0.0005)0.5749(-0.0001)0.8789(-0.0016)37.36(-0.09)56.19(-0.03)
W4AFP85.710.6174(+0.0055)0.5759(+0.0009)0.8794(-0.0011)37.34(-0.11)56.12(-0.10)
NVFP46.070.6040(-0.0079)0.5783(+0.0033)0.8792(-0.0013)37.26(-0.19)56.10(-0.12)
GGUF BF1617.070.6110(-0.0009)0.5755(+0.0005)0.8802(-0.0003)37.46(+0.01)56.22(0.00)
GGUF Q4_K_M5.280.6100(-0.0019)0.5765(+0.0015)0.8802(-0.0003)37.39(-0.06)56.18(-0.04)
GGUF Q3_K_M4.310.6019(-0.0100)0.5707(-0.0043)0.8826(+0.0021)37.20(-0.25)55.93(-0.29)
GGUF Q2_K3.450.5989(-0.0130)0.5676(-0.0074)0.8791(-0.0014)36.54(-0.91)55.31(-0.91)
MLX 4bit6.070.6102(-0.0017)0.5751(+0.0001)0.8796(-0.0009)37.41(-0.04)56.19(-0.03)

2B

FormatSize (GB)PFTB (En↔Ja)SaaS (En→Ja)WMT24++ COMET-22 (En→Ja)FLORES+ chrF++ (Ja↔Multilingual)FLORES+ chrF++ (En↔Multilingual)
BF165.760.60610.56120.878037.0255.74
FP83.430.6067(+0.0006)0.5613(+0.0001)0.8776(-0.0004)36.98(-0.04)55.76(+0.02)
W4A162.300.6032(-0.0029)0.5594(-0.0018)0.8783(+0.0003)36.96(-0.06)55.69(-0.05)
W4AFP82.300.6022(-0.0039)0.5612(0.0000)0.8772(-0.0008)36.95(-0.07)55.71(-0.03)
NVFP42.410.6032(-0.0029)0.5626(+0.0014)0.8783(+0.0003)36.82(-0.20)55.64(-0.10)
GGUF BF165.760.6062(+0.0001)0.5619(+0.0007)0.8782(+0.0002)37.02(0.00)55.75(+0.01)
GGUF Q4_K_M1.810.6062(+0.0001)0.5602(-0.0010)0.8774(-0.0006)37.00(-0.02)55.76(+0.02)
GGUF Q4_01.700.6069(+0.0008)0.5604(-0.0008)0.8791(+0.0011)36.12(-0.90)55.62(-0.12)
GGUF Q3_K_M1.500.6053(-0.0008)0.5644(+0.0032)0.8789(+0.0009)36.81(-0.21)55.59(-0.15)
GGUF Q2_K1.230.5977(-0.0084)0.5610(-0.0002)0.8777(-0.0003)36.45(-0.57)55.02(-0.72)
MLX 4bit2.410.6040(-0.0021)0.5624(+0.0012)0.8777(-0.0003)36.99(-0.03)55.64(-0.10)

0.8B

FormatSize (GB)PFTB (En↔Ja)SaaS (En→Ja)WMT24++ COMET-22 (En→Ja)FLORES+ chrF++ (Ja↔Multilingual)FLORES+ chrF++ (En↔Multilingual)
BF161.780.58620.55300.872436.0854.44
FP81.220.5846(-0.0016)0.5491(-0.0039)0.8726(+0.0002)36.00(-0.08)54.60(+0.16)
W4A160.950.5847(-0.0015)0.5439(-0.0091)0.8711(-0.0013)35.78(-0.30)53.95(-0.49)
W4AFP80.950.5783(-0.0079)0.5456(-0.0074)0.8718(-0.0006)35.75(-0.33)54.38(-0.06)
NVFP40.980.5787(-0.0075)0.5436(-0.0094)0.8702(-0.0022)35.54(-0.54)54.20(-0.24)
GGUF BF161.780.5873(+0.0011)0.5533(+0.0003)0.8727(+0.0003)36.10(+0.02)54.45(+0.01)
GGUF Q4_K_M0.570.5832(-0.0030)0.5451(-0.0079)0.8716(-0.0008)35.90(-0.18)54.47(+0.03)
GGUF Q4_00.550.5853(-0.0009)0.5500(-0.0030)0.8723(-0.0001)34.97(-1.11)54.11(-0.33)
GGUF Q3_K_M0.490.5798(-0.0064)0.5520(-0.0010)0.8710(-0.0014)35.32(-0.76)54.15(-0.29)
GGUF Q2_K0.410.5620(-0.0242)0.5397(-0.0133)0.8659(-0.0065)33.56(-2.52)51.15(-3.29)
MLX 4bit0.980.5773(-0.0089)0.5476(-0.0054)0.8724(0.0000)35.82(-0.26)54.41(-0.03)

Choosing a Distribution Format

Each size of PLaMo 3 Translate is available in the following distribution formats, depending on your use case and hardware.

FormatTarget hardwareInference engineTypical use
BF16GPUs with BF16 supportTransformers / vLLMPrioritizes accuracy with no quantization, when memory allows
FP8NVIDIA Ada Lovelace / Hopper / BlackwellvLLMBalances accuracy with memory savings and speed
W4A16NVIDIA Ampere or latervLLM4-bit weights to run with less GPU memory
W4AFP8NVIDIA HoppervLLM4-bit weights with FP8 compute, aiming at both low memory and high throughput
NVFP4NVIDIA BlackwellvLLMFP4 compute, aiming at low memory and high speed
GGUFCPU / various GPUsllama.cppRuns on a local PC, optionally combining CPU and GPU
MLX-4bitApple siliconmlx-lmMemory-efficient inference on a Mac

Usage

mlx-lm

The MLX version runs on mlx-lm. Specify trust_remote_code=True so that the code bundled with the model is loaded.

Use an Apple silicon Mac. Download the model files and move into that directory. Run the following examples in this directory.

pip install -U huggingface_hub
hf download pfnet/plamo-3-translate-2b-MLX-4bit --local-dir plamo-3-translate-2b-MLX-4bit
cd plamo-3-translate-2b-MLX-4bit

Install the required packages.

pip install -U -r requirements-mlx.txt

To install MLX on Linux with CUDA, see the official installation guide.

A chat template is provided so you can try translation easily. Given the source text and the target language, it builds a prompt in the PFML3 format.

For production use, such as integrating the model into an application, we recommend building the prompt directly in the PFML3 format and passing it to the Completions API of the server, which you can start as described in Running as a server below.

Build a translation request with the chat template and generate with mlx-lm.

from mlx_lm import generate, load
from mlx_lm.sample_utils import make_sampler

model, tokenizer = load(".", trust_remote_code=True, tokenizer_config={"trust_remote_code": True})

prompt = tokenizer.apply_chat_template(
    [{"role": "user", "content": "会議は来週の月曜日に変更されました。"}],
    target_lang="en", add_generation_prompt=True, tokenize=False,
)
print(generate(model, tokenizer, prompt=prompt, max_tokens=512, sampler=make_sampler(temp=0)))

max_tokens is the generation limit for the translation. This example sets it to 512 tokens. When translating long text, adjust the limit so that the whole input (source text, history, context, glossary and so on) plus the output fits within the limit of your runtime.

Example output:

The meeting has been rescheduled for next Monday.

target_lang sets the target language. source_lang, context, glossary and form can also be specified.

Using translation history from Python

This example uses the model and tokenizer loaded above. Add the current source text after the source–translation pairs. See Continuing a translation with previous translations for how history is used.

messages = [
    {"role": "user", "content": "プロジェクトの管理画面を開きます。"},
    {"role": "assistant", "content": "Open the project dashboard."},
    {"role": "user", "content": "進行中のタスクがすべて表示されます。"},
    {"role": "assistant", "content": "It lists all active tasks."},
    {"role": "user", "content": "オーナーでフィルタリングすることもできます。"},
]

prompt = tokenizer.apply_chat_template(
    messages, source_lang="ja", target_lang="en",
    add_generation_prompt=True, tokenize=False,
)
print(generate(model, tokenizer, prompt=prompt, max_tokens=512, sampler=make_sampler(temp=0)))

Running as a server

The bundled serve.py starts an mlx-lm server.

python serve.py --model . --trust-remote-code --host 127.0.0.1 --port 8000

This server returns an error before generation starts if the number of input tokens plus the generation limit max_tokens exceeds 32,768 tokens. Split the source text if it would exceed the limit. When adjusting max_tokens, keep it large enough that translations are not cut off.

If memory runs short, shorten the source text or reduce the number of texts processed in parallel.

Next, request translations by following Translating with the API below.

Translating with the API

This section explains how to send source text to the Chat Completions API. To send PFML3 prompts directly, see the Completions API example.

The Python examples use the OpenAI client.

pip install -U openai

Translating with the Chat Completions API

With the Chat Completions API, put the current source text in the last user message and pass the translation options in chat_template_kwargs.

When source_lang is omitted, the model detects the language from the source text. To specify it explicitly, add "source_lang": "ja", for example, to chat_template_kwargs.

curl http://localhost:8000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": ".",
    "messages": [{"role": "user", "content": "会議は来週の月曜日に変更されました。"}],
    "chat_template_kwargs": {"target_lang": "en"},
    "temperature": 0,
    "max_tokens": 512,
    "stop": ["<|plamo:tag|>", "<|plamo:bos|>"]
  }'

max_tokens is the generation limit for the translation. This example sets it to 512 tokens. When translating long text, adjust the limit so that the whole input (source text, history, context, glossary and so on) plus the output fits within the limit of your runtime.

Example output:

The meeting has been rescheduled for next Monday.

The translation is returned in choices[0].message.content.

Translating multiple texts at once

To translate multiple texts, send one request per text and run the requests in parallel. The following example sends up to four requests in parallel. Translation options such as target_lang specified inside translate() apply to every text.

from concurrent.futures import ThreadPoolExecutor
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
texts = [
    "会議は来週の月曜日に変更されました。",
    "プロジェクトの管理画面を開いてください。",
]

def translate(text):
    response = client.chat.completions.create(
        model=".",
        messages=[{"role": "user", "content": text}],
        temperature=0,
        max_tokens=512,
        stop=["<|plamo:tag|>", "<|plamo:bos|>"],
        extra_body={"chat_template_kwargs": {"target_lang": "en"}},
    )
    return response.choices[0].message.content

with ThreadPoolExecutor(max_workers=4) as executor:
    translations = list(executor.map(translate, texts))

for source, translation in zip(texts, translations):
    print(f"{source} → {translation}")

Translating with history via the Chat Completions API

Pass the already translated source–translation pairs as user/assistant pairs. Only the last user message is translated.

from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
messages = [
    {"role": "user", "content": "プロジェクトの管理画面を開きます。"},
    {"role": "assistant", "content": "Open the project dashboard."},
    {"role": "user", "content": "進行中のタスクがすべて表示されます。"},
    {"role": "assistant", "content": "It lists all active tasks."},
    {"role": "user", "content": "オーナーでフィルタリングすることもできます。"},
]

response = client.chat.completions.create(
    model=".",
    messages=messages,
    temperature=0,
    max_tokens=512,
    stop=["<|plamo:tag|>", "<|plamo:bos|>"],
    extra_body={"chat_template_kwargs": {"source_lang": "ja", "target_lang": "en"}},
)
print(response.choices[0].message.content)

Continuing a translation with previous translations

When translating a document paragraph by paragraph, you can pass the previous source–translation pairs as history. This lets the model follow the earlier word choices and style when translating the next passage.

With the chat template, alternate the source text as user and its translation as assistant, and put the current source text in the final user message. History is not stored automatically, so include the pairs you need in each request.

The translation direction is shared by the whole request: source_lang applies to every source text and target_lang to every translation.

History also counts toward the input tokens. Keep the whole input plus the generated translation within 32,768 tokens and within the limit of your runtime. As the history grows, we recommend dropping the oldest source–translation pairs first and keeping the most recent ones.

PFML3 Prompt Format

PFML3 is PLaMo's prompt format, in which the text to translate, the target language and other elements are delimited by special tokens. In the Chat Completions API example above, the chat template converts the source text and target language into PFML3. This section explains how to read the converted prompt and how to write prompts by hand.

For production use, we recommend building the prompt directly in PFML3 and passing it to the Completions API of the running server.

Converting a request that translates the Japanese meeting notice above into English gives the following PFML3 prompt. The beginning-of-sequence token is omitted here, and the Python string is split across lines for readability. The actual prompt contains no line breaks.

prompt = (
    "<|plamo:tag|>dataset<|plamo:msg|>translation"
    "<|plamo:tag|>input"
    "<|plamo:msg|>会議は来週の月曜日に変更されました。"
    "<|plamo:tag|>output<|plamo:key|>lang<|plamo:val|>en<|plamo:msg|>"
)
  • translation in dataset denotes the translation task. Because this model is dedicated to translation, always set dataset to translation.
  • The part following <|plamo:msg|> in input is the source text to translate.
  • <|plamo:key|>lang<|plamo:val|>en in output sets the target language to English. The translation is generated right after the final <|plamo:msg|>.

<|plamo:tag|> marks the start of each element, and <|plamo:msg|> marks the start of its body. To specify attributes such as the language or style, write the attribute name after <|plamo:key|> and its value after <|plamo:val|>, following the element name. For example, adding <|plamo:key|>form<|plamo:val|>plain to output requests plain style.

Context and a glossary are optional. To use them, add context and then glossary, in that order, between dataset and input. When translation history is also used, put context right after dataset, list the previous input/output pairs, and put glossary immediately before the current input. In the glossary, write a source term after <|plamo:index|> and its translation after <|plamo:item|>, repeating this pair for each term. See Translation Options for concrete examples.

Translating with the Completions API

When writing PFML3 by hand, start by setting dataset to translation and end the output element with <|plamo:msg|>. After generating the translation, the model emits <|plamo:tag|> or <|plamo:bos|> and stops.

The handwritten examples above omit <|plamo:bos|>, which marks the beginning of the sequence. The mlx-lm server adds it automatically, so do not add it to the beginning of a handwritten prompt.

A handwritten prompt is passed to the Completions API of the running server as prompt.

Pass one of the PFML3 prompts shown in the translation examples as prompt.

from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
prompt = (
    "<|plamo:tag|>dataset<|plamo:msg|>translation"
    "<|plamo:tag|>input"
    "<|plamo:msg|>会議は来週の月曜日に変更されました。"
    "<|plamo:tag|>output<|plamo:key|>lang<|plamo:val|>en<|plamo:msg|>"
)

response = client.completions.create(
    model=".",
    prompt=prompt,
    temperature=0,
    max_tokens=512,
    stop=["<|plamo:tag|>", "<|plamo:bos|>"],
)
print(response.choices[0].text)

The translation is returned in choices[0].text.

Translating multiple texts at once

When using PFML3 prompts directly, you can likewise send one request per text in parallel.

from concurrent.futures import ThreadPoolExecutor
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
texts = [
    "会議は来週の月曜日に変更されました。",
    "プロジェクトの管理画面を開いてください。",
]

def translate(text):
    prompt = (
        "<|plamo:tag|>dataset<|plamo:msg|>translation"
        "<|plamo:tag|>input<|plamo:msg|>"
        f"{text}"
        "<|plamo:tag|>output<|plamo:key|>lang<|plamo:val|>en<|plamo:msg|>"
    )
    response = client.completions.create(
        model=".",
        prompt=prompt,
        temperature=0,
        max_tokens=512,
        stop=["<|plamo:tag|>", "<|plamo:bos|>"],
    )
    return response.choices[0].text

with ThreadPoolExecutor(max_workers=4) as executor:
    translations = list(executor.map(translate, texts))

for source, translation in zip(texts, translations):
    print(f"{source} → {translation}")

Specifying translation history in PFML3

Translation history can also be written in PFML3 by hand. List the already translated input and output elements in document order, then add the current source text followed by an output element with an empty body. In the following example, only the last sentence, "オーナーでフィルタリングすることもできます。", is translated, with reference to the two previous pairs.

from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
prompt = (
    "<|plamo:tag|>dataset<|plamo:msg|>translation"
    "<|plamo:tag|>input<|plamo:key|>lang<|plamo:val|>ja<|plamo:msg|>プロジェクトの管理画面を開きます。"
    "<|plamo:tag|>output<|plamo:key|>lang<|plamo:val|>en<|plamo:msg|>Open the project dashboard."
    "<|plamo:tag|>input<|plamo:key|>lang<|plamo:val|>ja<|plamo:msg|>進行中のタスクがすべて表示されます。"
    "<|plamo:tag|>output<|plamo:key|>lang<|plamo:val|>en<|plamo:msg|>It lists all active tasks."
    "<|plamo:tag|>input<|plamo:key|>lang<|plamo:val|>ja<|plamo:msg|>オーナーでフィルタリングすることもできます。"
    "<|plamo:tag|>output<|plamo:key|>lang<|plamo:val|>en<|plamo:msg|>"
)

response = client.completions.create(
    model=".",
    prompt=prompt,
    temperature=0,
    max_tokens=512,
    stop=["<|plamo:tag|>", "<|plamo:bos|>"],
)
print(response.choices[0].text)

To continue translating, append the current source text and the generated translation to the history as a pair. Then add an input element containing the next source text and an output element with an empty body.

Keep only the body of each translation in the history. The translation returned by the example above can be used as is.

If <|plamo:tag|> or <|plamo:bos|> remains at the end of a translation, remove it so that exactly one <|plamo:tag|> separates it from the next input.

Translation Options

Specify the target language, style, context, glossary and other options in chat_template_kwargs of the Chat Completions API, not in a system message or in the source text.

Run the following examples while the server is running.

from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
ArgumentDescription
target_langLanguage code of the target language. Required.
source_langLanguage code of the source text. Optional.
contextReference context for interpreting the source text, such as the surrounding text or the situation.
glossaryA list of {"source": "source term", "target": "translation"} dictionaries, one per term.
formplain for plain style or polite for polite style (only with target_lang="ja").

When combined with translation history, context is passed as reference context for the whole request, while glossary and form apply to the current translation. Previous translations themselves are not changed.

The same options are available when calling mlx-lm directly from Python. Add context=..., glossary=[...], form="plain" and so on as arguments to tokenizer.apply_chat_template() in the first mlx-lm example.

Specifying terms with a glossary

Pass pairs of source terms and their translations in glossary to control how the terms are translated.

response = client.chat.completions.create(
    model=".",
    messages=[{"role": "user", "content": "プロジェクトの管理画面を開いてください。"}],
    temperature=0, max_tokens=512,
    stop=["<|plamo:tag|>", "<|plamo:bos|>"],
    extra_body={
        "chat_template_kwargs": {
            "target_lang": "en",
            "glossary": [
                {"source": "管理画面", "target": "dashboard"},
                {"source": "プロジェクト", "target": "project"}
            ]
        }
    },
)
print(response.choices[0].message.content)

Example output:

Please open the project dashboard.

prompt = (
    "<|plamo:tag|>dataset<|plamo:msg|>translation"
    "<|plamo:tag|>glossary"
    "<|plamo:index|>管理画面<|plamo:item|>dashboard"
    "<|plamo:index|>プロジェクト<|plamo:item|>project"
    "<|plamo:tag|>input<|plamo:msg|>プロジェクトの管理画面を開いてください。"
    "<|plamo:tag|>output<|plamo:key|>lang<|plamo:val|>en<|plamo:msg|>"
)

Providing context

Use context to pass the surrounding text or to describe the situation. In this example, the source text かみを切りました。 is ambiguous because かみ can mean either hair or paper. The context says that the speaker is making origami, so it is translated as paper.

response = client.chat.completions.create(
    model=".",
    messages=[{"role": "user", "content": "かみを切りました。"}],
    temperature=0, max_tokens=512,
    stop=["<|plamo:tag|>", "<|plamo:bos|>"],
    extra_body={
        "chat_template_kwargs": {
            "target_lang": "en",
            "context": "工作で折り紙を作っています。"
        }
    },
)
print(response.choices[0].message.content)

Example output:

I cut the paper.

prompt = (
    "<|plamo:tag|>dataset<|plamo:msg|>translation"
    "<|plamo:tag|>context"
    "<|plamo:msg|>工作で折り紙を作っています。"
    "<|plamo:tag|>input<|plamo:msg|>かみを切りました。"
    "<|plamo:tag|>output<|plamo:key|>lang<|plamo:val|>en<|plamo:msg|>"
)

Specifying plain or polite style

When translating into Japanese, form="plain" requests the plain style (da/dearu) and form="polite" requests the polite style (desu/masu). Because form applies only to Japanese translations, this example translates English into Japanese.

response = client.chat.completions.create(
    model=".",
    messages=[{"role": "user", "content": "This system is convenient."}],
    temperature=0, max_tokens=512,
    stop=["<|plamo:tag|>", "<|plamo:bos|>"],
    extra_body={
        "chat_template_kwargs": {
            "target_lang": "ja",
            "form": "plain"
        }
    },
)
print(response.choices[0].message.content)

Example outputs for the same source text:

StyleOptionTranslation
Plainform="plain"このシステムは便利だ。
Politeform="polite"このシステムは便利です。

Plain:

prompt = (
    "<|plamo:tag|>dataset<|plamo:msg|>translation"
    "<|plamo:tag|>input<|plamo:msg|>This system is convenient."
    "<|plamo:tag|>output<|plamo:key|>lang<|plamo:val|>ja"
    "<|plamo:key|>form<|plamo:val|>plain<|plamo:msg|>"
)

Polite:

prompt = (
    "<|plamo:tag|>dataset<|plamo:msg|>translation"
    "<|plamo:tag|>input<|plamo:msg|>This system is convenient."
    "<|plamo:tag|>output<|plamo:key|>lang<|plamo:val|>ja"
    "<|plamo:key|>form<|plamo:val|>polite<|plamo:msg|>"
)

Specifying all options at once

Translation history, context, a glossary and the style can be combined in one request. The following example translates the third sentence after two previous pairs, passing the page type as context and fixing the translation of オーナー with the glossary. context is passed as reference context for the whole request, and glossary applies to the current translation. When translating into Japanese, form can be added in the same way.

response = client.chat.completions.create(
    model=".",
    messages=[
        {"role": "user", "content": "プロジェクトの管理画面を開きます。"},
        {"role": "assistant", "content": "Open the project dashboard."},
        {"role": "user", "content": "進行中のタスクがすべて表示されます。"},
        {"role": "assistant", "content": "It lists all active tasks."},
        {"role": "user", "content": "オーナーでフィルタリングすることもできます。"},
    ],
    temperature=0, max_tokens=512,
    stop=["<|plamo:tag|>", "<|plamo:bos|>"],
    extra_body={
        "chat_template_kwargs": {
            "source_lang": "ja",
            "target_lang": "en",
            "context": "プロジェクト管理ツールのヘルプページです。",
            "glossary": [
                {"source": "オーナー", "target": "assignee"}
            ]
        }
    },
)
print(response.choices[0].message.content)

Example output:

You can also filter by assignee.

prompt = (
    "<|plamo:tag|>dataset<|plamo:msg|>translation"
    "<|plamo:tag|>context<|plamo:msg|>プロジェクト管理ツールのヘルプページです。"
    "<|plamo:tag|>input<|plamo:key|>lang<|plamo:val|>ja<|plamo:msg|>プロジェクトの管理画面を開きます。"
    "<|plamo:tag|>output<|plamo:key|>lang<|plamo:val|>en<|plamo:msg|>Open the project dashboard."
    "<|plamo:tag|>input<|plamo:key|>lang<|plamo:val|>ja<|plamo:msg|>進行中のタスクがすべて表示されます。"
    "<|plamo:tag|>output<|plamo:key|>lang<|plamo:val|>en<|plamo:msg|>It lists all active tasks."
    "<|plamo:tag|>glossary<|plamo:index|>オーナー<|plamo:item|>assignee"
    "<|plamo:tag|>input<|plamo:key|>lang<|plamo:val|>ja<|plamo:msg|>オーナーでフィルタリングすることもできます。"
    "<|plamo:tag|>output<|plamo:key|>lang<|plamo:val|>en<|plamo:msg|>"
)

Supported Languages

53 languages are supported, including Japanese and English. Simplified and Traditional Chinese are counted as separate languages. Because Hugging Face groups Chinese as a single language in its language display, the model page shows 52 languages.

LanguageCodeLanguageCode
JapanesejaEnglishen
Chinese (Simplified)zh-hansChinese (Traditional)zh-hant
KoreankoArabicar
AzerbaijaniazBelarusianbe
BulgarianbgBengalibn
CatalancaCebuanoceb
GermandeSpanishes
EstonianetBasqueeu
PersianfaFrenchfr
GujaratiguHebrewhe
HindihiCroatianhr
HungarianhuArmenianhy
IndonesianidItalianit
JavanesejvGeorgianka
KazakhkkKhmerkm
LithuanianltLatvianlv
MalayalammlMarathimr
MalaymsBurmesemy
NepalineDutchnl
PunjabipaPolishpl
RussianruSinhalasi
SlovakskSloveniansl
SerbiansrSwahilisw
TamiltaTelugute
ThaithTagalogtl
UrduurUzbekuz
Vietnamesevi

License

PLaMo 3 Translate 2B MLX-4bit is released under the PLaMo Community License.

Personal and non-commercial use

For personal use, such as learning or hobby projects, you can download and use the model free of charge. Non-commercial use, including academic use, is also free, with no restriction based on revenue or sales and no prior registration with PFN.

Commercial use when revenue or sales is 1 billion yen or less

If the revenue or sales of the user or its affiliates in the most recent fiscal year is 1 billion yen or less, register your intended use through the PLaMo Commercial Use Registration Form. Commercial use is free of charge from the moment you submit the form.

Commercial use when revenue or sales exceeds 1 billion yen

A separate license agreement is required. Instead of the registration form above, please contact PFN through the PLaMo Translation Model inquiry page.

See the full text of the PLaMo Community License for details.

Preferred Networks Group AI Policy

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · mlx

Нельзя запустить

MLX-модели работают только на Apple Silicon, на GPU NVIDIA они не запускаются.

Класс архитектуры
Plamo3ForCausalLM
Ревизия весов
b37bcfc

0 моделей