Tracking issue for the "Could add on demand" section of whispercpp/TODO.md. Each item is a 5–15 line wrapper around an existing FFI symbol; none is required for current callers but each is justifiable when a concrete need appears.
When picking one off:
- Confirm the FFI symbol is in
whispercpp-sys/src/generated.rs. If not, extend the allowlists in whispercpp-sys/build.rs::generate_bindings_with_args().
- Replicate the safety pattern of the closest existing wrapper (non-null pointer, lifetime tied to parent struct, no aliasing across threads). Document the SAFETY block.
cargo test -p whispercpp --features serde --lib should still pass.
- Add a doc test or unit test for the new accessor.
Token / vocab
Language helpers
Special-token accessors
Model + state introspection
Timing helpers
Verify-against-existing
See whispercpp/TODO.md for the full table.
Tracking issue for the "Could add on demand" section of
whispercpp/TODO.md. Each item is a 5–15 line wrapper around an existing FFI symbol; none is required for current callers but each is justifiable when a concrete need appears.When picking one off:
whispercpp-sys/src/generated.rs. If not, extend the allowlists inwhispercpp-sys/build.rs::generate_bindings_with_args().cargo test -p whispercpp --features serde --libshould still pass.Token / vocab
Context::token_to_bytes(token) -> Option<&[u8]>— non-UTF-8 byte sequences from BPE mergesContext::tokenize_one(text) -> Option<i32>— wrapswhisper_token_idContext::tokenize(text) -> Vec<i32>— wrapswhisper_tokenize, useful as input toParams::set_tokensLanguage helpers
Context::lang_id_for(name: &str) -> Option<i32>— reverse ofdetected_lang, wrapswhisper_lang_idpub const LANG_MAX_ID: i32 = …— wrapswhisper_lang_max_idLang::full_name() -> &'static str— wrapswhisper_lang_str_full("english" vs "en")Special-token accessors
Context::token_translate() -> i32,token_transcribe,token_prev,token_nosp,token_not,token_solm— force-prefix decoding seedsContext::token_for_lang(Lang) -> i32— wrapswhisper_token_langModel + state introspection
Context::model_dims() -> ModelDims— small struct exposingwhisper_model_n_audio_state,n_audio_head,n_audio_layer,n_text_state,n_text_head,n_text_layer,n_mels,model_ftypepub fn version() -> &'static str— wrapswhisper_get_whisper_versionState::n_mel_frames() -> i32— wrapswhisper_n_len_from_stateTiming helpers
Context::print_timings()— wrapswhisper_print_timingsContext::reset_timings()— wrapswhisper_reset_timingsVerify-against-existing
Token::posterior() -> f32is currentlyToken::p()readingwhisper_token_data.p. Verify it agrees withwhisper_full_get_token_p_from_stateunder temperature / wildcard sampling.See
whispercpp/TODO.mdfor the full table.