Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kiku

Kiku(聞く, to hear/listen). Transcription Engine Built on Rust

Minimal transcription engine in Rust. Audio in, transcript out. Heavily used in kioku's environment

Two backends behind one Engine:

  • cloud (default): OpenRouter /audio/transcriptions
  • local : whisper.cpp via whisper-rs, behind the local-whisper feature

Usage

# cloud (needs OPENROUTER_API_KEY in env or .env)
cargo run -- assets/audio.wav

# local whisper (CPU; ggml model auto-downloads on first run)
LOCAL_TRANSCRIPTION=true MODEL=large-v3 cargo run --features local-whisper -- assets/audio.wav

# local whisper on GPU (whisper.cpp CUDA; needs nvcc + cmake to build,
# falls back to CPU at runtime when no GPU is present)
LOCAL_TRANSCRIPTION=true MODEL=large-v3 cargo run --features cuda -- assets/audio.wav

Local segments carry word-level timestamps (Segment::words), merged from whisper.cpp token timings.

Any PCM WAV works: multi-channel is downmixed, non-16kHz is resampled.

Configuration

Env vars (.env supported):

var default meaning
LOCAL_TRANSCRIPTION true true = local whisper, false = OpenRouter
MODEL openai/gpt-4o-mini-transcribe cloud: OpenRouter model id · local: ggml name (large-v3, tiny, …) or path to a .bin
OPENROUTER_API_KEY required for cloud
OPENROUTER_URL https://openrouter.ai/api/v1 override for testing

Fine-tuned models

HF transformers fine-tunes need converting to ggml once:

scripts/convert-hf-model.sh cobrayyxx/whisper-small-indo-eng
LOCAL_TRANSCRIPTION=true MODEL=whisper-small-indo-eng cargo run --features local-whisper -- assets/audio.wav

Examples

Library usage lives in examples/:

cargo run --example cloud -- assets/audio.wav
cargo run --example local --features local-whisper -- assets/audio.wav   # prints timestamped segments

Tests

cargo test

About

Kiku (聞く, to hear/listen). Transcription Engine Built on Rust

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages