/ Модель

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

Лицензия
Apache 2.0
Базовая модель
Qwen3-4B
Библиотека
litert-lm
Опубликована
21 апр 2026

Qwen3-4B

Генерация текстаТекст → текст11 профессий
9 450скачиваний за 30 дней12лайковвеса обновлены4 дек 2026

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

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

litert-community/Qwen3-4B — это оптимизированный для локального запуска вариант языковой модели Qwen3-4B, разработанный сообществом LiteRT и основанный на контрольной точке Qwen/Qwen3-4B от команды Qwen.

Модель предназначена для генерации текста на устройствах, включая настольные GPU и Android-устройства, и интегрируется через LiteRT-LM.

В репозитории доступны артефакты с channel-wise INT8-квантованием весов и float32 KV-кэшем размером 5,28 ГБ, а также смешанный вариант TorchAO mixed INT4 размером около 2,54 ГиБ с контекстом 2048 токенов. В INT4-варианте линейные проекции используют блочное INT4-квантование с размером группы 32, эмбеддинги — weight-only INT8, а нормализация, операции редукции и KV-кэш сохраняются в формате с плавающей точкой. Для внимания и работы с кэшем применяются StableHLO composite ops LiteRT-LM.

Модель подходит для автономной генерации текста и встраивания в приложения, где важны локальная обработка и сниженные требования к памяти. README указывает английский язык, но не сообщает полный языковой охват, точную архитектуру исходной Qwen3-4B или другие модальности. Производительность зависит от устройства, версии runtime, backend, квантования и теплового состояния; приведённые результаты являются измерениями авторов и не представляют независимую сертификацию. Лицензия — Apache-2.0.

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

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

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

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

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

Для каких профессий подходит11

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

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

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

Открыть на Hugging Face

Qwen3-4B LiteRT-LM Models

