📱 Ginigen Edge AI News

On-device AI, quantization and offline LLMs in practice

Hy-MT3-30B-A3B GGUF on Your Own Device: A 102-Language Translator in 18 GiB, and What the KV Cache Adds at 8K and 32K

2026-11-29 · Ginigen AI

aiopensourceedgeaillm

Hy-MT3-30B-A3B GGUF on Your Own Device: A 102-Language Translator in 18 GiB, and What the KV Cache Adds at 8K and 32K

TL;DR - Tencent's Hy-MT3-30B-A3B is a 102-language translation model with 30B total and about 3B active parameters per token. Its GGUF repo ships three files: IQ2 12.19 GiB, Q4_K_M 18.16 GiB and Q8_0 30.54 GiB (exact byte counts from the Hugging Face API). - All 48 layers keep a KV cache, with 4 KV heads of 128 dimensions. Our arithmetic from config.json: 96 KiB per token in fp16, which is 0.750 GiB at the 8K context the card recommends and 3.000 GiB at 32K. - A single-user translation setup at Q4_K_M, 8K context and q8_0 cache lands near 18.56 GiB before compute buffers, so a 24 GB GPU or a 32 GB laptop is enough. - Because only about 3B parameters run per token, decode is bandwidth bound at roughly 2 GB of weight reads per token at Q4_K_M. We give a ceiling formula you can run for your own machine.

Hy-MT3-30B-A3B GGUF file sizes

What is Hy-MT3-30B-A3B, and why does it suit your own device?

Hy-MT3 is the third generation of Tencent's Hy translation family. The model card lists three sizes (1.8B, 7B and 30B-A3B), covers 102 languages (up from 38 in Hy-MT2) and ships under Apache 2.0. The 30B-A3B variant is a Mixture-of-Experts model: per config.json it has 48 layers, 128 routed experts with 8 chosen per token, one shared expert, a hidden size of 2048 and one leading dense layer.

Translation is a good fit for local hardware for a practical reason: the text often cannot leave the machine. Contracts, support tickets, game strings and medical notes are all things teams hesitate to send to a hosted API. The card's own positioning is that the 30B-A3B model leads the evaluated models in non-thinking mode on its translation suite, which it reports as a publisher result. Here we stay on the part you can verify yourself: bytes.

Three numbers decide whether a model like this is comfortable on a laptop or a single card:

  1. Total parameters set the RAM. All 128 experts must be resident or memory-mapped, so the file size is the floor.
  2. Active parameters set the speed. Decode reads only the experts that fire, so about 3B parameters move per token.
  3. Layers times KV heads set the context cost. Every layer here is a standard attention layer, so cache grows linearly with context.

Which GGUF quant of Hy-MT3-30B-A3B fits my machine?

The Hugging Face API reports these file sizes for tencent/Hy-MT3-30B-A3B-GGUF:

Format Bytes GiB Effective bits per weight
IQ2 13,083,836,064 12.19 3.48
Q4_K_M 19,502,694,048 18.16 5.19
Q8_0 32,791,821,792 30.54 8.73

The GGUF header reports 30,064,725,888 parameters in total. Bits per weight here is file bytes times 8 divided by that count, so it includes the few tensors kept at higher precision. Use it for ranking, not for citation.

Rules of thumb that follow:

  • 16 GB machine: the IQ2 file (12.19 GiB) fits with a short context. Run your own test set before trusting a 2-bit file for production text.
  • 24 GB GPU or 32 GB unified memory: Q4_K_M (18.16 GiB) fits with room for the cache. On unified-memory machines leave a few GiB for the OS.
  • 48 GB and above: Q8_0 (30.54 GiB) plus cache fits a 48 GB card or a 64 GB Mac.
  • CPU only: Q4_K_M needs about 20 to 22 GiB of free RAM in total, and memory bandwidth, not capacity, sets the speed.

How big is the KV cache when every layer has one?

The cache stores a key and a value per token, per layer, per KV head:

layers, kv_heads, head_dim = 48, 4, 128               # from config.json
fp16 = layers * 2 * kv_heads * head_dim * 2           # bytes per token
q8   = layers * 2 * kv_heads * head_dim * (34 / 32)   # q8_0 = 34 bytes per 32 values
print(fp16, q8)                                       # 98304, 52224.0
for ctx in (8192, 32768, 131072, 262144):
    print(ctx, round(ctx * fp16 / 2**30, 3), "GiB fp16", round(ctx * q8 / 2**30, 3), "GiB q8_0")
Context fp16 cache q8_0 cache
8K 0.750 GiB 0.398 GiB
32K 3.000 GiB 1.594 GiB
128K 12.000 GiB 6.375 GiB
256K 24.000 GiB 12.750 GiB

KV cache by context

Grouped-query attention with only 4 KV heads (against 32 query heads) is what keeps this small: 8 query heads share each KV head, an 8x saving over full multi-head attention. Even so, the full 262,144-token window costs 24.000 GiB in fp16, more than the Q4_K_M weights themselves. That window is rarely needed here. The card's inference section sets max_context: 8192 and max_tokens: 4096, which matches how translation is used: a paragraph or a page at a time.

One caveat on our own arithmetic: it assumes the runtime caches keys and values at 128 dimensions for 4 heads in every layer, as config.json implies. Your build prints the real KV buffer size at startup, so trust that line over this table.

What does the full memory budget look like at 8K context?

For a single user translating documents, a reasonable local recipe is one slot, 8K context and a q8_0 cache:

Component GiB
Q4_K_M weights 18.16
q8_0 cache, 8K 0.398
Subtotal before compute buffers 18.56

