Litert Google tensor
Compiles LiteRT (.tflite) models ahead-of-time for Google Tensor TPUs.
Safety check
- Script runs other programs or code: scripts/benchmark_on_device.py line 84
- Script calls the network: scripts/benchmark_on_device.py line 88
- Script deletes folders with rm -rf: scripts/benchmark_on_device.py line 2306
- Script runs other programs or code: scripts/compile_model.py line 77
- Script runs other programs or code: scripts/install_and_verify.py line 67
- Script calls the network: scripts/install_and_verify.py line 71
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: litert-google-tensor
description: >-
Compiles LiteRT (.tflite) models ahead-of-time for Google Tensor TPUs
(Tensor G5 on Pixel 10, Tensor G6 on Pixel 11) locally on Linux x86_64 or
on Google Colab (--colab on macOS, Windows, or ARM hosts),
benchmarks them on a USB-attached Pixel with LiteRT's benchmark_model
(NPU latency, peak memory, TPU tile time, TPU energy, optional CPU baseline),
and packages compiled models for an Android Gradle app as a Google Play AI
pack with the Tensor NPU runtime module and a Kotlin loader, applies it to
the app and verifies it on a Pixel. Use when the
user asks to compile, AOT-compile, or prepare a .tflite model for the Pixel
TPU/NPU, check whether a .tflite is already Tensor-compiled, measure
on-device NPU performance of a compiled model, or package or deploy a
compiled model into their Android app (or replace the one it ships). Don't
use for Qualcomm, MediaTek, or Samsung NPUs, GPU-only benchmarking,
LiteRT-LM or LLM (.litertlm) models, on-device JIT compilation, non-Gradle
builds, or publishing to Google Play.
metadata:
version: "1.0.0"
category: AiAndMachineLearning
---
# LiteRT on Google Tensor: compile, benchmark, package for apps
Three scriptable workflows for Pixel TPUs:
1. **Compile** a plain `.tflite` into a Google Tensor AOT-compiled `.tflite`
with the public LiteRT Python API (`ai_edge_litert.aot`), locally on Linux
`x86_64` or on a Google Colab VM (`--colab`, via `google-colab-cli`) when
the user is on macOS/Windows or lacks a Linux box.
2. **Benchmark** a compiled model on a connected Pixel with LiteRT's
`benchmark_model`, NPU-only, optionally next to a CPU baseline, including
TPU tile time (pure TPU compute time) and TPU energy per inference.
3. **Package** compiled builds for an Android (Gradle) app as a Google Play AI
pack with the Google Tensor NPU runtime and a Kotlin loader (or, for an app
that already ships Google Tensor builds, only the files to replace), apply
the plan to the project when the user agrees, and check the app on a Pixel.
Everything runs synchronously in the user's terminal; the scripts never start
...From google's repository, Apache-2.0 licence.
Related skills
-
Checked
Android Gradle Plugin upgrade
Moves Kotlin Multiplatform projects to Android Gradle Plugin 9 and fixes the build failures it causes.
8/101 credit -
Checked
CocoaPods to SwiftPM
Moves Kotlin Multiplatform projects from CocoaPods to Swift Package Manager and updates the Xcode project.
8/101 credit -
Checked
Kotlin Native build speed
Diagnoses and fixes slow Kotlin/Native iOS builds in Kotlin Multiplatform projects, both locally and on CI.
7/101 credit -
Checked
SwiftUI Liquid Glass
Adds and reviews Liquid Glass in SwiftUI apps for iOS 26, avoiding pitfalls with bars, buttons and scrolling.
7/101 credit -
Checked
Native Mobile App Design
Designs Expo and React Native screens that feel truly native, with proper navigation, motion and dark mode.
7/101 credit -
Checked
Offline Android LLM apps
Builds an Android app that runs an open LLM on the phone with LiteRT, so it works without a server.
7/101 credit