GPU Clean Conversion
Convert a PyTorch or Hugging Face model into a LiteRT model that runs fully on the GPU via the CompiledModel API with verified-correct output, and lay it out as a model recipe. Use when converting a new model, or when a converted model is rejected by the GPU, falls back to CPU, or returns wrong numbers on device.
Install
npx skills add google-ai-edge/litert-samples --skill gpu-clean-conversiongit clone --depth 1 https://github.com/google-ai-edge/litert-samples.git /tmp/litert-samples
mkdir -p ~/.claude/skills
cp -r /tmp/litert-samples/skills/gpu-clean-conversion ~/.claude/skills/gpu-clean-conversionPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# GPU-clean conversion
A conversion is done when three things hold, in this order:
1. it converts,
2. every node runs on the GPU,
3. **the on-device output matches the source model.**
Step 3 is not implied by step 2. The delegate can report full residency and
still return wrong numbers — that is the failure mode most of the rewrites
below exist for. Never call a model done without a numerical check against
CPU or PyTorch on the actual device.
## Loop
**1. Convert plain first.** No patches. This tells you what the model
actually needs rather than what you assumed.
**2. Verify through the CompiledModel API before touching a device.**
```python
from litert_gpu_toolkit import check_gpu_compatibility, print_report
print_report(check_gpu_compatibility("model.tflite"))
```
It compiles the model for the GPU accelerator, runs every signature on
random inputs, and compares the outputs against a CPU-compiled reference.
A failed GPU compile names the offending op — route it through the table
below. A pass with a CPU-fallback warning means some ops fell back to the
CPU; treat them the same way if you need full residency. This exercises the
host GPU, so step 5 on the actual device is still required.
When no GPU runtime is at hand (a CI job, a laptop without the accelerator),
a static pre-flight gives the first read: [edge-lint](https://github.com/john-rocky/edge-compat)
parses the `.tflite` and reports, per op, what a measured compatibility matrixDetails
- Skill name
gpu-clean-conversion- Repository
- google-ai-edge/litert-samples
- Path
skills/gpu-clean-conversion/SKILL.md- License
- Apache-2.0
- Repo updated
- 17 November 2026
FAQ
What does the GPU Clean Conversion skill do?
Convert a PyTorch or Hugging Face model into a LiteRT model that runs fully on the GPU via the CompiledModel API with verified-correct output, and lay it out as a model recipe. Use when converting a new model, or when a converted model is rejected by the GPU, falls back to CPU, or returns wrong numbers on device.
How do I install the GPU Clean Conversion skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add google-ai-edge/litert-samples --skill gpu-clean-conversion. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is GPU Clean Conversion popular?
It lives in google-ai-edge/litert-samples, which has 499 GitHub stars and 134 forks.
Related skills
Litert Lm
499google-ai-edge/litert-samples
Builds an Android app that runs an open text LLM on the device, on the CPU or the GPU, with the LiteRT-LM Kotlin API (com.google.ai.edge.litertlm:litertlm-android). Use this skill when creating a chat, summarization, or extraction feature with a .litertlm model from Hugging Face litert-community (Gemma, Qwen, Llama, Phi), including the Gradle dependency, the GPU manifest entries, getting the model file onto the device, Engine initialization off the main thread, a streamed multi-turn Conversation with sendMessageAsync, and the AndroidViewModel and Compose screen. Don't use for running .tflite v
Litert Runtime
499google-ai-edge/litert-samples
Configures and implements LiteRT (.tflite) on-device inference on Android in Kotlin using the CompiledModel API on CPU and GPU. Use this skill for any Android LiteRT or .tflite task, including Gradle setup, image classification or vision/audio/embedding helpers, TensorBuffer reuse, CPU memory optimization, Bitmap preprocessing, AndroidViewModel GPU-to-CPU fallback with warm-up on a single-thread dispatcher, LiteRT in Google Play services (play-services-litert), migrating from legacy org.tensorflow.lite.Interpreter, GpuDelegate, or play-services-tflite, and latency benchmarking. Don't use for r
Accuracy Safe Quantization
499google-ai-edge/litert-samples
Shrink a converted LiteRT model with ai-edge-quantizer (fp16 / int8 / int4) without losing accuracy, verifying parity against the float source after every step. Use when choosing a quantization recipe for a new model, when a quantized model fails to load, degrades on a task benchmark, or degenerates over long generations, or when deciding between dynamic-range, weight-only, and blockwise variants.
Litert Compiled Model Migration
499google-ai-edge/litert-samples
Rapidly migrate an Android application from legacy TensorFlow Lite (TFLite) to the modern LiteRT CompiledModel API (2.x) in Open Source GitHub repositories, keeping the TensorFlow Lite Support Library as LiteRT Support (litert-support 2.3.0). Covers buffer reuse, NPU JIT compilation, a reference implementation, and a two-stage verification gate (compile check, then an on-device parity test against a golden output).
Compiled Model App Scaffolding
499google-ai-edge/litert-samples
Build a new Android app (Kotlin, Compose) around a verified LiteRT model using the CompiledModel API - the app architecture, the inference-layer lifecycle rules, model delivery, and the UI traps that masquerade as model bugs. Use when turning a converted and device-verified model into a demo or product app, when an app's inference layer leaks memory or blocks the UI, or when a model that verified clean looks wrong inside an app.
Litert Google Tensor
499google-ai-edge/litert-samples
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 remotely via 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 pr
Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.