Skip to main content

Install the Package

Install whisper.rn using your preferred package manager:
npm install whisper.rn
Current version: 0.6.0-rc.0Requirements:
  • React Native 0.60+
  • Node.js 18+
  • iOS 11.0+ / tvOS 11.0+
  • Android API 21+ (Android 5.0)

Platform-Specific Setup

1

Install CocoaPods dependencies

npx pod-install
By default, whisper.rn uses a pre-built rnwhisper.xcframework for faster builds.
2

(Optional) Build from source

If you need to customize the native build, add this to your Podfile:
# Force build whisper.rn from source
ENV['RNWHISPER_BUILD_FROM_SOURCE'] = '1'
Then reinstall pods:
cd ios && pod install
3

(Optional) Add microphone permissions

If you plan to use realtime transcription, add microphone permission to ios/YourApp/Info.plist:
<key>NSMicrophoneUsageDescription</key>
<string>This app requires microphone access to transcribe speech</string>
tvOS does not support microphone access.
4

(Optional) Enable Extended Virtual Addressing

For medium or large models, enable Extended Virtual Addressing in Xcode:
  1. Select your app target in Xcode
  2. Go to Signing & Capabilities
  3. Click + Capability
  4. Add Extended Virtual Addressing
This allows your app to use more memory for large models.

iOS Build Options

You can customize the iOS build with environment variables in your Podfile:
# Disable Core ML support
ENV['RNWHISPER_DISABLE_COREML'] = '1'

# Disable Metal GPU acceleration
ENV['RNWHISPER_DISABLE_METAL'] = '1'

Download a Whisper Model

whisper.rn requires a GGML-format Whisper model file. Models are available from the whisper.cpp repository.
1

Choose a model size

Model Sizes
comparison
ModelSizeSpeedAccuracyUse Case
tiny.en75 MBFastestGoodQuick transcription, English only
base.en148 MBFastBetterGeneral use, English only
small.en488 MBMediumGreatHigh accuracy, English only
medium.en1.5 GBSlowExcellentBest quality, English only
tiny75 MBFastestGoodMultilingual, 99 languages
base142 MBFastBetterMultilingual
small466 MBMediumGreatMultilingual
For most mobile apps, tiny.en or base.en offers the best balance of speed and accuracy.
2

Download the model

Download from Hugging Face:
curl -L https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.en.bin -o ggml-tiny.en.bin
3

Place model in your app

You have two options:Option 1: Bundle with app (development)Place the .bin file in your project (e.g., assets/ggml-tiny.en.bin) and use require():
const modelPath = require('./assets/ggml-tiny.en.bin');
This increases app size significantly. Models are typically 75MB to 2.9GB.
Option 2: Download at runtime (recommended for production)Download the model file when the app first launches and save it to the device:
import RNFS from 'react-native-fs';

const modelUrl = 'https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.en.bin';
const modelPath = `${RNFS.DocumentDirectoryPath}/ggml-tiny.en.bin`;

// Check if already downloaded
const exists = await RNFS.exists(modelPath);
if (!exists) {
  await RNFS.downloadFile({
    fromUrl: modelUrl,
    toFile: modelPath,
  }).promise;
}

Using Bundled Assets (Optional)

To bundle models as assets, update metro.config.js:
metro.config.js
const { getDefaultConfig } = require('metro-config');
const defaultAssetExts = require('metro-config/src/defaults/defaults').assetExts;

module.exports = {
  resolver: {
    assetExts: [
      ...defaultAssetExts,
      'bin', // whisper.rn: GGML model files
      'mil', // whisper.rn: Core ML model files
    ],
  },
};
The React Native packager has a 2GB file size limit, so original f16 large models (2.9GB) cannot be bundled. Use quantized versions instead.

Verify Installation

Test your installation:
import { libVersion } from 'whisper.rn';

console.log('whisper.cpp version:', libVersion);
Installation complete! Continue to Quick Start to transcribe your first audio.

Next Steps

Quick Start Guide

Transcribe your first audio file

Core ML Setup

Enable iOS encoder acceleration

Build docs developers (and LLMs) love