You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[RFC] Single-archive model distribution format for LLMΒ #17640
Deploying an ExecuTorch LLM requires managing multiple separate files:
.pte β exported program
.ptd β optional external weights
Tokenizer file (tokenizer.json, .model, .bin)
Prompt template / chat template β not stored anywhere, app must hard-code per model family
Generation config (num_bos, num_eos, etc.) β caller must set correctly
Some metadata lives in .pte via constant_methods (get_max_seq_len, get_eos_ids, etc.), but tokenizer and chat template are external. Users can easily mismatch tokenizer and model, or use the wrong prompt format.
Proposal
A zip archive (.etm β ExecuTorch Model) bundling everything:
metadata.json carries what's not in constant_methods today β most importantly chat_template, so the runner can format prompts without app-side logic.
Prior Art
MediaPipe Tasks (.task): TFLite model + tokenizer + metadata in a single zip-like bundle
GGUF (llama.cpp): single file embedding tokenizer vocab and metadata alongside weights
Hugging Face: config.json + tokenizer.json + chat_template in a model repo
Open Questions
File extension: .etm? .etb? Just .zip?
LLM-only initially, or general-purpose for all ExecuTorch models?
Chat template format: Jinja2 (HF-compatible) or simpler substitution?
Runtime loading: unzip to temp dir vs. read from zip in-memory?
if we want to stick to 3 then et Bundle (.etb) or et Package (.etp) are both fine to me
Runtime loading: unzip to temp dir vs. read from zip in-memory?
Just dont actually compress it like .pt and .pt2 so you can mmap
Chat template format: Jinja2 (HF-compatible) or simpler substitution?
thats fine we can expand it later
Keep supporting multi-file approach alongside?
Any api built around this would by necessity just wrap the previous apis so theres no deprecation here
LLM-only initially, or general-purpose for all ExecuTorch models?
LLM only I would say. If a user wants to bundle other files for non structured models they can already just do that.
In general I think it sounds fine since we have some opinionated apis like extension/llm, the demo apps, and optimum to create a folder archive for them. I will say Im prototyping something for tokenizer as a delegate already though. I would also like if we are doing this to stop putting metadata in the pte and instead put it all in metadata.json.
Activity
JacobSzwejbka commentedon Feb 24, 2026
.etlm?
if we want to stick to 3 then et Bundle (.etb) or et Package (.etp) are both fine to me
Just dont actually compress it like .pt and .pt2 so you can mmap
thats fine we can expand it later
Any api built around this would by necessity just wrap the previous apis so theres no deprecation here
LLM only I would say. If a user wants to bundle other files for non structured models they can already just do that.
In general I think it sounds fine since we have some opinionated apis like extension/llm, the demo apps, and optimum to create a folder archive for them. I will say Im prototyping something for tokenizer as a delegate already though. I would also like if we are doing this to stop putting metadata in the pte and instead put it all in metadata.json.
JacobSzwejbka commentedon Feb 24, 2026
Separately if we add loaders we could presumably support safetensors and gguf as other weight formats fwiw. Not critical path here
larryliu0820 commentedon Feb 24, 2026
Overall seems like a good feature! We should include chat template if possible. We have a plan to support chat_template.jinja2 #16987