Memory stack at Q4_K_M and 8K

Compute buffers and the runtime context add a further one to a few GiB depending on batch size, so plan on roughly 20 to 22 GiB in total. That is comfortable on a 24 GB card and on a 32 GB Mac. To check on your own machine in a minute:

hf download tencent/Hy-MT3-30B-A3B-GGUF Hy-MT3-30B-A3B-Q4_K_M.gguf --local-dir ./gguf
./build/bin/llama-server -m ./gguf/Hy-MT3-30B-A3B-Q4_K_M.gguf \
  -c 8192 -np 1 -ctk q8_0 -ctv q8_0 -fa on --jinja 2>&1 | grep -i -E "KV|buffer"

Using -np 1 matters for a single user: on servers that open several slots by default, the cache is shared or multiplied across slots, and memory use rises for no benefit.

How fast will it decode on my hardware?

Decode is bandwidth bound: each generated token reads the active weights once. With about 3B active parameters at Q4_K_M:

bpw = 19_502_694_048 * 8 / 30_064_725_888      # about 5.19 bits per weight
active_bytes = 3e9 * bpw / 8                    # about 1.95 GB per token
for bw in (50, 100, 273, 800):                  # GB/s: dual-channel DDR5, fast DDR5, Pro-class unified, high-end unified
    print(bw, round(bw * 1e9 / active_bytes, 1), "tok/s ceiling")
Memory bandwidth Tokens per second ceiling
50 GB/s 25.7
100 GB/s 51.4
273 GB/s 140.3
800 GB/s 411.1

These are upper bounds before routing overhead, attention reads and cache effects, not forecasts. The card does not publish tokens-per-second figures for the GGUF files, so measure with the llama-bench command it provides (./build/bin/llama-bench -m model.gguf -ngl 0) and compare your number against the ceiling for your bandwidth.

The practical consequence of a 3B active size: a 30B-class translation model decodes at roughly the pace of a 3B dense model, while quality comes from the full parameter pool. That is why MoE models suit devices with plenty of RAM but modest bandwidth.

How do I prompt it, and what does the model card recommend?

The card gives task templates for default translation, terminology, style, personalization, delimiters and structured data. The default English prompt is:

Translate the following text into {target_lang}. Note that you should only output the translated result without any additional explanation:

{source_text}

Use full language names for the source and target language, in the language of the prompt. The models have no default system prompt. For 30B-A3B the card recommends temperature 0.7, top_p 1.0, top_k -1, repetition_penalty 1.0 and max_tokens 4096. With llama.cpp, set these explicitly (for example --temp 0.7 --top-p 1.0 --top-k 0 --repeat-penalty 1.0), because llama.cpp applies its own sampling defaults otherwise.

For a localization pipeline, the terminology and delimiter templates are the useful ones: pass a glossary in the prompt and ask the model to keep placeholders such as {var} and %s untouched. Then check the output mechanically:

import re
PH = re.compile(r"\{[^}]+\}|%[sd]|\$\{[^}]+\}")
def placeholders_ok(src, out):
    return sorted(PH.findall(src)) == sorted(PH.findall(out))

A cheap automatic check like this catches the failure that hurts game and app localization most, and it costs nothing at inference time.

What do the card's quality claims cover?

The card reports results on FLORES-200, FLORES-200 low-resource, WMT26 and Mandarin to minority-language translation, plus WildMTBench-202611 and IFMTBench for instruction following, scored with the publisher's TransRubric suite. It states that the 30B-A3B model has the best overall performance among the evaluated models in non-thinking mode, and that on its real-world scenario data the share of mistranslated samples fell by 43 percent against Hy-MT2, omissions or additions by 74 percent and instruction-following errors by 40 percent. These are the publisher's own measurements. For choosing a quant, the sound method is your own test: pick 100 real source texts in your language pair, translate with Q4_K_M and Q8_0 using the same sampler, and compare with a reviewer or a rubric.

A pre-download checklist

  1. Choose the format by file size plus cache: IQ2 for 16 GB, Q4_K_M for 24 to 32 GB, Q8_0 for 48 GB and above.
  2. Use a current llama.cpp build; the card's quickstart builds from the upstream repository.
  3. Start with -c 8192 -np 1 -ctk q8_0 -ctv q8_0 and read the KV line in the log.
  4. Set the sampler explicitly instead of relying on defaults.
  5. Add a placeholder check and a glossary prompt if you translate software strings.
  6. Read the Apache 2.0 license file in the repo for your use case.

FAQ

How much RAM does Hy-MT3-30B-A3B need? The Q4_K_M file is 18.16 GiB and an 8K q8_0 cache adds 0.398 GiB, so plan for roughly 20 to 22 GiB including compute buffers.

Why does a 30B model run at the speed of a 3B model? It is a Mixture-of-Experts model: 8 of 128 routed experts plus one shared expert fire per token, so about 3B parameters are read per step while all 30B stay in memory.

How large is the KV cache? 96 KiB per token in fp16 from config.json (48 layers, 4 KV heads, 128 dimensions), so 0.750 GiB at 8K and 3.000 GiB at 32K. A q8_0 cache is about 47 percent smaller.

Can I run it without a GPU? Yes. The card's llama.cpp example uses -ngl 0, which is CPU only. Speed follows memory bandwidth, so use the ceiling formula above.

Which quant should I pick for translation? Q4_K_M if memory is the constraint, Q8_0 if you have the room. Test your own language pair on your own texts.

File sizes and parameter counts come from the Hugging Face API on 2026-11-29. Cache and bandwidth figures are our own arithmetic from config.json and are labeled as such.