litert-google-tensor

litert-google-tensor is a skill for Claude Code, Codex from google-ai-edge/litert-samples. It costs 260 tokens per session (15,283 once invoked), scanned D, original, Apache-2.0.

A workflow for compiling LiteRT machine-learning models for Google Tensor processors in Pixel phones, measuring their performance, and preparing them for Android apps.

In plain words
What is it for?
Use it to compile .tflite models, benchmark them on a connected Pixel, compare CPU and NPU results, and package the model and runtime files for an Android app.
Why use it?
It helps developers prepare models for Tensor hardware when local Linux tools or a connected Pixel are needed, including remote compilation through Google Colab.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to compile .tflite models, benchmark them on a connected Pixel, compare CPU and NPU results, and package the model and runtime files for an Android app.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/google-ai-edge/litert-samples/litert-google-tensor
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add google-ai-edge/litert-samples --skill litert-google-tensor
Clone the repo
git clone --depth 1 https://github.com/google-ai-edge/litert-samples

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for litert-google-tensor

README.md
[![agentmods](https://agentmods.dev/badge/skills/google-ai-edge/litert-samples/litert-google-tensor/github.svg)](https://agentmods.dev/skills/google-ai-edge/litert-samples/litert-google-tensor)
Your own site
<a href="https://agentmods.dev/skills/google-ai-edge/litert-samples/litert-google-tensor"><img src="https://agentmods.dev/badge/skills/google-ai-edge/litert-samples/litert-google-tensor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for litert-google-tensor

Your own site · 80×15
<a href="https://agentmods.dev/skills/google-ai-edge/litert-samples/litert-google-tensor"><img src="https://agentmods.dev/badge/skills/google-ai-edge/litert-samples/litert-google-tensor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 260 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 15,283 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00260 $0.15283
Opus 5.5 $0.00104 $0.06113
Sonnet 5.5 $0.00052 $0.03057
Haiku 4.5 $0.00026 $0.01528

Measured 1mo ago against content hash f8bbb30c8b34, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade D, and why

litert-google-tensor scanned grade D with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/benchmark_on_device.py, scripts/check_compiled.py, scripts/compile_model.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

Debian/Ubuntu `python3 -m venv` may need `sudo apt install python3-venv`. If

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

`adb shell ls -la <base>` and `adb shell rm -rf <base>/run-*`, where `<base>`
skills/litert-google-tensor/SKILL.md · 796 lines

How it starts

The opening of the file, as written. The whole thing — 796 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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) - either locally on Linux x86_64 or remotely 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 binary, NPU-only, optionally next to a CPU baseline, including TPU tile time (pure TPU compute time) and TPU energy per inference, both from the Tensor runtime's hooks.
  3. Package compiled builds for an Android (Gradle) app: a Google Play AI pack written by LiteRT's own exporter (ai_edge_litert.aot.ai_pack) from the files as they are, the Google Tensor NPU runtime as a feature module (from Google Maven), a Kotlin loader and a step-by-step INTEGRATION.md. For an app that already ships Google Tensor builds, it prepares only the files to replace, under the app's own paths, with an UPDATE.md. When the user agrees, the agent applies the plan to the project (one approval, separate OKs for risky changes) and checks the app on a Pixel.

Everything runs synchronously in the user's terminal; the scripts never start background processes and always clean up what they pushed to the phone or allocated on Colab. All paths below are relative to this skill's directory (SKILL_DIR).

SKILL_DIR/
  versions.json                    # LiteRT versions the scripts use (single source)
  scripts/check_compiled.py        # is this .tflite already Tensor-compiled?
  scripts/compile_model.py         # AOT compile (local Linux x86_64 or --colab)
  scripts/benchmark_on_device.py   # adb push -> benchmark -> parse -> cleanup
  scripts/package_ai_pack.py       # compiled builds -> AI pack + Gradle modules for an app, or an update of one
  scripts/install_and_verify.py    # build the app, install it like Google Play, read the NPU/CPU result
  templates/                       # Gradle, Kotlin, INTEGRATION.md and UPDATE.md templates (package_ai_pack.py)
  references/compile-flags.md      # API, compiler flags, and --colab reference
  references/benchmark-flags.md    # benchmark_model flags, output, binaries
  references/app-integration.md    # packaging for an app: contents, delivery modes, checks
  references/troubleshooting.md    # symptom -> fix tables
  references/contributing.md       # maintainers: adopting a new LiteRT release

Every script supports --help and --dry-run (check_compiled.py is read-only, so its --dry-run is a no-op) and is Python 3 standard library only. compile_model.py imports LiteRT only for a local compile: its --help, --dry-run, --print-install ([--colab]), and --colab runs work with any local python3, while a local compile must use the virtualenv's interpreter (<venv>/bin/python SKILL_DIR/scripts/compile_model.py ..., or activate the venv first). package_ai_pack.py likewise imports LiteRT only for a real run, which needs a Python with ai-edge-litert (the compile venv works; the Beta SDK is not needed); its --check-project mode and the other scripts run with any python3.

Read the full file on GitHub · 796 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 796 lines · 260 tokens per session scan D f8bbb30c8b34

Subscribe to this mod's changes

litert-google-tensor is a skill published in the GitHub repository google-ai-edge/litert-samples (508 stars, last pushed 5d ago), licensed Apache-2.0. It adds 260 tokens to every session and 15,283 once invoked, about $0.0010 per session on Opus 5.5. A static security scan graded it D with 2 findings (asks for root, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-28.

Related

litert-google-tensor compared with skills from other repositories

litert-google-tensor next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
litert-google-tensorgoogle-ai-edge/litert-samplesSkill5085d agoApache-2.0D260Claude Code, Codex
android-adb-controlAbdullahMalik17/malikclawSkill223d agoMITA22Claude Code, Codex
core-nfcTalissonVitorino/kmp-ios-skillsSkill16todayMITA247Claude Code, Codex
kotlin-expertpersonamanagmentlayer/pclSkill461mo agoApache-2.0A55Claude Code
android-expertpersonamanagmentlayer/pclSkill461mo agoApache-2.0A64Claude Code
wifiFoneClaw-AI/foneclaw-androidSkill294d agoMITA54Claude Code, Codex
autofish-controlfelinics/AutofishSkill1213mo agoApache-2.0A42Claude Code, Codex