Instructions to use litert-community/InternVL3_5-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT-LM
How to use litert-community/InternVL3_5-1B with LiteRT-LM:
# LiteRT-LM runs on various platforms (Android, iOS, Windows, Linux, macOS, IoT, Web/WASM) # and supports many APIs (C++, Python, Kotlin, Swift, JavaScript, Flutter). # For platform-specific integration guides, please refer to the official developer website: # https://ai.google.dev/edge/litert-lm # To try LiteRT-LM, the easiest way is to use our CLI tool. # 1. Install the LiteRT-LM CLI tool: pip install -U litert-lm # 2. Download and run this model locally: # See: https://ai.google.dev/edge/litert-lm/cli # A single .litertlm file in the repo is picked automatically; otherwise the CLI asks which one to run # (or pass its name right after the repo id). litert-lm run \ --from-huggingface-repo=litert-community/InternVL3_5-1B \ --prompt="Write me a poem"
- LiteRT
How to use litert-community/InternVL3_5-1B with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
InternVL3.5-1B β LiteRT-LM (on-device Vision-Language Model)
This repository is a conversion of OpenGVLab/InternVL3_5-1B to LiteRT-LM, made with litert-torch (the file published on 2026-11-14, 09:26 UTC, has its prefill/decode graph rewritten for the GPU by a separate script; weights unchanged) for Google's LiteRT-LM runtime, for on-device image+text inference: on a Galaxy S26 GPU it decodes 77.0 tokens/s and prefills 1,024 tokens at 1,338 tokens/s (LiteRT-LM v0.19.0, 2026-11-14).
InternVL3.5-1B is a compact vision-language model: an InternViT vision encoder + pixel-shuffle +
MLP projector feeding a Qwen3-0.6B language decoder (the newer Qwen3 backbone is what distinguishes
it from the InternVL3-2B build, which used Qwen2.5-1.5B). This file runs it through LiteRT-LM's
fast_vlm multimodal path β give it an image and a question, get a grounded answer, fully on-device.
| File | model.litertlm (~0.82 GB) |
| Vision | InternViT encoder + pixel-shuffle + MLP projector, int8 weights β single 448Γ448 image β 256 image tokens |
| Decoder | Qwen3-0.6B, int4 weights (symmetric, blockwise-32 + OCTAV optimal-clipping); input embedding INT8 (externalized section) |
| Compute | integer |
| Context (KV cache) | 2048 |
| Image input | resized to 448Γ448 (ImageNet normalization is baked into the vision encoder) |
| Base model | OpenGVLab/InternVL3_5-1B (Apache-2.0) |
How to use
1. Install the runtime
pip install litert-lm
2. Run it in one command β this downloads the file, encodes your image and answers:
litert-lm run --from-huggingface-repo litert-community/InternVL3_5-1B model.litertlm \
--attachment photo.jpg \
--prompt "Describe this picture in one sentence." --top-k 1
On a 640 Γ 480 photo of two tabby cats on a pink blanket, this file answers:
Two tabby cats are lying on a pink couch with remote controls nearby.
(litert-lm 0.18.0 to 0.19.2 on a Mac CPU with 1 thread, and the flags above with litert-lm 0.19.2 on a Mac; litert-lm 0.17.0 and 0.17.1, and --backend gpu with litert-lm 0.19.2, give the same sentence with a comma after "couch"; 2026-11-14.)
Leave --vision-backend unset, as above; with --backend gpu and no --vision-backend, this file answers the picture (the sentence above). With --vision-backend gpu, neither this file nor the previous file answers a picture on a Mac (litert-lm 0.17.0 to 0.19.2): the GPU delegate does not take two of the vision encoder's ops (BROADCAST_TO and GATHER_ND).
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/InternVL3_5-1B/ and uses it again on later runs without checking its size. Delete that file and run the command again.
If you downloaded model.litertlm with --from-huggingface-repo before it was replaced on 2026-11-14 (09:26 UTC), delete ~/.litert-lm/cache/huggingface/litert-community/InternVL3_5-1B/model.litertlm, then run the command again. Without deleting it, the litert-lm CLI (0.14.0 to 0.19.2) keeps running the previous file: it uses a file it finds there without checking it against this repo.
Drop --prompt for an interactive chat, and pass --attachment more than once for several images. litert-lm serve exposes the same model as a local OpenAI-compatible API. The same file runs on macOS, Linux and Windows.
Performance
Measured on an earlier file: litert-lm benchmark (litert-lm 0.15.0) on an Apple M4 Max, -p 256 -d 256 --runs 3 (the tool averages three iterations), max-num-tokens 4096, warm-up run discarded, otherwise idle machine. These figures cover the text path; the vision encoder runs once per image and is not included.
| Device | Backend | Prefill (256) | Decode | TTFT |
|---|---|---|---|---|
| Apple M4 Max (macOS) | CPU | 338 tok/s | 43.7 tok/s | 0.84 s |
| Apple M4 Max (macOS) | GPU (Metal) | 3878 tok/s | 176.2 tok/s | 0.08 s |
Every desktop backend listed above was checked by actually generating a caption on it, not just by reading the benchmark tool's output.
Accuracy note
The vision tower converts bit-faithfully to the reference β float CPU output end-to-end corr β 1.0 (max abs diff ~1e-4), with no FLEX/CUSTOM fallback ops; int8 vision weights preserve grounding. The Qwen3-0.6B decoder uses the same blockwise-32 + OCTAV int4 recipe that scores 90.7% GSM8K on the Ministral-3-3B-Reasoning build. On a reference eager run the model describes photos accurately and in detail (e.g. a black-and-white Ansel-Adams-style landscape β "dramatic mountain landscape β¦ snow-capped peaks β¦ a winding river through a forested valley").
On-device performance: decode/load are expected to be in line with the InternVL3-2B build on the same runtime (~20 tok/s CPU, ~45 tok/s GPU on iPhone 17 Pro for single-image VQA). These iPhone figures are expectations, not measurements of this 1B/Qwen3 build; measure on an iPhone before quoting them. The Galaxy S26 section below was measured on this file.
Galaxy S26 β GPU and CPU
Each run prefills 1,024 tokens and generates 256 tokens, three times (three iterations): the runtime's benchmark mode takes the prompt file's one sentence ("Explain what on-device AI means in simple terms.") in the chat template and pads it with token id 0 to 1,024 tokens. The GPU row is the median of iterations 2β3 over two runs. On the CPU each iteration is slower than the one before, so each iteration has its own row: the median of that iteration over two runs.
| Backend | Prefill, 1,024 tokens | Decode | Time to first token | Peak (VmHWM) |
|---|---|---|---|---|
GPU (LiteRT GPU, every node of the prefill and decode graphs), iterations 2β3 |
1,338 tok/s | 77.0 tok/s | 0.78 s | 0.66 GB |
| CPU (XNNPACK), iteration 1 | 455 tok/s | 29.1 tok/s | 2.28 s | 1.51 GB |
| CPU (XNNPACK), iteration 2 | 270 tok/s | 21.7 tok/s | 3.84 s | 1.51 GB |
| CPU (XNNPACK), iteration 3 | 250 tok/s | 19.7 tok/s | 4.16 s | 1.51 GB |
Samsung Galaxy S26 (SM-S942Q / SM8850, Android 16), litert_lm_advanced_main built from LiteRT-LM v0.19.0 (commit 771b06e1), --benchmark with a 1,024-token prefill and 256 decode tokens, context 2,048, 2026-11-14. Each run is a new process. The phone starts lowering its CPU clock caps in the first 5 s of a CPU run and lowers them further until at least 30 s into the 45-second run, so each CPU iteration runs at a lower clock than the one before. Peak is the process's VmHWM (on the CPU 1.56 GB in a warm-up run before the two counted runs). It does not count memory the GPU driver holds: the phone's GPU allocation counter (kgsl_page_alloc) rose by about 1.66 GB during this file's GPU runs and by about 1.04 GB during those of the previous file. The rows cover the text path. With a photo of two cats on a pink blanket and the vision encoder on the CPU (--vision_backend=cpu), the phone answered "Describe this picture in one sentence." with "Two tabby cats are lying on a pink couch, with remote controls nearby." On a Pixel 11 Pro GPU this file decodes 23.4 tok/s, 37 % faster than the previous file (replaced on 2026-11-14, see Conversion notes), and prefills 915 tok/s, 1 % slower. On the S26 CPU the two files ran within the run-to-run spread: in each iteration this file's prefill and decode medians were between 1.5 % below and 5 % above the previous file's, and two counted runs of the same file differed by up to 10 %. The CPU peak was 1.51 GB in this file's two counted runs against 1.32β1.37 GB in the previous file's two. The runs behind each number, the Pixel 11 Pro runs, and the S26 section this card carried for an earlier file: MEASUREMENTS.md.
On this phone the GPU decodes 2.6β3.9Γ as fast as the CPU and prefills 2.9β5.4Γ as fast, so this repo's litertlm_manifest.json recommends gpu for flagship-class Android. The Pixel 11 Pro CPU was not measured.
GPU wiring, including the Gallery import toggle: GPU guide.
β οΈ Known limitation β one image per conversation on the GPU backend
Single-image VQA β the primary use case β works on GPU. But on the GPU (Metal) backend, a
second image in the same conversation truncates the answer β ask about one image per chat
(start a new conversation for a different image). This is GPU-delegate-specific, not a model or file
issue: on the CPU backend, multi-image works. The same GPU truncation reproduces with Apple's
litert-community/FastVLM-0.5B, so it is general to the runtime's GPU fast_vlm path, not specific to
this model. For reliable multi-image, run on the CPU backend.
Run on iPhone / macOS
Use the LiteRT-LM Swift runtime (swift-litert-lm /
the LiteRTDemo sample). Load model.litertlm with the image (vision) tower enabled
(modalities [.vision]), attach a photo, and ask a question.
Note for app integrators: this is a vision-only file (no audio tower). Bring up the engine with the vision modality only (
Modality.textImage/[.vision]) β requesting the audio tower (.all) on a file with no audio section fails at session creation.
Run on Android β Google AI Edge Gallery
Install a recent Google AI Edge Gallery (1.0.16+ can
import .litertlm directly from Hugging Face), download model.litertlm, import it (tap
+), attach an image and ask. The file already carries the tokenizer and prompt template.
Conversion notes
- LiteRT-LM
fast_vlmfile: VISION_ENCODER ([1,448,448,3]β[1,256,4096]) + VISION_ADAPTER ([1,256,4096]β[1,256,1024], matched to the Qwen3-0.6B hidden size) + single-token EMBEDDER + PREFILL_DECODE (embeddings-input). - The vision encoder bakes InternVL's ImageNet normalization and the NCHW transpose into the graph
(the runtime feeds a
[0,1]NHWC image). - The InternViT attention is rewritten 4D-clean (qkv split before the head reshape, avoiding a 5D intermediate) for the GPU delegate.
- Decoder extracted from the InternVLChat wrapper as a standalone
Qwen3ForCausalLM(dynamic rope_scaling stripped; exported with cache β€ base max so base RoPE is exact).
2026-08-28 β start_token fix (weights unchanged)
The file's LlmMetadata start_token held the literal string "None". This tokenizer has no BOS, and LiteRT-LM resolved that string to a real vocabulary token β so every prompt began with the word None, which the model was never trained on. The start token has been removed.
Metadata-only change: every section of the file except the LlmMetadata block is byte-identical to the previous file (verified by sha256 per section), so the weights, the graph and the tokenizer are unchanged and the speed and memory numbers on this card still describe exactly this file β only the file's own sha256 differs. What changed is the input: the token stream the model reads for a given conversation can differ from the previous file's, and it now matches this model's own reference chat stream. Greedy decoding can turn on a single token, so an individual answer can differ from the previous file in either direction. Unless a row says otherwise, the accuracy figures on this card were measured on the previous file and have not been re-measured on this one. If you downloaded before 2026-08-28, download again; with the litert-lm CLI, first delete the cached file as described under the command in How to use.
2026-08-30 β tokenizer section replaced (weights unchanged)
The tokenizer in model.litertlm was a SentencePiece conversion of the model's BPE tokenizer, and the conversion lost the byte-level semantics: a standalone accented letter or symbol (Γ©, Γ±, ΓΌ, Β°, Β·, β¦) was encoded to the id of a single-byte token instead of the token the upstream tokenizer uses, and 36 of the 223 standalone characters U+00A1βU+017F in the checks (Β‘, Δ to Δ‘, and Ε²) became the token the conversion had reused as UNK β the end-of-text token for this vocabulary. model.litertlm now embeds the upstream tokenizer.json (the same HF tokenizer path most files in this collection use).
Tokenizer-only change: every section of the file except the tokenizer is byte-identical to the previous file (verified by sha256 per section), so the weights, the graph and the chat template are unchanged and the speed and memory numbers on this card still describe this file per token β only the file's own sha256 differs. Verified on the LiteRT-LM runtime: one user message ("What is the capital of France?") as the chat template renders it, 7 test strings, the 223 standalone characters U+00A1βU+017F and every special token now tokenize identically to the upstream tokenizer, and the four ASCII-only test questions answer byte-identically to the previous file (same ids in, same tokens out). In the checks, text with accented letters, symbols or non-Latin scripts and a short Python snippet reach the model differently from before (digits, plain English text and the test emoji do not), so individual answers to such prompts can change. When this entry was written, the accuracy figures on this card and its on-device rows had been measured on earlier files unless a row said otherwise, and the 2026-08-25 Galaxy S26 GPU check had not been re-run on the 2026-08-30 file (the runtime's tokenizer code is the same on macOS and on device; the weights and graph are byte-identical). If you downloaded before 2026-08-30, download again; with the litert-lm CLI, first delete the cached file as described under the command in How to use.
2026-08-31 β chat template fix: history turns with role 'assistant' (metadata-only, weights unchanged)
The chat template in model.litertlm matched history turns only on role 'model', so a conversation created through the Conversation API with the standard role 'assistant' (for example create_conversation(messages=[...]) restoring a chat) silently dropped every assistant turn from the rendered prompt β the model saw consecutive user turns with its own replies gone. The template's role conditions now also accept 'assistant'. The engine's own send_message flow was never affected.
Template-only change: every section of the file except the metadata is byte-identical to the previous file (verified by per-section sha256), and single-turn renders, token ids, prefill counts and greedy answers are unchanged (verified on the LiteRT-LM runtime), so the numbers on this card still describe this file β only the file's own sha256 differs. Re-download only matters if you inject conversation history with role 'assistant'. Details: google-ai-edge/LiteRT-LM#3417 (https://github.com/google-ai-edge/LiteRT-LM/issues/3417).
2026-11-14 β GPU graph and a 1,024-token prefill (weights unchanged)
The prefill/decode graph now has the GPU form litert-torch writes with --apply_gpu_composites, plus a 1,024-token prefill (prefill_1024, copied from prefill_512). Every weight, and every section outside that graph, is byte-identical: sha256 7493d2c8β¦ (817,545,216 B) β f861075dβ¦ (819,838,976 B). On a Mac the two files give the same replies byte for byte: 4 prompts and a picture on the CPU (litert-lm 0.19.2, 1 thread, greedy decoding with top-k 1), and one prompt and a picture on the CPU and the prompt on the GPU with litert-lm 0.17.0 to 0.19.2. 8 short questions on the GPU: 6 of 8 with both files on a Mac and a Pixel 11 Pro; 7 of 8 with this file on a Galaxy S26 (the previous file was not asked there). Galaxy S26 GPU (LiteRT-LM v0.19.0, runs in the order previous, new, new, previous): decode 41.2 β 77.0 tokens/s, 1,024-token prefill 871 β 1,338 tokens/s; the previous file slowed within each run (its first iterations: decode 44.2, prefill 1,145 tokens/s). Procedure: REPRODUCE.md. Measured on this file: the opening sentence, the example answer under How to use and the two paragraphs after it, the Galaxy S26 section, the litert-lm 0.16.0 note and this entry; the rest of this card describes earlier files.
Known runtime issues
External weights (since 2026-11-09). In model.litertlm, the weights sit in TFLiteWeights sections at the end of the file (LiteRT's external weights) instead of inside the model graph. On a Pixel 8a, the GPU engine of the v0.18.0 and v0.18.1 Android builds crashes (SIGSEGV) on a Qwen3-0.6B file with external weights (LiteRT-LM#3986). The earlier file with the weights inside the graph stays at revision a51f218.
litert-lm 0.16.0 does not start a conversation with this file or with the previous file (Failed to create conversation, from the vision encoder's executor; checked on a Mac, CPU and GPU, 2026-11-14); litert-lm 0.17.0 to 0.19.2 do.
From the second turn of a conversation on, LiteRT-LM puts the previous answer's stop token into the KV cache with a zero embedding, because this file holds the embedding table in its own section and the decoder takes embeddings, so later answers in a conversation can differ from the answer the model gives to the same messages in one prompt (read in the source of LiteRT-LM 0.16.0 to 0.18.1; measured with 0.18.1 on WeVisOne-VL-2B and Qwen2.5-Coder-1.5B-Instruct, not on this file). One question per conversation avoids it, as does a new conversation that starts with the earlier messages and the new question.
On LiteRT-LM 0.18.1 and 0.19.1, once a message fails because it does not fit in the context window, every later message in that conversation fails as well (the next one with Task failed with state: 7). Start a new conversation after such an error.
- Downloads last month
- 878
Model tree for litert-community/InternVL3_5-1B
Base model
OpenGVLab/InternVL3_5-1B-Pretrained