This file provides guidance to WARP (warp.dev) when working with code in this repository.
This is a React Native Expo app showcasing LLM capabilities using ExecutorchJS on mobile devices. The app demonstrates various LLM use cases including chat, tool calling, structured output, and voice chat functionality.
- Start development server:
npm start(Expo development server) - Run on iOS:
npm run ios - Run on Android:
npm run android - Run on web:
npm run web - Type check:
npm run typecheck - Lint and fix:
npm run lint
This project uses npm for package management. The workspace dependency react-native-executorch: workspace:* indicates this is part of a larger monorepo structure.
The app uses Expo Router with a drawer navigation pattern:
- Main entry:
app/index.tsx- Demo selection screen - Layout:
app/_layout.tsx- Drawer navigation with generation state management - Demo screens: Each in its own directory under
app/llm/- Basic LLM chatllm_tool_calling/- LLM with calendar/brightness toolsllm_structured_output/- Structured output demovoice_chat/- Speech-to-text + LLM interaction
- Messages: Chat message display with scrolling and deletion
- MessageItem: Individual message rendering
- Spinner: Loading states with progress indicators
- AnimatedChatLoading: Typing animation for responses
- GeneratingContext: Global context to manage generation state across navigation
- useLLM hook: From
react-native-executorchfor LLM operations - useSpeechToText hook: For voice input processing
LLAMA3_2_1B_SPINQUANT- Basic chatHAMMER2_1_1_5B_QUANTIZED- Tool callingQWEN3_0_6B_QUANTIZED- Voice chatWHISPER_TINY_EN- Speech recognition
All LLM functionality is handled through the react-native-executorch package, which provides:
- Model loading with download progress
- Message streaming
- Tool calling capabilities
- Speech-to-text processing
The tool calling demo (utils/tools.ts) implements:
- brightness: Control screen brightness
- read_calendar: Read calendar events
- add_event_to_calendar: Create calendar events
The app requests permissions for:
- Calendar access (for tool calling features)
- Brightness control
- Microphone access (for voice chat)
- iOS entitlements for increased memory limits (required for LLM processing)
- Different keyboard behaviors for iOS vs Android
- Emulator detection for voice features
- TypeScript strict mode enabled
- Custom module declarations for SVG imports
- Path mapping for the executorch package
- All models are downloaded on first use with progress indicators
- Generation state is tracked globally to prevent navigation during processing
- Voice chat disabled on emulator due to recording limitations
- The app uses custom fonts (Aeonik Regular/Medium)
- SVG icons are imported as React components via react-native-svg-transformer
app/contains all screens using Expo Router file-based routingcomponents/contains reusable UI componentsutils/contains business logic (tools, helpers)assets/contains fonts and SVG icons- Root level contains configuration files and global utilities