vllm_omni.utils.speaker_cache ¶
Process-wide thread-safe LRU cache for speaker extraction artifacts.
Keyed by (model_type, speaker_name, created_at) so each upload generation has its own slot. Access via :func:get_speaker_cache.
SpeakerEmbeddingCache ¶
Thread-safe in-memory LRU cache for speaker extraction artifacts.
clear ¶
Remove entries. With a name, drops matches across model types and generations.
make_cache_key staticmethod ¶
Build a cache key. created_at=0 for built-in speakers (no upload).
Names are normalized (stripped + lowercased) so delete/clear paths that normalize to lowercase match entries put with mixed-case names.
get_speaker_cache ¶
get_speaker_cache() -> SpeakerEmbeddingCache
Return the process-wide speaker cache singleton.
iter_custom_voice_profiles ¶
iter_custom_voice_profiles(
custom_voice_dir: str | PathLike[str] | None,
*,
expected_model_type: str | None = None,
) -> list[dict[str, Any]]
load_validated_profile_tensors ¶
load_validated_profile_tensors(
profile: dict[str, Any],
*,
expected_model_type: str,
validate_profile: Callable[
[dict[str, Any], dict[str, Tensor]], str | None
],
) -> dict[str, Tensor] | None