shipping-a-model-in-a-react-native-applisted
Install: claude install-skill ErtasAI/open-model-skills
# Shipping a model in a React Native app
Two runtimes cover React Native and Expo, and they do not take the same
artifact. Picking between them is the first decision here, before any
package gets installed, because reading the wrong runtime's docs for an hour
is a common way to lose an afternoon.
## Which artifact shape this needs
| You are holding | Package | What it eats |
|---|---|---|
| A `.pte` file, plus `tokenizer.json`, `tokenizer_config.json`, `config.json` | `react-native-executorch` | An ExecuTorch program |
| A single `.gguf` file | `llama.rn` | GGUF, self-contained |
These are two separate native modules with two separate build steps. There is
no package that takes both. If a `.pte` file gets handed to `llama.rn`, or a
`.gguf` file to `react-native-executorch`, it fails to load, full stop.
**If what you are holding is neither of these,** a merged Hugging Face
checkpoint (`config.json` + `model*.safetensors`) or a PEFT adapter directory
(`adapter_config.json` + `adapter_model.safetensors`), it is not shippable
into React Native as is. Run **inspecting-a-model-bundle** first to confirm
which shape you actually have, then convert:
- To `.pte`: `optimum-cli export executorch`, covered below and in
`references/executorch-path.md`.
- To GGUF: `convert_hf_to_gguf.py` then `llama-quantize`, covered below and
in `references/llama-rn-path.md`.
A PEFT adapter directory converts to neither format directly. Either merge it
into its base model first and export from