{"id":24068914,"url":"https://github.com/callstackincubator/ai","last_synced_at":"2026-01-28T21:02:32.325Z","repository":{"id":250073105,"uuid":"831019305","full_name":"callstackincubator/ai","owner":"callstackincubator","description":"On-device LLM execution in React Native with Vercel AI SDK compatibility","archived":false,"fork":false,"pushed_at":"2025-10-16T14:21:05.000Z","size":117361,"stargazers_count":889,"open_issues_count":12,"forks_count":31,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-10-17T14:49:07.996Z","etag":null,"topics":["ai","llm","on-device-ai","react-native"],"latest_commit_sha":null,"homepage":"https://react-native-ai.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/callstackincubator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-19T13:25:57.000Z","updated_at":"2025-10-17T12:03:18.000Z","dependencies_parsed_at":"2025-02-26T20:43:06.582Z","dependency_job_id":"4ab14239-97db-4bbe-b332-1f4dd97dd0ff","html_url":"https://github.com/callstackincubator/ai","commit_stats":null,"previous_names":["szymonrybczak/react-native-ai","callstackincubator/ai"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/callstackincubator/ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callstackincubator%2Fai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callstackincubator%2Fai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callstackincubator%2Fai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callstackincubator%2Fai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/callstackincubator","download_url":"https://codeload.github.com/callstackincubator/ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callstackincubator%2Fai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285628306,"owners_count":27204436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-21T02:00:06.175Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","llm","on-device-ai","react-native"],"created_at":"2025-01-09T13:58:53.402Z","updated_at":"2026-01-28T21:02:32.317Z","avatar_url":"https://github.com/callstackincubator.png","language":"TypeScript","funding_links":[],"categories":["Mobile","TypeScript"],"sub_categories":["React Native \u0026 Expo"],"readme":"[![image](https://github.com/user-attachments/assets/027ccbc1-c6c4-46a0-aa62-7b89d4e62f24)](https://www.callstack.com/open-source?utm_campaign=generic\u0026utm_source=github\u0026utm_medium=referral\u0026utm_content=react-native-ai)\n\n# React Native AI\n\nA collection of on-device AI primitives for React Native with first-class Vercel AI SDK support. Run AI models directly on users' devices for privacy-preserving, low-latency inference without server costs.\n\n## Features\n\n- 🚀 **Instant AI** - Use built-in system models immediately without downloads\n- 🔒 **Privacy-first** - All processing happens on-device, data stays local\n- 🎯 **Vercel AI SDK compatible** - Drop-in replacement with familiar APIs\n- 🎨 **Complete toolkit** - Text generation, embeddings, transcription, speech synthesis\n\n## DevTools\n\n![AI SDK Profiler preview](website/src/public/dev-tools-preview.png)\n\nThe AI SDK Profiler plugin captures OpenTelemetry spans from Vercel AI SDK\nrequests and surfaces them in Rozenite DevTools. DevTools are runtime\nagnostic, so they work with on-device and remote runtimes.\n\n```bash\nnpm install @react-native-ai/dev-tools\n```\n\nRozenite must be installed and enabled in your app. See the\n[Rozenite getting started guide](https://www.rozenite.dev/docs/getting-started).\n\n## Available Providers\n\n| Provider | Built-in | Platforms | Runtime | Description |\n|----------|----------|-----------|---------|-------------|\n| [Apple](#apple) | ✅ Yes | iOS | [Apple](https://developer.apple.com/documentation/FoundationModels) | Apple Foundation Models, embeddings, transcription, speech |\n| [Llama](#llama) | ❌ No | iOS, Android | [llama.rn](https://github.com/mybigday/llama.rn) | Run GGUF models via llama.rn |\n| [MLC](#mlc) | ❌ No | iOS, Android | [MLC LLM](https://github.com/mlc-ai/mlc-llm) | Run open-source LLMs via MLC runtime |\n\n---\n\n### Apple\n\nNative integration with Apple's on-device AI capabilities. **Built-in** - no model downloads required, uses system models.\n\n- **Text Generation** - Apple Foundation Models for chat and completion\n- **Embeddings** - NLContextualEmbedding for 512-dimensional semantic vectors\n- **Transcription** - SpeechAnalyzer for fast, accurate speech-to-text\n- **Speech Synthesis** - AVSpeechSynthesizer for natural text-to-speech with system voices\n\n#### Installation\n\n```bash\nnpm install @react-native-ai/apple\n```\n\nNo additional linking needed, works immediately on iOS devices (autolinked).\n\n#### Usage\n\n```typescript\nimport { apple } from '@react-native-ai/apple'\nimport { \n  generateText,\n  embed, \n  experimental_transcribe as transcribe, \n  experimental_generateSpeech as speech \n} from 'ai'\n\n// Text generation with Apple Intelligence\nconst { text } = await generateText({\n  model: apple(),\n  prompt: 'Explain quantum computing'\n})\n\n// Generate embeddings\nconst { embedding } = await embed({\n  model: apple.textEmbeddingModel(),\n  value: 'Hello world'\n})\n\n// Transcribe audio\nconst { text } = await transcribe({\n  model: apple.transcriptionModel(),\n  audio: audioBuffer\n})\n\n// Text-to-speech\nconst { audio } = await speech({\n  model: apple.speechModel(),\n  text: 'Hello from Apple!'\n})\n```\n\n#### Availability\n\n| Feature | iOS Version | Additional Requirements |\n|---------|-------------|------------------------|\n| Text Generation | iOS 26+ | Apple Intelligence device |\n| Embeddings | iOS 17+ | - |\n| Transcription | iOS 26+ | - |\n| Speech Synthesis | iOS 13+ | iOS 17+ for Personal Voice |\n\nSee the [Apple documentation](https://react-native-ai.dev/docs/apple/getting-started) for detailed setup and usage guides.\n\n---\n\n### Llama\n\nRun any GGUF model on-device using [llama.rn](https://github.com/mybigday/llama.rn). **Requires download** - models are downloaded from HuggingFace.\n\n#### Supported Features\n\n| Feature | Method | Description |\n|---------|--------|-------------|\n| Text Generation | `llama.languageModel()` | Chat, completion, streaming, reasoning models |\n| Embeddings | `llama.textEmbeddingModel()` | Text embeddings for RAG and similarity search |\n| Speech | `llama.speechModel()` | Text-to-speech with vocoder models |\n\n#### Installation\n\n```bash\nnpm install @react-native-ai/llama llama.rn react-native-blob-util\n```\n\n#### Usage\n\n```typescript\nimport { llama } from '@react-native-ai/llama'\nimport { generateText, streamText } from 'ai'\n\n// Create model instance (Model ID format: \"owner/repo/filename.gguf\")\nconst model = llama.languageModel('ggml-org/SmolLM3-3B-GGUF/SmolLM3-Q4_K_M.gguf')\n\n// Download from HuggingFace (with progress)\nawait model.download((progress) =\u003e {\n  console.log(`Downloading: ${progress.percentage}%`)\n})\n\n// Initialize model (loads into memory)\nawait model.prepare()\n\n// Generate text\nconst { text } = await generateText({\n  model,\n  messages: [\n    { role: 'system', content: 'You are a helpful assistant.' },\n    { role: 'user', content: 'Write a haiku about coding.' },\n  ],\n})\n\n// Cleanup when done\nawait model.unload()\n```\n\n#### Model Compatibility\n\nAny GGUF model from HuggingFace can be used. Use the format `owner/repo/filename.gguf` as the model ID. Popular choices include:\n\n- `ggml-org/SmolLM3-3B-GGUF/SmolLM3-Q4_K_M.gguf`\n- `bartowski/Llama-3.2-3B-Instruct-GGUF/Llama-3.2-3B-Instruct-Q4_K_M.gguf`\n- `Qwen/Qwen2.5-1.5B-Instruct-GGUF/qwen2.5-1.5b-instruct-q4_k_m.gguf`\n\n📚 **[View full Llama documentation →](https://react-native-ai.dev/docs/llama/getting-started)**\n\n---\n\n### MLC\n\nRun popular open-source LLMs directly on-device using [MLC LLM](https://github.com/mlc-ai/mlc-llm)'s optimized runtime. **Requires download** - models must be downloaded before use.\n\n#### Installation\n\n```bash\nnpm install @react-native-ai/mlc\n```\n\nRequires the \"Increased Memory Limit\" capability in Xcode. See the [getting started guide](https://react-native-ai.dev/docs/mlc/getting-started) for setup instructions.\n\n#### Usage\n\n```typescript\nimport { mlc } from '@react-native-ai/mlc'\nimport { generateText } from 'ai'\n\n// Create model instance\nconst model = mlc.languageModel('Llama-3.2-3B-Instruct')\n\n// Download and prepare model (one-time setup)\nawait model.download()\nawait model.prepare()\n\n// Generate response with Llama via MLC engine\nconst { text } = await generateText({\n  model,\n  prompt: 'Explain quantum computing'\n})\n```\n\n#### Available Models\n\n| Model ID | Size |\n|----------|------|\n| `Llama-3.2-3B-Instruct` | ~2GB |\n| `Phi-3-mini-4k-instruct` | ~2.5GB |\n| `Mistral-7B-Instruct` | ~4.5GB |\n| `Qwen2.5-1.5B-Instruct` | ~1GB |\n\n\u003e [!NOTE]\n\u003e MLC requires iOS devices with sufficient memory (1-8GB depending on model). The prebuilt runtime supports the models listed above. For other models or custom configurations, you'll need to recompile the MLC runtime from source.\n\n## Documentation\n\nComprehensive guides and API references are available at [react-native-ai.dev](https://react-native-ai.dev).\n\n## Contributing\n\nRead the [contribution guidelines](/CONTRIBUTING.md) before contributing.\n\n## Made with ❤️ at Callstack\n\n**react-native-ai** is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. \n\n[Callstack][callstack-readme-with-love] is a group of React and React Native geeks, contact us at [hello@callstack.com](mailto:hello@callstack.com) if you need any help with these or just want to say hi!\n\n---\n\nMade with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)\n\n[callstack-readme-with-love]: https://callstack.com/?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=react-native-ai\u0026utm_term=readme-with-love\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallstackincubator%2Fai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcallstackincubator%2Fai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallstackincubator%2Fai/lists"}