llama.rn
AGENTS.md1.1k starsChanged 23 days agoMITView on GitHub
llama.rn is a React Native binding for llama.cpp, enabling on-device LLM inference for iOS and Android. The library now uses a JSI-first bridge to expose llama.cpp APIs directly to JavaScript. Its output is committed. Run it after changing vendor/VERSIONS or a patch; running it on a clean tree must produce no diff. To change upstream code, edit the vendored file in place and regenerate its patch with scripts/update-patch.sh <dep> <path> [name]. Developer environment only; it never touches vendor/ contents:
- Installs packages
Trending
Less talk lately.about the whole repository
Who's talking about mybigday/llama.rn
- a-ghorbani/pocketpal-ai“[Feat]: Reduce .apk size in releases”GitHub · May 27, 2026 · 1 reactions
- a-ghorbani/pocketpal-ai“[Feat]: draft model for speculative decoding”GitHub · Feb 24, 2025 · 1 reactions
- withcatai/node-llama-cpp“feat: React Native support”GitHub · Aug 3, 2024 · 1 reactions
- xarvel/WardenClaw“Bump llama.rn from 0.13.0-rc.6 to 0.13.0-rc.9 in /app”GitHub · Nov 4, 2026
- xarvel/WardenClaw“Bump llama.rn from 0.13.0-rc.6 to 0.13.0-rc.8 in /app”GitHub · Oct 28, 2026
The biggest 5 of 50 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 50
Talked about on GitHub (50 times).
On GitHub · 50
- May 27, 2026[Feat]: Reduce .apk size in releases — a-ghorbani/pocketpal-ai1 reaction
- Feb 24, 2025[Feat]: draft model for speculative decoding — a-ghorbani/pocketpal-ai1 reaction · 1 comment
- Aug 3, 2024feat: React Native support — withcatai/node-llama-cpp1 reaction · 3 comments
- Nov 4, 2026Bump llama.rn from 0.13.0-rc.6 to 0.13.0-rc.9 in /app — xarvel/WardenClaw0 reactions
- Oct 28, 2026Bump llama.rn from 0.13.0-rc.6 to 0.13.0-rc.8 in /app — xarvel/WardenClaw0 reactions · 1 comment
45 more on GitHub
- Oct 20, 2026build(deps): bump the npm-minor-and-patch group across 1 directory with 21 updates — Tippye/Nexset0 reactions
- Oct 20, 2026deps(npm): Bump the minor-and-patch group across 1 directory with 11 updates — nervosys/IronBridge0 reactions · 2 comments
- Oct 18, 2026build(deps): bump llama.rn from 0.12.6 to 0.12.9 — AkhtarXx/gene0 reactions
- Oct 14, 2026deps(npm): Bump the minor-and-patch group across 1 directory with 17 updates — nervosys/IronBridge0 reactions · 2 comments
- Oct 14, 2026Bump llama.rn from 0.13.0-rc.6 to 0.13.0-rc.7 in /app — xarvel/WardenClaw0 reactions · 1 comment
- Oct 13, 2026chore(deps): bump llama.rn from 0.13.0-rc.6 to 0.13.0-rc.7 — Nido007-cmyk/Nido0 reactions · 2 comments
- Sep 29, 2026deps(npm): Bump the minor-and-patch group across 1 directory with 22 updates — nervosys/IronBridge0 reactions · 2 comments
- Sep 27, 2026Add "Hugging Face & On-Device Models" sub-section under Guides & References / AI: the Hub (model cards, licences, gating, hf CLI, cache), model formats (safetensors, GGUF, ONNX, MLX, Core ML / Core AI, LiteRT, ExecuTorch), transformers v5 pipelines, curated STT / TTS / vision / small-LLM / embedding — albertoirurueta/docs0 reactions · 1 comment
- Sep 22, 2026deps(npm): Bump the minor-and-patch group across 1 directory with 21 updates — nervosys/IronBridge0 reactions · 2 comments
- Sep 15, 2026deps(npm): Bump the minor-and-patch group across 1 directory with 18 updates — nervosys/IronBridge0 reactions · 2 comments
- Sep 14, 2026refactor: vendor sync instead of submodule + no copy — mybigday/whisper.rn0 reactions
- Sep 14, 2026Bump the npm-minor-patch group across 1 directory with 25 updates — tahosook/dining-memory-app0 reactions · 3 comments
- Sep 14, 2026refactor: drop wsp prefix & unexport ggml symbols from framework — mybigday/whisper.rn0 reactions
- Sep 9, 2026deps(npm): Bump the minor-and-patch group in /ironbridge-app with 7 updates — nervosys/IronBridge0 reactions · 2 comments
- Sep 9, 2026deps(npm): Bump llama.rn from 0.9.7 to 0.12.9 in /ironbridge-app — nervosys/IronBridge0 reactions · 2 comments
- Aug 26, 2026[New Rule] llama.rn — LibChecker/LibChecker-Rules0 reactions
- Aug 25, 2026build(deps): bump the npm-minor-and-patch group across 1 directory with 31 updates — Tippye/Nexset0 reactions · 1 comment
- Aug 18, 2026build(deps): bump the npm-minor-and-patch group across 1 directory with 30 updates — Tippye/Nexset0 reactions · 1 comment
- Aug 11, 2026build(deps): bump the npm-minor-and-patch group across 1 directory with 28 updates — Tippye/Nexset0 reactions · 1 comment
- Aug 10, 2026chore(deps): bump llama.rn from 0.12.8 to 0.12.9 — Tah10n/pocket-ai0 reactions
- Aug 3, 2026chore(deps): bump llama.rn from 0.12.7 to 0.12.8 — Tah10n/pocket-ai0 reactions
- Aug 3, 2026Bump the npm-minor-patch group across 1 directory with 33 updates — tahosook/dining-memory-app0 reactions · 1 comment
- Jul 31, 2026Build(deps): bump the minor-and-patch group across 1 directory with 33 updates — MagicZebraLtd/loam0 reactions · 2 comments
- Jul 27, 2026chore(deps): bump llama.rn from 0.12.6 to 0.12.7 — Tah10n/pocket-ai0 reactions · 2 comments
- Jul 24, 2026Build(deps): bump the minor-and-patch group across 1 directory with 33 updates — MagicZebraLtd/loam0 reactions · 2 comments
- Jul 21, 2026Bump the npm-minor-patch group across 1 directory with 31 updates — tahosook/dining-memory-app0 reactions · 1 comment
- Jul 17, 2026[M2][P0][Local AI] llama.rn Provider と構造化出力を Development Build へ統合する — susumutomita/TenkaCloudPassport0 reactions
- Jul 17, 2026[M0][P0][Delivery] Expo・Native Module・供給網の品質ゲートを完成する — susumutomita/TenkaCloudPassport0 reactions
- Jul 4, 2026Bump the npm-minor-patch group across 1 directory with 19 updates — tahosook/dining-memory-app0 reactions · 1 comment
- Jun 29, 2026Bump the npm-minor-patch group across 1 directory with 31 updates — tahosook/dining-memory-app0 reactions · 1 comment
- Jun 25, 2026Bump llama.rn from 0.12.4 to 0.12.5 — 0xkaz/react-native-local-llm-notes0 reactions
- Jun 15, 2026Bump the npm-minor-patch group across 1 directory with 30 updates — tahosook/dining-memory-app0 reactions · 1 comment
- Jun 11, 2026Inference engine runtime on the sidecar (prima.cpp/OlliteRT integration) — chezgoulet/phonon0 reactions
- Jun 7, 2026Bump the npm-minor-patch group across 1 directory with 15 updates — tahosook/dining-memory-app0 reactions · 1 comment
- Jun 7, 2026Bump the npm-minor-patch group across 1 directory with 21 updates — tahosook/dining-memory-app0 reactions · 1 comment
- Jun 1, 2026chore(deps): bump llama.rn from 0.12.1 to 0.12.4 — Tah10n/pocket-ai0 reactions · 1 comment
- May 31, 2026Bump the npm-minor-patch group across 1 directory with 17 updates — tahosook/dining-memory-app0 reactions · 1 comment
- May 26, 2026chore(deps): bump llama.rn from 0.11.5 to 0.12.4 — Cookkit2/recipe-rn0 reactions · 3 comments
- May 25, 2026chore(deps): bump llama.rn from 0.12.1 to 0.12.3 — Tah10n/pocket-ai0 reactions · 1 comment
- May 25, 2026Bump the npm-minor-patch group across 1 directory with 17 updates — tahosook/dining-memory-app0 reactions · 1 comment
- May 18, 2026chore(deps): bump llama.rn from 0.12.0 to 0.12.1 — Tah10n/pocket-ai0 reactions
- May 11, 2026chore(deps/expo): bump llama.rn from 0.10.1 to 0.12.0 in /apps/expo — PackRat-AI/PackRat0 reactions · 3 comments
- May 5, 2026Update llama.rn requirement from ^0.11.0 to ^0.11.5 — Cookkit2/recipe-rn0 reactions · 1 comment
- Apr 30, 2026[Feat]: feat(android): enable experimental ggml-hexagon backend — a-ghorbani/pocketpal-ai0 reactions · 1 comment
- Apr 26, 2026chore(deps/expo): bump llama.rn from 0.10.1 to 0.12.0 in /apps/expo — PackRat-AI/PackRat0 reactions · 1 comment
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,542 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- device-testSkill
- upgrade-react-nativeSkill
The file
We split this AGENTS.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Add comments appropriately, no need to explain the obvious.
- Very specific: line 108
Follow conventional commits (feat:, fix:, docs:, refactor:, test:, chore:).
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
llama.rn - Development Guidelines
Project Overview
llama.rn is a React Native binding for llama.cpp, enabling on-device LLM inference for iOS and Android. The library now uses a JSI-first bridge to expose llama.cpp APIs directly to JavaScript.
General
- Pay attention to code readability.
- Add comments appropriately, no need to explain the obvious.
- Apply first-principles thinking when appropriate.
Architecture
- TypeScript API (
src/)src/index.tsprovides the public API and binds to JSI globals installed byinstallJsi()src/jsi.tshandles global function exports/imports and type safetysrc/types.tshouses shared typessrc/NativeRNLlama.tsis a minimal TurboModule exposing onlyinstall()to trigger JSI setup- Streaming callbacks flow directly over JSI (no React Native event emitters)
- JSI Bridge (
cpp/jsi/+ platform glue)- Core bindings in
cpp/jsi/RNLlamaJSI.cppwith helpers (JSIParams,JSICompletion,JSISession,JSIRequestManager,ThreadPool, etc.) - iOS install path:
ios/RNLlama.mmregisters bindings on the JS runtime viarnllama_jsi::installJSIBindings - Android install path:
android/src/main/java/com/rnllama/RNLlama.java(native lib loader + HTP extraction),android/src/main/java/com/rnllama/RNLlamaModule.java(TurboModule entry point), andandroid/src/main/RNLlamaJSI.cpp
- Core bindings in
- C++ Core (
cpp/+vendor/)cpp/holds only llama.rn's own code:rn-llama.cpp,rn-completion.cpp,rn-slot.cpp,rn-slot-manager.cpp,rn-mtmd.hpp,rn-tts.cpp,anyascii.*, andjsi/- llama.cpp and codec.cpp are vendored under
vendor/in their upstream layout (vendor/llama.cpp/{include,src,ggml,common,tools/mtmd,vendor}), pinned byvendor/VERSIONS, with llama.rn changes kept as-p1patches inscripts/patches/<dep>/. No git submodules, no symbol renaming. Seevendor/README.md. vendor/llama.cppis also consumed by llama.node via upstream's CMake project, so it carries upstream's build files, all ofcommon/and the CUDA/Vulkan/WebGPU backends. llama.rn's builds never compile those;cmake/rnllama-sources.cmakeandllama-rn.podspecfilter them out (keep the two in sync).cmake/rnllama-sources.cmakeis the single source/include list every CMake build uses;llama-rn.podspecmirrors it for CocoaPods- Parallel decoding relies on the slot manager and request queues
Core Features
- Chat & text completion with token streaming (JSI callbacks)
- Parallel decoding with slot-based queueing
- Multimodal vision/audio via mmproj projector models
- Tool calling & MCP support
- Embeddings & reranking (sync + queued)
- Text-to-speech
- Grammar sampling (GBNF/JSON schema)
- Session save/load
- Benchmarking (tokens/sec, prompt speed)
Build System
Vendored sources (scripts/sync-vendor.sh)
- Clones/fetches each upstream pinned in
vendor/VERSIONSinto~/.cache/llama.rn/ - Exports the subset llama.rn builds into
vendor/<dep>/, unchanged and in upstream layout - Applies
scripts/patches/<dep>/*.patch - Regenerates
src/version.tsand the version headers/build-info.cppupstream would generate at build time
Its output is committed. Run it after changing vendor/VERSIONS or a patch; running it on a clean tree must produce no diff. To change upstream code, edit the vendored file in place and regenerate its patch with scripts/update-patch.sh <dep> <path> [name].
Bootstrap (scripts/bootstrap.sh)
Developer environment only; it never touches vendor/ contents:
- Hexagon SDK download (Android HTP builds)
example/dependencies and, on macOS, CocoaPods- Flattens each split Metal kernel with
ggml-common.h/ggml-metal-impl.hand emits per-kernelggml-metal-embed-*.sfiles next to the kernels (gitignored) so the sources are embedded into the framework binary (avoids.metallibdistribution and runtime.metalfile loading; see #348)
Run npm run bootstrap after cloning; run npm run sync:vendor after editing vendor/VERSIONS or scripts/patches/.
Platform Builds
- iOS: Library consumers use pre-built
ios/rnllama.xcframeworkby default. The example app (example/ios/Podfile) setsRNLLAMA_BUILD_FROM_SOURCE=1to build from source, so C++ changes take effect when building the example.scripts/build-ios.shbuilds device/simulator frameworks for release. Metal is enabled unlessRNLLAMA_DISABLE_METAL=1. - Android: Library consumers use pre-built
.solibraries by default. The example app (example/android/gradle.properties) setsrnllamaBuildFromSource=trueto build from source.scripts/build-android.shbuilds native libs (OpenCL viascripts/build-opencl.sh). CMake config lives inandroid/build.gradleandios/CMakeLists.txt. - For library users: Pre-built frameworks/libs are recommended (the default). Only enable build-from-source if you need to modify C++ code or apply custom patches.
Common Development Commands
npm install
npm run bootstrap # Required after cloning (env setup + Metal embeds)
npm run sync:vendor # Re-vendor vendor/ from VERSIONS + patches
npm run typecheck # TypeScript type checking
npm run lint # Run ESLint
npm run lint -- --fix # Fix ESLint errors
npm test # Run Jest unit tests
npm run build:ios-frameworks # Build iOS frameworks
npm run build:android-libs # Build Android libraries (includes OpenCL)
npm run docgen # Generate API docs from TypeScript
npm run example start # Start Metro bundler
npm run example run ios # Run iOS example
npm run example run android # Run Android example
npm run build:ios # Build iOS example app
npm run build:android # Build Android example appDevelopment Workflow
- TypeScript layer: Edit
src/index.ts,src/types.ts, andsrc/jsi.ts.NativeRNLlama.install()only installs JSI; all APIs are invoked via JSI bindings. Runnpm run typecheckandnpm run lintbefore committing. - C++ core: llama.rn code is in
cpp/; llama.cpp/codec.cpp code is invendor/(edit in place, then regenerate the patch, see below). The example app builds from source, sonpm run build:ios/npm run build:androidwill compile your C++ changes directly. To move to a newer llama.cpp, editLLAMA_CPP_REFinvendor/VERSIONSand runnpm run sync:vendor. For releasing pre-built frameworks/libs, runnpm run build:ios-frameworks/npm run build:android-libs. - JSI bridge/platform glue: Implement binding logic in
cpp/jsi/*. iOS installs live inios/RNLlama.mm; Android usesandroid/src/main/java/com/rnllama/RNLlama.java(native loader),android/src/main/java/com/rnllama/RNLlamaModule.java, andandroid/src/main/RNLlamaJSI.cpp.
Patching llama.cpp / codec.cpp
- Edit the vendored file in place, e.g.
vendor/llama.cpp/common/chat.cpp - Regenerate its patch:
scripts/update-patch.sh llama.cpp common/chat.cpp chat.cppwritesscripts/patches/llama.cpp/chat.cpp.patch(a file upstream lacks becomes a file-creating patch; text above the first---line survives regeneration, use it to say why) npm run sync:vendormust leavegit statusclean
Important Conventions
- llama.cpp/ggml symbols keep their upstream names (
ggml_*,llama_*). Coexistence with other ggml-based libraries (e.g. whisper.rn) relies on each library being its own dynamic image: two-level namespace on Apple platforms,RTLD_LOCALplus-Bsymbolicon Android. ggml-metal's Objective-CGGMLMetalClass(only compiled when the Metal library is not embedded) is renamed per library via a-Ddefine, since Objective-C class names are process-global. - Follow conventional commits (
feat:,fix:,docs:,refactor:,test:,chore:).
Testing Strategy
- TypeScript/Javascript: Jest unit tests in
src/__tests__/(JSI mocked injest/mock.js). Run withnpm test. - C++: Unit tests in
tests/(tests/build_and_test.shortests/run_tests.shafter building). - Integration: Example app under
example/for device validation, GPU/performance checks, and parallel decoding stress.
Key Files Reference
src/index.ts,src/jsi.ts,src/types.ts,src/NativeRNLlama.tscpp/jsi/RNLlamaJSI.cpp(+ helpers:JSIParams.h/.cpp,JSICompletion.h,JSISession.h,JSIRequestManager.h,ThreadPool.*)cpp/rn-llama.cpp,cpp/rn-completion.cpp,cpp/rn-slot.cpp,cpp/rn-slot-manager.cpp,cpp/rn-mtmd.hpp,cpp/rn-tts.cppvendor/VERSIONS,vendor/README.md,scripts/sync-vendor.sh,scripts/update-patch.sh,scripts/patches/,cmake/rnllama-sources.cmakeios/RNLlama.mmandroid/src/main/java/com/rnllama/RNLlama.javaandroid/src/main/java/com/rnllama/RNLlamaModule.javaandroid/src/main/RNLlamaJSI.cppllama-rn.podspec,android/build.gradle,tests/
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

