--- id: lhotse version: "1.33.0" license: Apache-2.0 License license_treatment: permissive maintenance: active --- # lhotse — Data preparation for speech processing models training. License: permissive · Maintenance: active · Downloads: 1.3M/mo ## What it is and what it does Lhotse is a Python library for preparing multimodal data (speech, audio, video, image, text) for training machine learning models. It sits alongside k2 as part of the next-generation Kaldi speech processing ecosystem. The library introduces the concept of audio cuts—logical segments that can be mixed, truncated, and padded on-the-fly—to minimize storage while supporting flexible training data construction. It handles data randomization and de-duplication for distributed training, provides standard recipes for common corpora, and integrates with PyTorch through task-specific Dataset classes. Lhotse supports both pre-computed feature storage (with optional compression via lilcom) and on-the-fly feature extraction and augmentation. Data and metadata are stored in human-readable text manifests and exposed through convenient Python classes. The library offers efficient sequential I/O formats (Lhotse Shar, similar to webdataset) and state-of-the-art dataloading algorithms like dataset blending and bucketing. It runs on Python 3.8+ across Linux, macOS, and Windows, with dependencies on torch, numpy, audioread, SoundFile, and other standard tools. Use it for: - Prepare speech recognition training datasets with on-the-fly mixing and augmentation to reduce storage overhead. - Build multimodal pipelines combining audio, text, image, and video for end-to-end model training. - Implement distributed multi-node training with data randomization and de-duplication across workers. - Create standard data recipes for common speech corpora to streamline reproducible research. - Combine multiple datasets with flexible blending and bucketing for efficient batching during training. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Lhotse prepares multimodal (speech, audio, video, image, text) data for machine learning model training with flexible pipelines, on-the-fly augmentation, and efficient data loading. Yes. Lhotse is production-stable (Development Status 5), actively maintained, has no known vulnerabilities, and solves a real problem in multimodal data preparation for speech and audio ML. The low install friction and permissive license make it accessible. Install it if you are building speech, audio, or multimodal training pipelines; skip it if you only need simple audio I/O without data augmentation or complex dataset orchestration. ## Install pip install lhotse uv add lhotse poetry add lhotse ## Installing lhotse Before you install: Low friction: pure Python wheel with 11 runtime dependencies including torch, numpy, and audio libraries. Actively maintained with recent release. Requires Python 3.8 or later. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions, typical for research and production ML workflows. Quickstart: pip install lhotse from lhotse import CutSet, Recording, SupervisionSegment # Load or create cuts and prepare data cuts = CutSet.from_json('cuts.json') for batch in cuts.to_torch(): # Use batch for training pass Requires torch and audio backend libraries (audioread, SoundFile). The environment variable LHOTSE_REQUIRE_TORCHAUDIO controls whether torchaudio is enforced; basic audio reading works without it via SoundFile. Verify before relying: - Whether torchaudio is a hard requirement or optional (environment variable LHOTSE_REQUIRE_TORCHAUDIO suggests it may be optional) - Performance characteristics when handling large-scale multimodal datasets - Compatibility details with specific PyTorch versions beyond the general torch dependency ## Package facts - License: Apache-2.0 License (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags speech audio data preparation, multimodal dataset loading, audio preprocessing pipeline, speech training data, audio cut mixing augmentation, efficient data loading speech, audio feature extraction, speech-processing, data-preparation, multimodal [View on SkillFed](https://skillfed.io/packages/lhotse) · [View on PyPI](https://pypi.org/project/lhotse/)