This repository contains LiteRT-LM variants of Qwen/Qwen3-4B optimized for on-device text generation. Its qwen3_4b_mixed_int4.litertlm is a LiteRT Torch export with dynamic INT4 (block-32) weights and GPU composite ops, and its GPU path needs LiteRT-LM 0.19.0 or newer. On a Galaxy S26 with LiteRT-LM 0.19.0 on the GPU (OpenCL), Qwen3-4B_dynamic_wi4b32_afp32_gpu_composites.litertlm prefilled 1,024 tokens at 526 tok/s and decoded at 19.5 tok/s, against 369 and 18.9 tok/s for the earlier qwen3_4b_mixed_int4.litertlm (measured 2026-10-29; the Mac and the CPU are in that day's table below). The qwen3_4b_mixed_int4.litertlm on main gave the same replies as the _gpu_composites file on 2026-10-30 (below).

Available Artifacts

FileQuantizationContextSize
qwen3_4b_channelwise_int8_float32kv.litertlmchannel-wise INT8 weights, float32 KV40965.28 GB
qwen3_4b_mixed_int4.litertlmdynamic INT4 (block-32) weights, float KV, GPU composite ops40962167.64 MiB

Conversion Notes

The earlier qwen3_4b_mixed_int4.litertlm, kept at revision a45912eb, is a TorchAO-based quantize-first export of the original Hugging Face checkpoint with a mixed quantization layout (eligible linear projection weights as blockwise INT4 with group size 32 and floating-point scales, token embedding weights as weight-only INT8, normalization/reduction paths and KV cache tensors in floating point) and LiteRT-LM StableHLO composite ops for attention/cache execution, including odml.runtime_bmm and odml.cache_update.

qwen3_4b_mixed_int4.litertlm and qwen3_4b_channelwise_int8_float32kv.litertlm need litert-lm 0.18.0 or newer and carry LiteRT-LM's official qwen3 configuration, so thinking is on unless enable_thinking is false, the reasoning arrives on the thought channel, and tool calls are parsed by the runtime. The context is 4,096 tokens in both. (The earlier qwen3_4b_mixed_int4.litertlm had a 2,048-token context, in which the thought could use up the context before the answer with thinking on and no budget.)

The GPU path of qwen3_4b_mixed_int4.litertlm needs LiteRT-LM 0.19.0 or newer (its CPU path 0.18.0 or newer); the earlier file of this name is kept at revision a45912eb: hf download litert-community/Qwen3-4B qwen3_4b_mixed_int4.litertlm --revision a45912eb8a7b33d6cb92aac6a08524b9463faec0. The new file is a dynamic INT4 variant (block-32 weights, FP32 activations) exported with LiteRT Torch's export_hf at commit 0a81bf6f3 with --apply_gpu_composites=True: RMSNorm, the QK-norm and RoPE step, attention, SwiGLU and the KV-cache update are composite ops for the LiteRT-LM GPU path, and the QKV and Gate/Up projections are fused. It was exported with prefill lengths 128 and 1024 and a 32,768-token cache (--cache_length=32768); the default context in its metadata is 4,096 tokens. It carries the same LiteRT-LM qwen3 configuration as qwen3_4b_channelwise_int8_float32kv.litertlm (the same chat template, so the Known runtime issues below apply to it) and Qwen/Qwen3-4B's tokenizer.json byte for byte. On LiteRT-LM 0.18.1 the GPU path of Qwen3-4B_dynamic_wi4b32_afp32_gpu_composites.litertlm (revision a45912eb) fails on a Mac: some of its WebGPU shaders do not compile, and one short prompt got an error instead of a reply. The earlier file runs on the GPU with LiteRT-LM 0.18.1 (a Mac, one short prompt) and 0.19.0.

Performance

Desktop benchmark: AMD Radeon AI PRO R9700, LiteRT-LM WebGPU, 256 prefill tokens, 32 decode tokens. Android rows use LiteRT-LM v0.13.1 with GPU OpenCL, 256 prefill tokens, and 64 decode tokens. Values report the warmed iteration from a two-iteration run unless noted. These rows were not measured with the new qwen3_4b_mixed_int4.litertlm.

Hardware benchmark disclosure: Results were measured by us on retail devices purchased through normal channels. These results are not affiliated with, sponsored by, endorsed by, or verified by Samsung, vivo, Qualcomm, MediaTek, Google, MLCommons, or Hugging Face. Results depend on device SKU, OS build, thermal state, battery mode, backend, model quantization, runtime version, and benchmark settings.

Device / BackendPrefill (tok/s)Decode (tok/s)TTFT (s)Peak Private Footprint
Desktop GPU WebGPU1327.3387.520.201697 MB
Samsung SM-S937U1 GPU OpenCL357.5719.140.771609 MB
vivo V2502A GPU OpenCL170.6612.671.584722 MB
TECNO LJ9 GPU OpenCL104.3710.862.544906 MB

Qwen3-4B_dynamic_wi4b32_afp32_gpu_composites.litertlm against the earlier qwen3_4b_mixed_int4.litertlm (measured 2026-10-29, LiteRT-LM 0.19.0)

On LiteRT-LM 0.19.0, qwen3_4b_mixed_int4.litertlm (sha256 4877b236…) gave the same replies as the measured file (Qwen3-4B_dynamic_wi4b32_afp32_gpu_composites.litertlm at revision a45912eb, sha256 a11d1b4c…) to eight short questions on the Galaxy S26's GPU and to one arithmetic question on its CPU and on the Mac, and ran within 3 % of it or faster on the Galaxy S26 and the Mac, GPU and CPU (measured 2026-10-30; the Galaxy S26 ran both files in two GPU speed modes, with a median prefill per process of about 320–340 or 480–535 tok/s, and they were compared within each mode); "this file" below means the measured file. Measured by us on our own devices with LiteRT-LM 0.19.0 from PyPI, this file and the earlier file in the same set of runs on each device: 1,024 prefill tokens and 256 decode tokens with a 2,048-token KV cache. Android (Galaxy S26): the litert-lm-api 0.19.0 wheel for Android (arm64), run on the phone by CPython 3.14 through the wheel's Benchmark class (the class litert-lm benchmark runs); on the GPU three processes per file, the first with no GPU program cache, each reporting the median of 3 runs, and the table gives the median of the three processes; on the CPU one process per file. Mac: litert-lm benchmark --backend gpu|cpu -p 1024 -d 256 --max-num-tokens 2048 --cache no, three processes per file on the GPU (the table gives their median), one on the CPU. No Pixel 8a rows: the table compares this file with the earlier file, and our Pixel 8a runs of 2026-11-02 to 2026-11-05 did not include the earlier file. In those runs, on an 8 GB Pixel 8a with LiteRT-LM 0.19.0, this file built its GPU engine in each of five GPU processes. In three of the five, the phone's available memory fell to 360,076 kB or less within 13 s of a run starting. The other two ran their 3 runs, decoding at 9.38, 9.66 and 5.89 tok/s in one and 9.20, 8.10 and 6.03 tok/s in the other. On the CPU, one process ran its 3 runs, decoding at 5.46, 4.60 and 4.89 tok/s. The qwen3_4b_mixed_int4.litertlm on main was not in these runs either.

DeviceBackendThis file, prefill / decode (tok/s)Earlier file, prefill / decode (tok/s)
Galaxy S26 (SM-S942Q, Android 16)GPU (OpenCL)526 / 19.5369 / 18.9
Mac (Apple M4 Max)GPU (WebGPU)1,696 / 133.71,383 / 110.3
Galaxy S26CPU (XNNPACK)41 / 9.741 / 3.1
Mac (Apple M4 Max)CPU (XNNPACK)104 / 24.696 / 21.9

On the Galaxy S26's GPU this file built its engine with every node on the GPU delegate, and on the Galaxy S26 and the Mac it stayed on topic through 256 tokens of reasoning on a 1,338-token prompt (a long filler passage followed by a 25-item listing task). Asked 8 one-line questions (arithmetic, a capital, an antonym, a translation, a rhyme and others) with thinking off, on the phone with the sampler settings stored in the file (top-k 20, top-p 0.95, temperature 0.6) and on the Mac greedy, its replies passed a keyword check on 8 of 8 on both (one run each). The phone's CPU clock ceilings were lower at the end of each CPU process than at its start, and this file's first run prefilled at 50 tok/s on the Galaxy S26, faster than the table shows.

Try It

Install uv and run:

uv tool install litert-lm
uvx litert-lm run --from-huggingface-repo=litert-community/Qwen3-4B qwen3_4b_mixed_int4.litertlm --prompt="What is the capital of France?"

If run stops right after the download with no error message from the CLI (a bus error; exit status 138 on a Mac) or with an error log that contains too large for file size, the downloaded file may be incomplete. The litert-lm CLI (0.14.0 to 0.19.2, and litert-lm-nightly 0.20.0.dev20261112) can keep an incomplete download in ~/.litert-lm/cache/huggingface/litert-community/Qwen3-4B/ and uses it again on later runs without checking its size. Delete that file and run the command again.

If you downloaded qwen3_4b_mixed_int4.litertlm with --from-huggingface-repo before it was replaced on 2026-10-31 (05:08 UTC) and run it with LiteRT-LM 0.19.0 or newer (0.18.0 or newer on the CPU), delete ~/.litert-lm/cache/huggingface/litert-community/Qwen3-4B/qwen3_4b_mixed_int4.litertlm, then run the command again. Without deleting it, the litert-lm CLI (0.14.0 to 0.19.2) keeps running the file you downloaded: it uses a file it finds there without checking it against this repo. With LiteRT-LM 0.18.x on the GPU, use the earlier file as Conversion Notes describes.

For sample apps, see google-ai-edge/litert-samples.

Integration

Ready to integrate this into your product? Get started in the LiteRT-LM documentation.

On litert-lm 0.18.x and 0.19.0, a blocking send_message that is still generating after 10 minutes fails with DEADLINE_EXCEEDED (a fixed timeout with no setting), and the generation it leaves running can crash the process. For long replies on a slow backend (long thinking in particular), lower max_output_tokens or use the streaming send_message_async, which has no such limit.

Citation

@misc{qwen3technicalreport,
      title={Qwen3 Technical Report},
      author={Qwen Team},
      year={2025},
      eprint={2505.09388},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2505.09388},
}

