Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
12ee8f8
docs: sync media assets and clean up sidebar config
barhanc Aug 26, 2026
2672dc3
docs: add legacy v0.9 docs directory
barhanc Aug 26, 2026
7116bd3
docs: rewrite getting-started, restructure fundamentals, add extensio…
barhanc Aug 26, 2026
e0e94a3
docs: add generated index cards for extensions and core & advanced ca…
barhanc Aug 26, 2026
ee28c00
docs: remove legacy docs
barhanc Aug 27, 2026
3c8137d
docs: write Core & Advanced guides (models/tensors, schema, operation…
barhanc Aug 27, 2026
a698246
docs: add Exporting Custom Models guide
barhanc Aug 27, 2026
a7de483
docs: add Downloading Models guide and document createResourceScope
barhanc Aug 27, 2026
0dbc21b
docs: link createResourceScope reference; document its track type param
barhanc Aug 27, 2026
612c184
docs: link the compatibility table from Getting Started requirements
barhanc Aug 27, 2026
e9028af
docs: restore compatibility page and link it from Getting Started
barhanc Aug 27, 2026
dbd1e9b
docs: trim Extensions category description in sidebar
barhanc Aug 27, 2026
2823653
docs: refine wording in error handling and worklets documentation
barhanc Aug 31, 2026
20b746d
docs: clarify custom pipelines are 100% typescript with no C++ needed
barhanc Aug 31, 2026
2d9c4a5
docs: update requirements with RN 0.81+, iOS 17+, and Android 13+
barhanc Aug 31, 2026
6250979
docs: rewrite image classification and object detection extension guides
barhanc Aug 31, 2026
6f51a42
docs: rewrite pose and keypoints extension documentation
barhanc Aug 31, 2026
cbee144
docs: rewrite optical character recognition (OCR) extension documenta…
barhanc Aug 31, 2026
35b96c2
docs: rewrite semantic segmentation extension documentation
barhanc Aug 31, 2026
0c01f26
docs: add color mapping details and HF collection link to semantic se…
barhanc Aug 31, 2026
785b6fd
docs: add HuggingFace collection links across all CV extension guides
barhanc Aug 31, 2026
4ed5008
docs: rewrite instance segmentation extension documentation
barhanc Aug 31, 2026
06a35a9
docs: rewrite neural style transfer extension documentation
barhanc Aug 31, 2026
8a7e18b
docs: rewrite image embeddings extension documentation
barhanc Aug 31, 2026
0dc5653
docs: rewrite text to image extension documentation
barhanc Aug 31, 2026
345afd7
docs: rewrite LLM chat & text generation guide
barhanc Aug 31, 2026
dc245f5
docs: use session variable naming across LLM examples
barhanc Aug 31, 2026
3626481
docs: finalize LLM and Text Embeddings extension guides
barhanc Aug 31, 2026
5c47c7c
docs: finalize tokenizers guide and cross-link embeddings
barhanc Aug 31, 2026
9fe96b7
docs: finalize NLP extension guides and wordlist
barhanc Aug 31, 2026
05e8232
docs: fix PiiEntity and LLMGenerationConfig doc links
barhanc Aug 31, 2026
d13d663
docs: finalize text-to-speech extension guide
barhanc Aug 31, 2026
c996a90
docs: use download() to resolve model assets in all imperative pipeli…
barhanc Aug 31, 2026
e91643b
docs: document TTS output format and chunk schema
barhanc Aug 31, 2026
a811df6
docs: rewrite speech-to-text extension documentation
barhanc Aug 31, 2026
08162a5
docs: improve speech-to-text introduction and workflow formatting
barhanc Aug 31, 2026
8811681
docs: rewrite voice-activity-detection extension documentation
barhanc Aug 31, 2026
ba98692
docs: document transcribeStop in speech-to-text guide
barhanc Aug 31, 2026
6f363b6
docs: modernize README for v0.10 architecture, clean layout, and remo…
barhanc Aug 31, 2026
e85d538
docs: update gallery URL and add migration todo in README
barhanc Aug 31, 2026
08950b6
docs: streamline model catalog tables with verified size ranges acros…
barhanc Aug 31, 2026
c875d7d
docs: add HuggingFace collection links across all speech and task guides
barhanc Aug 31, 2026
7a98fbf
docs(ocr): correct Quad type and JSON structure to 4-point tuple
barhanc Aug 31, 2026
838a3a2
small style fix
barhanc Aug 31, 2026
c7bc5e5
update readme
barhanc Aug 31, 2026
e5c7739
format
barhanc Sep 1, 2026
9b1e138
docs(readme): update logo with responsive light/dark theme svgs
barhanc Sep 1, 2026
76d53c9
docs(readme): add spacing between logo and badges
barhanc Sep 1, 2026
519c59c
docs(core): document eagerLoadMethods in loadModel and fix anchor links
barhanc Sep 2, 2026
d2ce8cb
docs: update gallery repository links to software-mansion-labs organi…
barhanc Sep 2, 2026
9650d88
docs: remove license section and horizontal rules from library README
barhanc Sep 2, 2026
e315b3b
docs: update gallery task file links to (screens) path
barhanc Sep 2, 2026
ed801a5
chore(git): mark third-party code as linguist-vendored in .gitattributes
barhanc Sep 2, 2026
c1a3f5d
docs: integrate gallery showcase link into intro and streamline layout
barhanc Sep 2, 2026
7e28a84
docs: remove all horizontal rule separators from README
barhanc Sep 2, 2026
d5a5f9e
docs: add open Table of Contents with updated section links
barhanc Sep 2, 2026
8efba4c
docs: add Custom Pipelines to Supported Capabilities matrix
barhanc Sep 2, 2026
6cbfe81
docs: use computer vision in introduction overview
barhanc Sep 2, 2026
4449b04
docs: use stable ExecuTorch documentation URL across guides
barhanc Sep 2, 2026
fef4d85
docs: refine getting started guide options and examples
barhanc Sep 2, 2026
63ec438
docs: use Notes header and Core ML (Apple) backend naming format
barhanc Sep 2, 2026
6da98c4
docs: shorten variant links to See and standardize Size Range headers
barhanc Sep 2, 2026
c07bd85
docs: use See for single model variants and descriptive sub-names for…
barhanc Sep 2, 2026
c269df0
docs: clarify speed vs voice quality trade-offs in TTS model table
barhanc Sep 2, 2026
bb6b56a
docs: add note about CRAFT deprecation and future EasyOCR package in …
barhanc Sep 2, 2026
f511c4e
docs: clarify PyTorch native C++ tokenizer engine
barhanc Sep 2, 2026
bfcbd1f
docs: better wording
barhanc Sep 2, 2026
f219284
docs: add missing links to models, math functions, color maps, and em…
barhanc Sep 2, 2026
c13bf4f
docs: link YOLO26_POSE, BLAZEFACE, COCO_LANDMARKS, and landmarks in P…
barhanc Sep 2, 2026
b93bc55
docs: ensure all landmark constants and names are linked
barhanc Sep 2, 2026
4f5fe18
docs: link Quad, recognizeCharacters, and OcrDetection fields in OCR …
barhanc Sep 2, 2026
96a1940
docs: streamline STT workflows and direct method links without stt pr…
barhanc Sep 2, 2026
1de87be
docs: link streamInsert and transcribeStop directly without stt prefi…
barhanc Sep 2, 2026
825c70e
docs: streamline VAD workflows, remove vad prefix, and link methods &…
barhanc Sep 2, 2026
dc5ab31
docs: streamline Gallery App callouts to link only screen files
barhanc Sep 2, 2026
57f7c92
docs: remove unresolvable WhisperStreamUpdate links in speech-to-text…
barhanc Sep 2, 2026
67b986f
docs: add side-by-side iOS and Android task showcase recordings
barhanc Sep 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .cspell-wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,17 @@ phonemizes
həlˈoʊ
NSURL
backgrounding
memcpy
autoregressive
dispatchable
embedder
embedders
Embedder
Pretraining
Unigram
Unigrams
subword
wordpiece
anonymization
gapless
Feedforward
7 changes: 6 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
*.pbxproj -text
# specific for windows script files
*.bat text eol=crlf
*.bat text eol=crlf

# Linguist vendoring for accurate language statistics and cloc
third-party/** linguist-vendored
**/third-party/** linguist-vendored
packages/react-native-executorch/third-party/** linguist-vendored

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

**/third-party/** already covers both other rules. Also still no trailing newline, and this is unrelated to a docs PR.

214 changes: 83 additions & 131 deletions README.md

Large diffs are not rendered by default.

334 changes: 123 additions & 211 deletions docs/docs/01-fundamentals/01-getting-started.md

Large diffs are not rendered by default.

127 changes: 127 additions & 0 deletions docs/docs/01-fundamentals/02-downloading-models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
title: Downloading Models
slug: /fundamentals/downloading-models
description: 'How model files reach the device — the pre-exported model registry, automatic download and caching in hooks, and the imperative download API with progress and cancellation.'
keywords:
[
react native executorch,
download model,
model cache,
useResourceDownload,
download,
on-device ai,
pte,
]
---

# Downloading Models

A model is one or more files — the `.pte` program, and often a tokenizer,
phonemizer, or label map alongside it — that have to be present on the device
before inference can run. React Native ExecuTorch downloads those files for you
and caches them persistently, so in most apps you never touch the filesystem
directly: you point a pipeline at a model and the library fetches whatever isn't
already cached.

## Where models come from

A model source is either remote or local:

- **Pre-exported models** live in our
[HuggingFace collection](https://huggingface.co/software-mansion/collections) and
are addressed through the
[`models`](../06-api-reference/variables/models.md) registry. Each entry bundles
every file a pipeline needs behind one object — for example
`models.classification.EFFICIENTNET_V2_S.XNNPACK_FP32` resolves to the model and
its label assets. This registry is the single source of truth for the tuned,
ready-to-run models.
- **Your own models** are plain URLs or local paths — a file bundled with the app,
a `file://` path, or a URL on your own host — as long as the model's schema
matches the pipeline (see
[Exporting Custom Models](../03-core-and-advanced/07-exporting-custom-models.md)).

Local paths are always passed through untouched; only `http(s)` URLs are ever
downloaded.

## Automatic downloading with hooks

The `use<Task>` hooks and the
[`useResourceDownload`](../06-api-reference/functions/useResourceDownload.md) hook
download and cache a model's files automatically. Pass a config; the hook fetches
anything not already cached, reports progress, and hands back the same config with
every URL replaced by its local path.

```typescript
import { useResourceDownload, models } from 'react-native-executorch';

function Example() {
const { resource, downloadProgress, downloadError } = useResourceDownload(
models.classification.EFFICIENTNET_V2_S.XNNPACK_FP32
);

// resource is undefined until the download resolves, then mirrors the config
// with local file paths, ready to hand to a pipeline.
}
```

Both hooks accept
[`ResourceOptions`](../06-api-reference/type-aliases/ResourceOptions.md):

- **`preventLoad`** — skip the download entirely (and reset state), for deferring a
fetch until the user opts in.
- **`forceDownload`** — re-fetch even when cached, to replace a corrupted file or
pick up a model that changed behind a stable URL.

## Imperative downloading

When you're not in a component — a background task, a custom pipeline, a
preloading step — use the imperative
[`download`](../06-api-reference/functions/download.md) function. It takes a URL,
or any nested object/array of them (typically a whole model config), downloads
every remote leaf, and resolves with the same value with URLs replaced by local
paths — ready to pass straight to a `create<Task>` factory:

```typescript
import { download, models } from 'react-native-executorch';

const model = await download(models.classification.EFFICIENTNET_V2_S.XNNPACK_FP32, {
onProgress: (p) => console.log(`${Math.round(p * 100)}%`),
});

// `model` now holds local paths; hand it to a pipeline factory
```

[`DownloadOptions`](../06-api-reference/interfaces/DownloadOptions.md) covers the
common needs:

- **`onProgress(p)`** — overall progress in `[0, 1]`, weighted by each file's byte
size so a large model isn't reported the same as a small tokenizer.
- **`signal`** — an `AbortSignal` to cancel. On iOS the bytes fetched so far are
kept, so a later download of the same source resumes rather than restarts.
- **`forceDownload`** — re-download even when cached.

## Caching behavior

Downloads go to a persistent cache keyed by URL, and this is what keeps repeat
launches fast:

- A file that is already cached resolves immediately — no network round trip.
- Concurrent downloads of the same URL are deduplicated into one transfer.
- On Android, fetching goes through the system DownloadManager, which handles

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS background continuation needs the optional @kesha-antonov/react-native-background-downloader peer, which is documented nowhere. The signal bullet above is also slightly off: source says resume is kept everywhere except Android without that downloader.

multi-gigabyte files and continues in the background; on iOS it streams and
resumes an interrupted download from where it stopped.

Use `forceDownload` to bypass the cache and replace a file. Otherwise, downloading
the same model again is effectively free.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setTelemetryEnabled is a public export and appears nowhere in the docs. It gates the HuggingFace download counter ping, which deserves a paragraph here given the README's "no data ever leaves the device" framing.


## Where to go next

- [Getting Started](./01-getting-started.md) — install the library and run your first model.
- [Exporting Custom Models](../03-core-and-advanced/07-exporting-custom-models.md) — bring your own `.pte` and match a pipeline.
- [Models & Tensors](../03-core-and-advanced/02-models-and-tensors.md) — load a downloaded `.pte` directly with the lower-level API.

### API reference

- [`download()`](../06-api-reference/functions/download.md) · [`DownloadOptions`](../06-api-reference/interfaces/DownloadOptions.md)
- [`useResourceDownload()`](../06-api-reference/functions/useResourceDownload.md) · [`ResourceOptions`](../06-api-reference/type-aliases/ResourceOptions.md)
- [`models`](../06-api-reference/variables/models.md)
Loading
Loading