This document provides context and guidelines for AI assistants working with this codebase.
This repository is the open source application layer for the Jetson Orin Nano Field Kit. It provides AI-powered applications including computer vision and voice assistance optimized for edge deployment on NVIDIA Jetson hardware.
Vision Application (apps/vision/roboflow/)
- Real-time object detection using Roboflow inference
- Processes RTSP camera streams from IMX219 modules
- Supports YOLOv8 models (nano, medium, large)
- Python-based with OpenCV and GStreamer integration
- Key files:
run_roboflow_inference.py- Main inference scriptclient.py- RTSP client utilitiesmonitoring.py- System monitoring and metricsstart_rtsp_server.py- RTSP server utilities
Voice Assistant (apps/voice-assistant/)
- Wake word-enabled voice assistant using LiveKit
- Tool calling for system operations
- Safe Linux command execution with whitelisting
- Offline knowledge base integration via Kiwix
- Vision plugin integration for object detection queries
- Key files:
main.py- Main assistant applicationllm_plugin.py- LLM integrationstt_plugin.py- Speech-to-text plugintts_plugin.py- Text-to-speech pluginkiwix_tool.py- Offline knowledge base toolvision_plugin.py- Vision integration
MediaMTX (system/mediamtx/)
- RTSP streaming server for camera feeds
- Configuration:
mediamtx.yml - Service setup:
setup-mediamtx-service.sh - Binary:
mediamtx(ARM64)
LiveKit (system/livekit/)
- Real-time communication infrastructure
- Used by voice assistant
- Configuration:
server.yaml - Installation:
install-livekit.sh
Kiwix (system/kiwix/)
- Offline Wikipedia and knowledge base
- Docker-based service
- ZIM file downloads:
download-zim.sh - Service setup:
setup-kiwix-service.sh
Roboflow (system/roboflow/)
- Docker service for Roboflow inference server
- Jetson-optimized image
- Service setup:
setup-roboflow-service.sh
Ultralytics (system/ultralytics/)
- YOLO model inference service
- Docker-based
- Separate compose file for interactive use
ui/- Shared React components (Button, Card, Code)eslint-config/- Shared ESLint configurationstypescript-config/- Shared TypeScript configurations
- Next.js 14+ (App Router)
- React 18+
- TypeScript
- Tailwind CSS
- Shadcn UI / Radix UI
- Turborepo for monorepo management
- pnpm for package management
- Python 3.10+
- LiveKit for real-time communication
- Roboflow Inference for computer vision
- OpenCV for image processing
- GStreamer for video pipelines
- Docker for service containerization
- systemd for service management
- MediaMTX for RTSP streaming
- Kiwix for offline knowledge base
- NVIDIA JetPack for Jetson hardware support
JavaScript/TypeScript:
- Follow Standard.js rules
- 2 space indentation
- Single quotes for strings
- No semicolons (unless required)
- Use functional and declarative patterns
- Prefer named exports for components
Python:
- Follow PEP 8 conventions
- Use type hints where appropriate
- Async/await for asynchronous operations
- Proper error handling and logging
- Applications in
apps/directory - Shared code in
packages/directory - System services in
system/directory - Configuration files at appropriate levels
- Documentation in markdown files
- Directories: lowercase with dashes (
voice-assistant) - Files: lowercase with dashes or underscores
- Components: PascalCase (
VoiceAssistant) - Functions/variables: camelCase (
getCameraStream) - Constants: UPPER_SNAKE_CASE (
MAX_RETRIES)
- Create directory in
apps/ - Add
package.jsonorrequirements.txtas appropriate - Update
turbo.jsonif build steps needed - Add to workspace configuration if needed
- Create README with setup instructions
- Create directory in
system/ - Add service configuration files
- Create setup script (
setup-*-service.sh) - Create systemd service file if needed
- Update
system/provision.shto include new service - Add Docker compose configuration if containerized
- Camera streams via MediaMTX RTSP server
- Applications consume RTSP streams
- Processing uses GStreamer pipelines for hardware acceleration
- AI inference via Roboflow or Ultralytics
- Results can be visualized or streamed back
- Input via LiveKit
- Wake word detection for privacy
- STT converts speech to text
- LLM processes with tool calling
- Tools execute system operations safely
- TTS converts response to speech
- Vision plugin can query camera feeds
Common environment variables across applications:
ROBOFLOW_API_KEY- Roboflow API key for visionRTSP_URL- RTSP stream URL (default:rtsp://localhost:8554/cam0)WAKE_WORD- Voice assistant wake word (default: "nano")DISPLAY- X display for GUI applications (default::0)
Check individual application directories for specific requirements.
- 67 TOPS AI performance
- Dual IMX219 camera support
- GPIO pins for LED control
- Thermal management important for sustained performance
- Use hardware-accelerated GStreamer pipelines
- Leverage NVMM memory for video buffers
- Monitor thermal throttling
- Adjust model sizes for real-time performance
- Use appropriate camera resolutions
cd system
bash provision.shcd apps/vision/roboflow
python3 run_roboflow_inference.pycd apps/voice-assistant
python3 main.py devsudo systemctl status mediamtx.service
sudo systemctl status kiwix.service
docker compose -f system/docker-compose.yml ps- Vision: Test with
ffplayor OpenCV display - Voice: Test wake word and command execution
- Services: Check systemd logs and Docker logs
- Verify hardware connection
- Check
/dev/video*devices - Test with
v4l2-ctl --list-devices - Review MediaMTX logs
- Monitor with
jtopif available - Check thermal status
- Reduce camera resolution
- Use smaller AI models
- Check system resource usage
- Check systemd service status
- Review service logs
- Verify configuration files
- Check file permissions
- Ensure dependencies installed
README.md- Main project documentationRTSP_SETUP.md- RTSP streaming setup guideapps/vision/roboflow/README.md- Vision application docsapps/vision/roboflow/QUICKSTART.md- Quick start guide
- NVIDIA Jetson Documentation
- MediaMTX GitHub
- Roboflow Documentation
- LiveKit Documentation
- Turborepo Documentation
When working with this codebase:
- Hardware Context: Always consider Jetson Orin Nano hardware constraints and capabilities
- Real-time Performance: Applications are optimized for real-time edge deployment
- Offline Capability: System designed for offline operation where possible
- Service Dependencies: Understand service dependencies (e.g., vision needs RTSP, voice needs LiveKit)
- Monorepo Structure: Respect Turborepo structure and shared packages
- System Integration: Services use systemd and Docker for deployment
- Camera Integration: Dual camera support via MediaMTX RTSP streams
- AI Models: Use appropriate model sizes for Jetson hardware performance
When suggesting changes:
- Consider Jetson hardware limitations
- Maintain offline capability where possible
- Preserve real-time performance characteristics
- Follow existing code style and patterns
- Update relevant documentation
- Test on actual hardware when possible