expo-local-llm 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,9 +13,37 @@ Expo module for on-device LLM inference. Wraps Apple Foundation Models (iOS 26+)
|
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
npm install expo-local-llm
|
|
16
|
-
npx expo prebuild
|
|
17
16
|
```
|
|
18
17
|
|
|
18
|
+
This module requires **iOS 16.0+** as a compile target. The default Expo template targets iOS 15.1, so you'll need to raise it via [`expo-build-properties`](https://docs.expo.dev/versions/latest/sdk/build-properties/):
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx expo install expo-build-properties
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
In `app.json`, add the plugin with the deployment target:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"expo": {
|
|
29
|
+
"plugins": [
|
|
30
|
+
[
|
|
31
|
+
"expo-build-properties",
|
|
32
|
+
{ "ios": { "deploymentTarget": "16.0" } }
|
|
33
|
+
]
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Then prebuild:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx expo prebuild --clean
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
> Without `expo-build-properties`, you'll hit `compiling for iOS 15.1, but module 'ExpoLocalLlm' has a minimum deployment target of iOS 16.0` at build time. (Apple Intelligence itself still requires iOS 26+ at runtime — the 16.0 floor is just for compilation; the module returns `notEligible` on iOS 16–25.)
|
|
46
|
+
|
|
19
47
|
## Usage
|
|
20
48
|
|
|
21
49
|
```tsx
|
|
@@ -241,33 +269,38 @@ a bare React Native library. Here's why:
|
|
|
241
269
|
If you're on bare React Native without Expo, this module won't work — you'd need
|
|
242
270
|
to add `expo-modules-core` as a dependency or use a different library.
|
|
243
271
|
|
|
244
|
-
## How is this different from
|
|
272
|
+
## How is this different from React Native AI? (as of May 2026)
|
|
245
273
|
|
|
246
|
-
[
|
|
247
|
-
|
|
248
|
-
|
|
274
|
+
[React Native AI](https://github.com/callstackincubator/ai) (formerly `@callstack/ai`)
|
|
275
|
+
is a Vercel AI SDK-compatible collection of on-device AI primitives, modularized
|
|
276
|
+
into per-backend packages: `@react-native-ai/apple`, `@react-native-ai/llama`,
|
|
277
|
+
`@react-native-ai/mlc`. It covers text generation, embeddings, transcription, and
|
|
278
|
+
speech synthesis.
|
|
249
279
|
|
|
250
|
-
`expo-local-llm` takes a
|
|
280
|
+
`expo-local-llm` takes a narrower approach:
|
|
251
281
|
|
|
252
|
-
| | `expo-local-llm` |
|
|
282
|
+
| | `expo-local-llm` | React Native AI |
|
|
253
283
|
|---|---|---|
|
|
254
|
-
| **
|
|
255
|
-
| **iOS model** | Apple Foundation Models (system-provided) | Apple Foundation Models, Llama, MLC |
|
|
256
|
-
| **Android model** | Gemini Nano (system-provided) |
|
|
257
|
-
| **
|
|
258
|
-
| **
|
|
259
|
-
| **
|
|
260
|
-
| **
|
|
261
|
-
| **
|
|
262
|
-
| **Dependencies** | None | Vercel AI SDK
|
|
284
|
+
| **Surface** | React hook (`useLocalLLM`) and a native session object | Vercel AI SDK provider (`generateText`, `streamText`, `embed`, `transcribe`, `speech`) |
|
|
285
|
+
| **iOS model** | Apple Foundation Models (system-provided) | Apple Foundation Models, Llama (via llama.rn), MLC LLM |
|
|
286
|
+
| **Android model** | Gemini Nano (system-provided) | Llama, MLC (no built-in OS model) |
|
|
287
|
+
| **Capabilities** | Text generation, tool calling, constrained JSON output | Text, embeddings, transcription, speech synthesis |
|
|
288
|
+
| **Model management** | None — the OS handles it | Built-in for Apple; download/prepare for Llama/MLC |
|
|
289
|
+
| **Bundle size impact** | Near zero | Depends on which provider you install + model weights |
|
|
290
|
+
| **DevTools** | None | AI SDK Profiler via Rozenite (OpenTelemetry spans) |
|
|
291
|
+
| **Install path** | One `expo install`, autolinks | Per-package install (Apple provider autolinks; Llama/MLC need extra setup) |
|
|
292
|
+
| **Dependencies** | None | Vercel AI SDK (v6) and per-provider runtimes |
|
|
263
293
|
|
|
264
294
|
**Choose `expo-local-llm` if** you want the simplest path to on-device LLM in
|
|
265
|
-
an Expo app and are happy using whatever model the OS provides
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
295
|
+
an Expo app and are happy using whatever model the OS provides (Apple Foundation
|
|
296
|
+
Models on iOS, Gemini Nano on Android). There's nothing to configure, no weights
|
|
297
|
+
to bundle, and it works on both platforms.
|
|
298
|
+
|
|
299
|
+
**Choose React Native AI if** you need any of:
|
|
300
|
+
- Vercel AI SDK compatibility (drop-in replacement for cloud-LLM apps)
|
|
301
|
+
- Capabilities beyond text generation (embeddings, transcription, speech synthesis)
|
|
302
|
+
- Specific models (Llama 3.2, Phi-3, Mistral, Qwen) on either iOS or Android
|
|
303
|
+
- AI SDK Profiler DevTools for tracing
|
|
271
304
|
|
|
272
305
|
## Built with expo-local-llm
|
|
273
306
|
|
package/package.json
CHANGED