POLARIS-Project/Polaris-4B-Preview
converted to the
LiteRT-LM
(
.litertlm
) format for on-device inference with Google's
LiteRT-LM
runtime (the engine behind the
official
litert-community/*
models).
Polaris-4B is an
RL post-trained reasoning model
built on Qwen3-4B (standard dense
qwen3
, Apache-2.0). It is tuned for hard competition math and works the problem inside a
<think>…</think>
chain before answering — a
SOTA-for-size math reasoner
that runs
fully on a phone.
File
model.litertlm
(~2.3 GB; embedding externalized so every section is <2 GiB → loads on iOS)
Polaris-4B's headline is competition math. Per the base model card, at
~4B params
it
reports
AIME24 81.2 / AIME25 79.4
, in the range of far larger frontier reasoners. It is
optimized for long-chain hard-problem reasoning rather than grade-school arithmetic — give
it a
generous token budget
(it thinks at length).
Usage
litert_lm_main \
--model_path model.litertlm \
--backend gpu \
--input_prompt "Find the number of ordered pairs (a,b) of integers with 1<=a,b<=100 such that a*b is a perfect square."
The
.litertlm
bundle carries the tokenizer and a ChatML prompt template
(
<|im_start|>role\n … <|im_end|>
). It emits a
<think>…</think>
chain then the final
answer, and stops cleanly at
<|im_end|>
.
Set a high max-tokens
(≥2048) — a reasoning
model truncated mid-thought produces no answer.
Run on Android
Install a recent
Google AI Edge Gallery
(1.0.16+ imports
.litertlm
directly from Hugging Face), import this repo (or push
model.litertlm
), pick the
GPU
backend, and chat. It's a ~2.3 GB / 4B model — GPU
needs a ~12 GB+ device; free RAM first on smaller phones.
Quality — GSM8K (on-device int4 parity)
Measured on GSM8K (n=50, greedy, 0-shot chain-of-thought,
max-tokens 2048
):
Configuration
GSM8K
This model — LiteRT int4 (block128 + OCTAV)
82.0%
Non-degenerate, passes the local quality gate
8/8
with a clean stop at
<|im_end|>
.
GSM8K undersells this model — it is tuned for AIME-level problems, and on easy arithmetic its
long exploratory reasoning is not where its edge shows.
block128
is used (rather than
block32) because a 4B reasoning model's block32 weights can corrupt on the iPhone Metal GPU;
block128 loads and runs stably across iPhone / Android / desktop.
Conversion
Converted with
litert-torch
: blockwise int4
(block 128) + OCTAV optimal-clipping, embedding INT8, KV cache 4096, ChatML template.
Polaris-4B is a standard dense
Qwen3ForCausalLM
(with
rope_scaling: yarn
, exported with a
cache within
original_max_position_embeddings
so base RoPE is exact), so it rides the
existing Qwen3 converter with no custom graph code.
externalize_embedder=True
keeps every
.litertlm
section under the iOS ~2 GiB single-section
mmap
limit so it loads on iPhone.
Polaris-4B-Preview huggingface.co is an AI model on huggingface.co that provides Polaris-4B-Preview's model effect (), which can be used instantly with this litert-community Polaris-4B-Preview model. huggingface.co supports a free trial of the Polaris-4B-Preview model, and also provides paid use of the Polaris-4B-Preview. Support call Polaris-4B-Preview model through api, including Node.js, Python, http.
Polaris-4B-Preview huggingface.co is an online trial and call api platform, which integrates Polaris-4B-Preview's modeling effects, including api services, and provides a free online trial of Polaris-4B-Preview, you can try Polaris-4B-Preview online for free by clicking the link below.
litert-community Polaris-4B-Preview online free url in huggingface.co:
Polaris-4B-Preview is an open source model from GitHub that offers a free installation service, and any user can find Polaris-4B-Preview on GitHub to install. At the same time, huggingface.co provides the effect of Polaris-4B-Preview install, users can directly use Polaris-4B-Preview installed effect in huggingface.co for debugging and trial. It also supports api for free installation.