Known runtime issues

iPhone. With the v0.19.0 CLiteRTLM.xcframework on an iPhone 18 Pro, qwen3_4b_mixed_int4.litertlm builds its Metal GPU engine and works out 17 + 25 = 42 (one run, checked 2026-10-31); with the v0.18.1 package it gives no GPU answer. The Swift package at tag v0.19.0 points its binary targets at the v0.18.1 release zips; to run 0.19.0, edit them to the v0.19.0 release's zips (URL and checksum).

From a conversation preface (the system message, initial messages, tools and extra context a conversation is created with) that has tools and no messages, LiteRT-LM renders these files' chat template with an empty message list, and the template reads messages[0] without checking that the list is non-empty, so the render fails with Failed to apply template: undefined value. This happens in two places: when the preface is prefilled at creation (prefillPrefaceOnInit = true in Kotlin, prefillPrefaceOnInit: true on the web, SetPrefillPrefaceOnInit(true) in C++; the default is false), where creating the conversation fails with that error, and in the preface render (renderPrefaceIntoString() in Kotlin and Swift, RenderPrefaceIntoString() in C++, litert_lm_conversation_render_preface_to_string in the C API). The same happens with extra context (such as enable_thinking) and no messages, and in the preface render with an empty preface (run in the runtime on one Qwen3 template; the other templates rendered with minijinja 2.14 and jinja2). Read in the source of LiteRT-LM 0.17.0, 0.18.1 and main; measured with LiteRT-LM 0.18.1 (the litert-lm package from PyPI) through its C API on these files' template text. The default path, where the first message is rendered together with the preface, is not affected: the Python API and the CLI of 0.18.1 expose neither the flag nor the preface render, and Google AI Edge Gallery sets neither (its source as read on 2026-10-25). A system message or any initial message in the conversation config avoids it.

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

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

GPU в ailist

Универсальный рантайм · litert-lm

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

Библиотека «litert-lm» рантаймом не поддерживается.

Ревизия весов
69b0117

0 моделей