agentleFS
google-ai-edgegoogle-ai-edge/litert-torch/SKILL.md

converting-pytorch-to-litert

Skill1.1k starsChanged 3 years agoApache-2.0View on GitHub

Converts PyTorch models (e.g. ResNet, timm, HuggingFace transformers) directly to LiteRT (.tflite) flatbuffer format. Use when converting PyTorch models to TFLite, setting up export environments, or troubleshooting torch-to-litert conversion bugs. Don't use for ONNX exports or converting existing TensorFlow models.

  • Installs packages

1 other project uses a version of this.

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 3 mentionsMay 2026: 2 mentionsJun 2026: 3 mentionsJul 2026: 1 mentionAug 2026: 4 mentionsSep 2026: 6 mentionsOct 2026: 19 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the google-ai-edge/litert-torch repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about google-ai-edge/litert-torch

The biggest 5 of 39 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 39

Talked about on GitHub (39 times).

On GitHub · 39

34 more on GitHub
  • Other versions1 project uses a version of this.

    Word for word · 1

    1. google-ai-edge/ai-edge-torch★ 1.1k100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    ATTENTION ALL AGENTS: If you are tasked with converting a PyTorch model (e.g., ResNet or similar architectures) to a .tflite flatbuffer …

    line 12
  2. Very specific:

    Use the litert-torch library for the direct PyTorch to TFLite conversion.

    line 18
  3. Very specific:

    Before running any conversion script, ensure the following are installed in your python3.11 environment:

    line 25

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PyTorch to LiteRT Conversion Guide

ATTENTION ALL AGENTS: If you are tasked with converting a PyTorch model (e.g., ResNet or similar architectures) to a .tflite flatbuffer format in this repository, you must strictly follow these rules based on recent project findings:

1. Direct Conversion Only (No ONNX)

Bypass ONNX entirely. Do not attempt to export the model to ONNX or use onnx2tf. Convert directly from PyTorch to LiteRT.

2. Use litert-torch

Use the litert-torch library for the direct PyTorch to TFLite conversion. Note that ai-edge-torch is deprecated and has been officially renamed to litert-torch.

3. Strict Python Environment Rules

  • Do NOT use Python 3.14. It currently has compatibility issues with typing in torchao (AttributeError: 'typing.Union' object has no attribute '__module__').
  • Use Python 3.11 (e.g., python3.11) as it is highly recommended for stability and avoids the aforementioned type hint bugs.

4. Dependencies

Before running any conversion script, ensure the following are installed in your python3.11 environment:

python3.11 -m pip install torch transformers timm litert-torch ai-edge-litert litert-cli-nightly

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.