AirLLM declares a lean set of required dependencies—torch, transformers, accelerate, and tokenization/serialization tools—while bitsandbytes and compressed-tensors remain optional so a basic install avoids unnecessary overhead. Per-family model classes import defensively inside try/except blocks, ensuring a missing optional dependency for one model never breaks the whole package or prevents generic streaming.
The airllm package (v3.1.0) declares torch>=2.4, transformers>=4.49,<5.13, accelerate>=1.0, safetensors, huggingface-hub, scipy, sentencepiece, and tqdm as its mandatory install_requires in setup.py.[1] sentencepiece was added as a declared mandatory dependency after its absence caused import airllm to crash on clean installs, because the Baichuan tokenizer is imported eagerly at package load time.[1] bitsandbytes and compressed-tensors are intentionally absent from install_requires: bitsandbytes is needed only for compression mode, and compressed-tensors only for MXFP4 checkpoints (Kimi K3), so a plain pip install airllm produces a lean, known-good stack.[1]
In air_llm/airllm/__init__.py, per-family subclasses (AirLLMChatGLM, AirLLMBaichuan, etc.) are imported inside a try/except loop so that a missing optional dependency for one model family never prevents the package from importing; a warning names the unavailable class and notes that the generic streaming path still works.[2]
requirements.txt is a legacy file from the repository's earlier Anima training/RLHF era and does NOT reflect the install_requires of the published airllm package.[3] That file installs transformers from the Hugging Face GitHub HEAD rather than a PyPI release, pins accelerate to the v0.20.3 tag and peft to the v0.3.0 tag from their respective GitHub repositories.[3] Fixed-version entries in requirements.txt include bitsandbytes==0.39.0 (optional 4-bit/8-bit compression), einops==0.6.1, evaluate==0.4.0, scikit-learn==1.2.2, sentencepiece==0.1.99, and wandb==0.15.3.[3] The requirements.txt file is preserved for historical reference only; users installing AirLLM for inference should rely on setup.py via pip install airllm to obtain the correct, tested dependency set.
Sources