Google updates Tensor SDK for on-device AI development

Google updates Tensor SDK for on-device AI development

Google has updated its Tensor SDK, currently in beta, with tools for running custom AI models directly on mobile devices. Released on November 24, version 2.2 adds support for compiling fine-tuned language models and measuring inference performance and energy consumption.

The SDK works with LiteRT, formerly TensorFlow Lite, to execute machine learning workloads on the dedicated Tensor Processing Unit (TPU) inside Google’s Pixel smartphones. The latest release supports the Tensor G5 and G6 chipsets used in the Pixel 10 and Pixel 11 series, respectively.

Google has also expanded its Model Garden with more than 30 models. The additions cover workloads such as speech synthesis, audio classification, image generation, facial recognition, and text recognition.

Running inference locally removes the need to transmit model inputs to a remote inference endpoint, although applications can still transmit data separately. Google’s Android development guidance identifies device storage, available RAM, and battery consumption as deployment constraints.

Compiling models for local inference

According to Google’s release notes, developers can now export fine-tuned Gemma 4 E2B checkpoints and compile them for Tensor G5 and G6 processors. The compilation process packages models into .litertlm bundles for execution on the device’s TPU.

Google also provides pre-compiled versions of Gemma 4 E2B, Gemma 3 1B, and EmbeddingGemma, allowing developers to deploy these models without compiling their own checkpoints.

Google’s post-training quantisation configurations for Gemma 4 E2B differ in model size, decoding latency, and accuracy. According to Google, reducing weight precision lowers memory requirements and decoding latency, while retaining higher precision in selected model components helps preserve accuracy.

An eight-bit transformer configuration produces a 4.20GB model bundle, compared with 2.84GB for the four-bit configuration. Google recommends the latter for simpler tasks or models fine-tuned for specific domains.

Mixed-precision configurations produce bundles of 3.06GB and 3.47GB, with both retaining eight-bit precision in attention and per-layer projections. The larger configuration also retains eight-bit precision in selected multilayer perceptron (MLP) components, which Google recommends for more complex reasoning tasks on devices with higher memory capacity.

Google also lists a 2.74GB quantisation-aware training (QAT) model as a baseline. The figures represent compiled model bundle sizes rather than total runtime memory consumption.

The SDK update also introduces an experimental agent skill that automates the compilation, benchmarking, and packaging of LiteRT models. Developers can compile models on a separate workstation before testing them on a connected Pixel smartphone.

The packaging process generates a Google Play AI pack, a neural processing unit (NPU) runtime module, a CPU fallback model, and a Kotlin loader for integration into Android Gradle projects. Developers can test whether the packaged application executes on the TPU or falls back to the CPU.

However, the agent skill does not currently support LLMs or .litertlm model bundles. Developers working with Gemma checkpoints must follow Google’s separate language model compilation and deployment workflow.

Through Google Play’s on-device AI delivery system, developers can distribute models during application installation, through background downloads, or on demand. Device targeting allows developers to distribute different model configurations according to the target hardware.

Applications using background or on-demand delivery require network connectivity to download the model before inference can take place locally. Downloads exceeding 200MB over mobile networks require user consent.

Measuring inference performance

The SDK introduces LiteRT telemetry hooks that measure TPU tile execution time in microseconds and average TPU energy consumption per inference in microjoules. The execution-time metric isolates TPU computation from CPU-side processing overhead and scheduling delays.

Developers can configure the telemetry hooks through environment variables and retrieve reports using Android Debug Bridge (ADB).

Google’s experimental agent skill also records inference latency and peak memory consumption, allowing developers to compare CPU and TPU execution on compatible Pixel devices. GPU benchmarking is not currently supported.

Developers can export benchmark results in JSON format alongside raw execution logs and formatted reports.

The Tensor SDK update follows the recent release of LiteRT-LM v0.20.0, Google’s runtime for executing language models locally. The runtime now reads NPU execution settings from model bundle metadata when developers have not explicitly configured them.

Hardware and benchmarking restrictions

Google’s Tensor SDK requires ahead-of-time (AOT) compilation for TPU-accelerated inference and does not currently support just-in-time (JIT) compilation on client devices.

The wider LiteRT framework supports both compilation methods through hardware acceleration technologies from Qualcomm, MediaTek, Samsung, and Intel. Developers can also compile models for multiple hardware vendors and processor versions within a single workflow.

According to Google’s LiteRT documentation, AOT compilation reduces initialisation overhead and memory consumption. JIT compilation allows developers to distribute models without preparing processor-specific binaries in advance but introduces additional processing during initialisation.

While the November 24 release notes announce fine-tuned Gemma 4 E2B compilation support for both Tensor G5 and G6, Google’s detailed custom checkpoint compilation instructions currently focus on Tensor G6. The documentation also recommends pre-compiled language models for Tensor G5 devices.

Access to the Tensor SDK compiler remains subject to approval through Google’s beta programme. Local compilation requires an x86-64 Linux workstation with at least 16GB of RAM, although Google recommends 64GB or more when working with larger model inputs.

Developers working on Windows or macOS can use Google Colab as a remote Linux compilation environment. On-device benchmarking can then take place on a computer connected to a Pixel 10 or Pixel 11 with USB debugging enabled.

According to Google’s release notes, the revised SDK and compiler terms permit third-party distribution and internal benchmarking but retain restrictions on publishing benchmark results externally.

Clause 4.16 of Google’s publicly available Tensor SDK and compiler licence agreement prohibits the external publication of benchmark comparisons between Google Tensor and other devices. Clause 4.17 separately restricts the distribution of Tensor-related performance data.

The publicly available licence agreement, last updated on October 28, still contains restrictions on SDK redistribution. Google’s November 24 release notes state that third-party distribution is now permitted.

(Photo by Growtika)

See also: Google’s Android Bench 2.0 tests AI models on complex tasks

Banner for AI & Big Data Expo by TechEx events.

Want to dive deeper into the tools and frameworks shaping modern development? Check out the AI & Big Data Expo, taking place in Amsterdam, California, and London. Explore cutting-edge sessions on machine learning, data pipelines, and next-gen AI applications. The event is part of TechEx and co-located with other leading technology events. Click here for more information.

Developer Tech News is powered by TechForge Media. Explore other upcoming enterprise technology events and webinars here.