whatisgithub

What is executorch?

pytorch/executorch — explained in plain English

Analysis updated 2026-06-26

4,602PythonAudience · developerComplexity · 4/5Setup · hard

In one sentence

ExecuTorch lets you run PyTorch AI models directly on phones, tablets, and microcontrollers with a 50KB on-device runtime, supporting chips from Apple, Qualcomm, ARM, and MediaTek with no cloud connection needed.

Mindmap

mindmap
  root((repo))
    What it does
      On-device AI inference
      PyTorch model export
    Hardware targets
      iOS and Android
      Microcontrollers
      Edge devices
    Languages
      Python export
      C++ runtime
      Swift on iOS
      Kotlin on Android
    Features
      50KB footprint
      Quantization
      Multi-backend
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Export a trained PyTorch model and run it inside an iOS app without any internet connection

USE CASE 2

Deploy a Llama language model to an Android phone to run offline text generation

USE CASE 3

Target multiple hardware chips from the same PyTorch model by changing a single export line

USE CASE 4

Run AI inference on a microcontroller using a model quantized down to fit in tight memory

What is it built with?

PythonC++SwiftKotlinPyTorch

How does it compare?

pytorch/executorchzju3dv/easymocapgoing-doer/paper2code
Stars4,6024,6024,601
LanguagePythonPythonPython
Setup difficultyhardhardmoderate
Complexity4/54/53/5
Audiencedeveloperresearcherresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires matching PyTorch and ExecuTorch versions, hardware backends need additional SDK setup (Xcode for iOS, Android NDK for Android).

So what is it?

ExecuTorch is a tool from the PyTorch team that lets developers take AI models they have already built and trained using PyTorch, then run those models directly on phones, tablets, embedded devices, and microcontrollers, rather than requiring a connection to a cloud server. It is used inside Meta's products including Instagram, WhatsApp, the Quest 3 headset, and Ray-Ban Meta smart glasses. The general idea is that you prepare your model once on a regular computer, and ExecuTorch converts it into a compact file format that a small, lightweight program can execute on the target device. That on-device program has a base footprint of about 50 kilobytes, which is small enough to fit on quite constrained hardware. The conversion process can also apply optimizations such as quantization, which makes models smaller and faster at a small cost to precision. One of the notable aspects is hardware flexibility. The same converted model file can target many different processor types, including chips from Apple, Qualcomm, ARM, and MediaTek, as well as standard CPUs. Switching from one hardware backend to another requires changing a single line in the export step, not rewriting the model. Once a model is exported, you can run it from C++ code, from Swift on iOS, or from Kotlin on Android. The README includes short code examples for all three languages. Large language models such as Llama can also be exported and run on-device using the same workflow, with dedicated runner APIs for text generation. The project is open-source and installable via pip. Full documentation lives at the PyTorch documentation site, and a Discord community is available for questions and discussion.

Copy-paste prompts

Prompt 1
I have a trained PyTorch image classifier. Using pytorch/executorch, walk me through exporting it so it runs on an iPhone without any server connection.
Prompt 2
Using pytorch/executorch, show me the Kotlin code to load an exported model and run an inference pass on Android.
Prompt 3
I want to quantize my PyTorch model with ExecuTorch so it runs faster on a Qualcomm chip. Walk me through the quantization step during export.
Prompt 4
Help me install the pytorch/executorch pip package and run the basic inference example to verify my setup before targeting a mobile device.
Prompt 5
Using ExecuTorch, write the C++ code to load a .pte model file and run a single inference pass on an embedded device.

Frequently asked questions

What is executorch?

ExecuTorch lets you run PyTorch AI models directly on phones, tablets, and microcontrollers with a 50KB on-device runtime, supporting chips from Apple, Qualcomm, ARM, and MediaTek with no cloud connection needed.

What language is executorch written in?

Mainly Python. The stack also includes Python, C++, Swift.

How hard is executorch to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is executorch for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.