litert-google-tensor
БесплатноЗапускает вложенные скриптыНе проверен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…
от google★ 25 380 звёзд на GitHubОб этом скилле
LiteRT on Google Tensor: compile, benchmark, package for apps
Three scriptable workflows for Pixel TPUs:
- Compile a plain
.tfliteinto a Google Tensor AOT-compiled.tflitewith the public LiteRT Python API (ai_edge_litert.aot), locally on Linuxx86_64or on a Google Colab VM (--colab, viagoogle-colab-cli) when the user is on macOS/Windows or lacks a Linux box. - 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. - 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
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).
| Path | Purpose |
|---|---|
| assets/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 |
| assets/templates/ | Gradle, Kotlin, INTEGRATION.md and UPDATE.md templates (package_ai_pack.py) |
| references/compile-flags.md | API, compiler flags, script options, --colab |
| references/benchmark-flags.md | What the benchmark runs, binaries, writing the report, example output |
| references/app-integration.md | Packaging for an app: contents, checks, delivery modes, applying the plan, checking on a Pixel |
| references/troubleshooting.md | Symptom -> fix tables |
| references/contributing.md | Maintainers: adopting a new LiteRT release |
Every script supports --help and --dry-run and is Python 3 standard library
only, so it runs with any python3, with two exceptions that import LiteRT: a
local compile (compile_model.py without --colab, --dry-run or
--print-install) must use the virtualenv's interpreter
(<venv>/bin/python SKILL_DIR/scripts/compile_model.py ..., or activate the
venv first), and a real package_ai_pack.py run (not --dry-run or
--check-project) needs a Python with ai-edge-litert (the compile venv
works; the Beta SDK is not needed).
Prerequisites (tell the user up front)
| Need | Compile (local) | Compile (--colab) |
Benchmark | Package (app) |
|---|---|---|---|---|
Google Tensor SDK Beta access - sign up at https://services.google.com/fb/forms/tensor_ml_sdk_experimental_access (overview: https://developers.google.com/edge/litert/next/tensor-sdk). Google emails a download link for litert_plugin_compiler.tar.gz; the compiler cannot be installed without it. |
required | required (--sdk-tarball or --sdk-url) |
- | - |
| Host OS | Linux x86_64, >= 16 GB RAM | any OS (colab CLI on PATH; runs on a remote Colab Linux x86_64 VM) |
any OS with adb |
any OS where ai-edge-litert installs (the compile venv's Linux x86_64 host works) |
| Python environment | Local venv with ai-edge-litert + ai-edge-litert-sdk-google-tensor at the version in versions.json (compile_model.py --print-install) |
Any local python3 + google-colab-cli (compile_model.py --print-install --colab); SDK is installed on the Colab VM automatically |
any python3 (stdlib only) |
a Python with ai-edge-litert (the compile venv works; the SDK package is not needed) |
adb on PATH, Pixel 10/11 with USB debugging enabled |
- | - | required | step 7 (install and check the app) |
A JDK the app's Gradle supports (JAVA_HOME), the Android SDK, the project's ./gradlew |
- | - | - | steps 6-7 (build, install); bundletool is downloaded once |
libLiteRtDispatch_GoogleTensor.so - downloaded automatically from the public LiteRT binaries bucket (same directory as benchmark_model), or supplied with --dispatch-lib |
- | - | required | - (the app gets it from Google Maven) |
| Internet | once for pip install |
required (Colab VM + pip install) |
once to fetch benchmark_model + dispatch lib (cached in ~/.cache/litert-google-tensor/) unless suppli |
Установить litert-google-tensor в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл litert-google-tensor?
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.
Как установить скилл litert-google-tensor?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл litert-google-tensor запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub