---
title: "LLM Inference on Edge: A Fun and Easy Guide to run LLMs via React Native on your Phone!"
description: "A step-by-step tutorial for building a cross-platform React Native chat app that downloads GGUF-quantized LLMs from the Hugging Face Hub and runs them fully on-device using llama.rn, a binding for llama.cpp."
url: "https://swe.quest/articles/llm-inference-on-edge-a-fun-and-easy-guide-to-run-llms-via-react-native-on-your-0b1a72d782689ca9"
canonical: "https://huggingface.co/blog/llm-inference-on-edge"
source: "Hugging Face"
published: "2025-03-07"
difficulty: "medium"
kind: "How-to"
reading_minutes: 29
tags: ["inference","mobile","react","llms","typescript"]
---

# LLM Inference on Edge: A Fun and Easy Guide to run LLMs via React Native on your Phone!

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2025-03-07, 29 min read, How-to. Original: [https://huggingface.co/blog/llm-inference-on-edge](https://huggingface.co/blog/llm-inference-on-edge)

## Summary

A step-by-step tutorial for building a cross-platform React Native chat app that downloads GGUF-quantized LLMs from the Hugging Face Hub and runs them fully on-device using llama.rn, a binding for llama.cpp. It explains how to choose models for phones (1-3B parameters are ideal, larger ones need aggressive quantization) and how the legacy, K-quant and I-quant GGUF formats trade file size against accuracy and speed. It then covers environment setup, the project structure, React state for chat and downloads, and fetching available GGUF files via the Hub API. A recommended tradeoff: a larger model at low-bit quantization can outperform a smaller model at Q8\_0.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Mobile](https://swe.quest/tags/mobile.md) (Web & mobile)
- [React](https://swe.quest/tags/react.md) (Web & mobile)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)

## Prerequisites

- React basics ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))
- TypeScript ([easy posts on TypeScript](https://swe.quest/tags/typescript.md?difficulty=easy))
- npm and Node.js ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))

## Keywords

React Native, llama.rn, llama.cpp, GGUF, Hugging Face Hub, EdgeLLM, K-quants

## Related posts

- [Transformers now runs llama.cpp quants](https://swe.quest/articles/transformers-now-runs-llama-cpp-quants-cff2353854049dc6.md): Hugging Face · 2026-09-22 · Medium · 11 min read · Inference & serving, LLMs, Python, Performance engineering
  Hugging Face transformers can now load GGUF (llama.cpp) quantized checkpoints via \`from\_pretrained(..., gguf\_file=...)\` and serve them through \`transformers serve\` with an OpenAI-compatible API.
- [Local LLM Messenger: Chat with GenAI on Your iPhone](https://swe.quest/articles/local-llm-messenger-chat-with-genai-on-your-iphone-7541b86ddf4d704e.md): Docker · 2024-07-23 · Medium · 13 min read · LLMs, Python, Containers
  Local LLM Messenger (LoLLMM), an honorable-mention project from Docker's AI/ML Hackathon by Justin Garrison, lets you send iMessages to LLMs running on your own machine.
- [Releasing Swift Transformers: Run On-Device LLMs in Apple Devices](https://swe.quest/articles/releasing-swift-transformers-run-on-device-llms-in-apple-devices-ee6106831bf892fd.md): Hugging Face · 2023-08-08 · Medium · 15 min read · Swift, Inference & serving, LLMs, Mobile
  Hugging Face released swift-transformers, an alpha Swift package with a transformers-like API for on-device text generation, along with the swift-chat demo app, updated exporters and transformers-to-coreml conversion tools, and pre-converted Llama 2 7B and Falcon 7B Core ML models.
- [Run fast, private agents on-device with LFM2.5-24B-A2B](https://swe.quest/articles/run-fast-private-agents-on-device-with-lfm2-5-24b-a2b-52b7fe0729873bfd.md): Hugging Face · 2026-10-13 · Medium · 7 min read · LLMs, AI agents, Model training, Inference & serving, Evaluation
  LFM2.5-24B-A2B is an open-weight 24B-parameter MoE reasoning model with 2B active parameters per token, aimed at running tool-using agents on local hardware.
- [Hugging Face Text Generation Inference available for AWS Inferentia2](https://swe.quest/articles/hugging-face-text-generation-inference-available-for-aws-inferentia2-4404accc08bd48f1.md): Hugging Face · 2024-02-01 · Medium · 7 min read · Inference & serving, LLMs, Cloud platforms, Python
  Text Generation Inference (TGI) is now generally available on AWS Inferentia2 through Amazon SageMaker, offering an alternative to GPUs for serving open LLMs such as Llama and Mistral.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
