API#
ExecuTorch has two runtime layers:
The core runtime loads and executes methods in a compatible
.pteprogram. Use it when your application owns preprocessing, postprocessing, and task orchestration.The LLM runner builds on the core runtime with tokenization, prefill and decode orchestration, sampling, and streaming generation for text and multimodal models.
The table below is the entry point for choosing a language binding. Maturity follows the API Life Cycle and Deprecation Policy: an API is stable unless it is explicitly marked experimental or deprecated. An annotation on an individual API takes precedence over this summary.
Language / platform |
Core runtime |
LLM runner |
Maturity |
|---|---|---|---|
C++ |
Running an ExecuTorch Model Using the Module Extension in C++ for the high-level |
Core: stable; LLM: experimental |
|
Python |
Runtime Python API Reference for host-side loading, execution, and validation |
Python LLM runner bindings, whose availability depends on the installed package or source build |
Core: stable; LLM: experimental |
Android: Java / Kotlin |
Using ExecuTorch on Android and the
Javadoc for |
Running LLMs on Android for |
Core: experimental; LLM: experimental |
Apple: Swift / Objective-C |
Using ExecuTorch on iOS for |
Running LLMs on iOS for |
Core: follows API Life Cycle and Deprecation Policy; LLM: experimental |
Browser: JavaScript / WebAssembly |
WebAssembly |
No high-level LLM runner API |
Core: experimental |
Use the core runtime for any compatible exported model, including vision, audio, and custom workloads. Use an LLM runner only when the exported program and tokenizer satisfy that runner’s model metadata and packaging requirements.
Export and reference documentation#
Export API Reference — Export to ExecuTorch API Reference
Runtime API Reference — ExecuTorch Runtime API Reference
Runtime Python API Reference — Runtime Python API Reference
API Life Cycle and Deprecation Policy — API Life Cycle
Android API reference: Java/Kotlin API documentation
Running an ExecuTorch Model Using the Module Extension in C++ — Extension Module
Managing Tensor Memory in C++ — Extension Tensor
Detailed C++ Runtime APIs Tutorial — Detailed C++ Runtime APIs Tutorial