<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/when-to-build-a-custom-ai-model-rag-vs-fine-tuning-gflckibgy" -->

---
title: When to Build a Custom AI Model? RAG vs. Fine-Tuning
description: Most teams should start with a pre-trained model plus RAG, not a custom model. RAG gives the model knowledge, fine-tuning gives it behavior. A React Native...
canonical: https://daily.dev/posts/when-to-build-a-custom-ai-model-rag-vs-fine-tuning-gflckibgy
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: When to Build a Custom AI Model? RAG vs. Fine-Tuning | daily.dev
og:description: Most teams should start with a pre-trained model plus RAG, not a custom model. RAG gives the model knowledge, fine-tuning gives it behavior. A React Native...
og:url: https://daily.dev/posts/when-to-build-a-custom-ai-model-rag-vs-fine-tuning-gflckibgy
og:image: https://api.daily.dev/og/posts/GfLcKIbGy.png
og:image:alt: When to Build a Custom AI Model? RAG vs. Fine-Tuning
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# When to Build a Custom AI Model? RAG vs. Fine-Tuning

**[Callstack Blog](https://daily.dev/sources/callstack-blog)** · 10 min read · 3 upvotes · 0 comments

## Summary

Most teams should start with a pre-trained model plus RAG, not a custom model. RAG gives the model knowledge, fine-tuning gives it behavior. A React Native example stores HR policies in SQLite FTS5 and feeds matching rows to Apple's on-device model, so updating a row from 20 to 25 vacation days changes answers with no retraining. Fine-tune only if a base model still fails after better prompts and context, and prove the gain on held-out cases. Prefer PEFT (LoRA, QLoRA) over full fine-tuning, which risks catastrophic forgetting. Combining both adds a retrieval stack and a training pipeline to maintain.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.callstack.com/blog/when-to-build-a-custom-ai-model-rag-vs-fine-tuning>

## Questions this post answers

### Should I use RAG or fine-tuning for my LLM app?

Start with a pre-trained model plus RAG for most cases. RAG supplies knowledge by injecting retrieved data into the prompt at query time, so updated documents are reflected immediately without retraining. Fine-tuning shapes behavior such as style, format or task handling, and is worth testing only when a base model still fails after better prompts and context.

_Developers weighing RAG against fine-tuning follow these LLM trade-offs on daily.dev._

### Should I use full fine-tuning or PEFT like LoRA for adapting an LLM?

Start with PEFT. It freezes the original model and trains only a small number of parameters, making it cheaper and usually good enough for adapting style, format or task behavior. Full fine-tuning updates all parameters, needs substantial resources and risks catastrophic forgetting, so reserve it for major behavior shifts with a large high-quality dataset.

_Teams adapting models to their domain keep up with PEFT techniques on daily.dev._

### How can I build a RAG chatbot in React Native using SQLite and an on-device model?

Create an SQLite FTS5 virtual table for your documents, extract search terms from the question, and query with MATCH ordered by rank, limited to 3 rows. Format those rows into a context string and pass it with the question to generateText using the apple() model from react-native-ai. Updating a database row changes answers immediately.

_Mobile developers adding on-device AI features track React Native approaches on daily.dev._

## Similar posts on daily.dev

- [RAG vs fine-tuning — when to use which and why it actually matters](https://daily.dev/posts/rag-vs-fine-tuning-when-to-use-which-and-why-it-actually-matters-bnlltukcc) · Medium · 2 upvotes · 0 comments
- [RAG vs Fine-Tuning Explained: What They Actually Do and When to Use Each](https://daily.dev/posts/rag-vs-fine-tuning-explained-what-they-actually-do-and-when-to-use-each-o8gkftmqg) · Towards Data Science · 1 upvotes · 0 comments
- [RAG vs Fine-Tuning: How to Choose the Right GPT Approach](https://daily.dev/posts/rag-vs-fine-tuning-how-to-choose-the-right-gpt-approach-zf4by4dv0) · Syncfusion · 0 upvotes · 0 comments
- [Fine-Tuning LLMs in 2026: When RAG Isn't Enough \(and When It Still Is\)](https://daily.dev/posts/fine-tuning-llms-in-2026-when-rag-isn-t-enough-and-when-it-still-is--mddwiz32r) · BigData Boutique blog · 2 upvotes · 0 comments
- [RAG vs. Fine-Tuning for Domain Adaptation: When to Use Which](https://daily.dev/posts/rag-vs-fine-tuning-for-domain-adaptation-when-to-use-which-g7c9lxuod) · Machine Learning Mastery · 8 upvotes · 2 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#deep-learning](https://daily.dev/tags/deep-learning), [#react-native](https://daily.dev/tags/react-native), [#rag](https://daily.dev/tags/rag), [#sqlite](https://daily.dev/tags/sqlite)

[View this post on daily.dev](https://daily.dev/posts/when-to-build-a-custom-ai-model-rag-vs-fine-tuning-gflckibgy)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"When to Build a Custom AI Model? RAG vs. Fine-Tuning","url":"https://daily.dev/posts/when-to-build-a-custom-ai-model-rag-vs-fine-tuning-gflckibgy","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/when-to-build-a-custom-ai-model-rag-vs-fine-tuning-gflckibgy"},"datePublished":"2026-11-27T10:16:24.241Z","dateModified":"2026-11-27T10:16:46.781Z","description":"Most teams should start with a pre-trained model plus RAG, not a custom model. RAG gives the model knowledge, fine-tuning gives it behavior. A React Native...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1e3c47395e652daf26ffafcba06d11be?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1e3c47395e652daf26ffafcba06d11be?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Callstack Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Callstack Blog","logo":"https://media.daily.dev/image/upload/s--3qItoroi--/f_auto,q_auto/v1774179048/logos/callstack-blog?_a=BAMAMiWQ0","url":"https://daily.dev/sources/callstack-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/when-to-build-a-custom-ai-model-rag-vs-fine-tuning-gflckibgy","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,deep-learning,react-native,rag,sqlite","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Callstack Blog","item":"https://daily.dev/sources/callstack-blog"},{"@type":"ListItem","position":3,"name":"When to Build a Custom AI Model? RAG vs. Fine-Tuning"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/when-to-build-a-custom-ai-model-rag-vs-fine-tuning-gflckibgy#faq","mainEntity":[{"@type":"Question","name":"Should I use RAG or fine-tuning for my LLM app?","acceptedAnswer":{"@type":"Answer","text":"Start with a pre-trained model plus RAG for most cases. RAG supplies knowledge by injecting retrieved data into the prompt at query time, so updated documents are reflected immediately without retraining. Fine-tuning shapes behavior such as style, format or task handling, and is worth testing only when a base model still fails after better prompts and context. Developers weighing RAG against fine-tuning follow these LLM trade-offs on daily.dev."}},{"@type":"Question","name":"Should I use full fine-tuning or PEFT like LoRA for adapting an LLM?","acceptedAnswer":{"@type":"Answer","text":"Start with PEFT. It freezes the original model and trains only a small number of parameters, making it cheaper and usually good enough for adapting style, format or task behavior. Full fine-tuning updates all parameters, needs substantial resources and risks catastrophic forgetting, so reserve it for major behavior shifts with a large high-quality dataset. Teams adapting models to their domain keep up with PEFT techniques on daily.dev."}},{"@type":"Question","name":"How can I build a RAG chatbot in React Native using SQLite and an on-device model?","acceptedAnswer":{"@type":"Answer","text":"Create an SQLite FTS5 virtual table for your documents, extract search terms from the question, and query with MATCH ordered by rank, limited to 3 rows. Format those rows into a context string and pass it with the question to generateText using the apple() model from react-native-ai. Updating a database row changes answers immediately. Mobile developers adding on-device AI features track React Native approaches on daily.dev."}}]}
```

