Skip to content

[Feature] Add Local WhisperKit as ASR #56

Description

@MasamiYui

Background

The current project uses cloud-based speech recognition services (Alibaba Cloud Tingwu, Volcengine), which presents the following issues:

  • Requires uploading audio to the cloud, posing privacy risks
  • Depends on network connectivity, cannot be used offline
  • Incurs continuous API call costs
  • Response latency affected by network conditions

Goals

Replace cloud-based ASR providers with local WhisperKit to achieve fully offline speech recognition capabilities.

Technical Solution 1. Architecture Changes

Current Cloud Provider Flow:

Recording → Upload Audio to OSS → Cloud 
ASR → Download Results → Result Fusion

Local Whisper Flow:

Recording → Local Audio Preprocessing → 
WhisperKit Inference → Result Fusion
  1. Core Components
  • LocalWhisperService : Implements TranscriptionService protocol, providing a unified transcription interface
  • WhisperModelManager : Manages model download, loading, caching, and lifecycle
  • LocalWhisperParser : Parses WhisperKit transcription results
  • MeetingPipelineManager : Supports local execution path, skipping OSS upload step 3. Model Management
  • Download Whisper models from Hugging Face (supports HF Mirror for acceleration)
  • Model state machine: Cold (not downloaded) → Warm (downloaded) → Hot (loaded)
  • Automatic caching and expiration management
  • Offline mode support ( HF_HUB_OFFLINE ) 4. Audio Processing
  • Automatic resampling to 16kHz
  • Mono channel conversion
  • Audio chunking for long audio support

Benefits

  1. Privacy Protection : Audio data processed entirely locally, no cloud upload
  2. Offline Availability : Works without network connectivity
  3. Cost Reduction : No API call fees
  4. Faster Response : Local inference without network latency
  5. Greater Control : Customizable models and inference parameters

Implementation Plan

  • Integrate WhisperKit framework
  • Implement LocalWhisperService
  • Implement WhisperModelManager
  • Update MeetingPipelineManager to support local path
  • Add model download and management UI
  • Implement result fusion algorithm
  • Fix model download timeout issues
  • Performance optimization and testing
  • Update user documentation
  • Gradually remove cloud provider dependencies

Open Issues

  1. Model Download : Current tests show model download timeout issues, need to optimize download strategy
  2. Performance Optimization : Long audio inference performance needs further optimization
  3. Model Selection : Need to determine default model size (base/small/medium)
  4. Compatibility : Ensure compatibility with existing features (speaker diarization, AI analysis)

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions