Home / Guide / Troubleshooting
Troubleshooting

AirLLM Troubleshooting Guide: Fixes for the Most Common Errors

Solve common AirLLM problems: CUDA not available, out-of-memory errors, bitsandbytes issues, disk space failures, gated models and unexpectedly slow generation.

AirLLM Troubleshooting Guide: Fixes for the Most Common Errors

AirLLM is straightforward once configured, but its combination of GPU drivers, Python packages, large downloads and heavy disk activity creates several places where things can go wrong. This AirLLM troubleshooting guide collects the most common problems, explains why they happen and gives clear fixes.

Start with a quick health check

Before investigating a specific error, run these checks. They resolve a surprising number of problems.

python --version
python -c "import torch; print(torch.__version__, torch.cuda.is_available())"
python -c "import airllm; print('airllm ok')"
nvidia-smi

You want a supported Python version, a PyTorch build that reports True for CUDA, a working AirLLM import and an nvidia-smi table showing your GPU.

1. CUDA not available

Symptom: torch.cuda.is_available() returns False, or AirLLM complains about missing CUDA.

Cause: a CPU-only PyTorch build, an outdated NVIDIA driver, or running outside the virtual environment where the CUDA build is installed.

Fix:

pip uninstall -y torch
pip install torch --index-url https://download.pytorch.org/whl/cu124

Update your NVIDIA driver if nvidia-smi reports a CUDA version older than the build you installed.

2. CUDA out of memory

Symptom: torch.OutOfMemoryError: CUDA out of memory.

Cause: other programs holding GPU memory, long input sequences creating large activations, or memory fragmentation on very small cards.

Fix:

  • Close browsers, games and other GPU applications.
  • Reduce max_length in the tokenizer call and lower max_new_tokens.
  • Enable compression="4bit".
  • Set PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True before running.

3. bitsandbytes errors

Symptom: import errors mentioning bitsandbytes when compression is enabled.

Fix: install or upgrade it in the same environment with pip install -U bitsandbytes. On older Windows setups, upgrading to a recent version usually resolves missing binary problems. If you do not need compression, remove the compression argument.

4. Disk space exhausted during splitting

Symptom: the process stops while saving layers, or reports No space left on device.

Cause: splitting requires space for the original weights and the new shards simultaneously.

Fix: set layer_shards_saving_path to a drive with ample space, delete partially written shard folders before retrying, and consider delete_original=True after a successful split.

5. Gated repository or 401 errors

Symptom: 401 Unauthorized or a message that the repository is gated.

Fix: accept the model's licence on Hugging Face, create an access token and pass it with hf_token. Check that the token has read permission.

6. Extremely slow generation

Symptom: minutes per token even for moderate models.

Likely causes and fixes:

  • Shards on a hard drive or network share: move them to NVMe.
  • Antivirus scanning each shard: exclude the shard folder.
  • No compression: try 8-bit or 4-bit.
  • Laptop on battery or power saving: plug in and use a performance plan.

Our AirLLM speed guide explains the underlying causes in detail.

7. Unsupported architecture

Symptom: an error stating the model type is not supported.

Fix: check the architectures field in the model's config.json and compare it with the README. Upgrade AirLLM, since support for new families arrives regularly. See AirLLM supported models for an overview.

8. Garbled or repetitive output

Cause: using a base model where an instruct model was intended, skipping the chat template, or decoding the prompt along with the answer.

Fix: choose the instruct variant, format prompts with apply_chat_template, and decode only the newly generated tokens.

9. Windows path and permission issues

Enable long path support, keep caches near the drive root, run PowerShell with permission to activate virtual environments and avoid folders synchronised by cloud storage services, which can lock files mid-write.

Reporting a bug effectively

If none of these steps help, open an issue on the official GitHub repository. Include your operating system, GPU and driver version, Python, PyTorch and AirLLM versions, the exact model name, your full script and the complete error message. Clear reports receive faster, more useful responses.

A systematic approach to unfamiliar errors

Not every problem fits a neat category. When you meet an unfamiliar error, work methodically. First, read the last lines of the traceback, which usually name the actual failure, and note which library raised it: PyTorch, Transformers, Hugging Face Hub, bitsandbytes or AirLLM itself. Second, reproduce the problem with the smallest possible example, such as a 7B model and a five-word prompt. If the small example works, the issue is likely related to resources such as memory or disk rather than installation. Third, change one thing at a time and record what you tried. This disciplined approach finds root causes far faster than random adjustments.

Version conflicts between libraries

AirLLM depends on PyTorch, Transformers, Accelerate, Safetensors and the Hugging Face Hub library. Occasionally a new release of one dependency changes behaviour in a way that affects others. Symptoms include attribute errors mentioning internal functions, or unexpected keyword argument errors. The cleanest fix is a fresh virtual environment with current versions of everything. If a specific combination is known to work, record it in a requirements.txt file and install from that file in future.

Diagnosing interrupted downloads

Large downloads sometimes stop partway, leaving incomplete files in the cache. Subsequent attempts may then fail with confusing errors about corrupted or unreadable files. Delete the affected model's folder from the Hugging Face cache and download again, preferably with a resumable method such as the Hugging Face command-line tool. Also delete any partially written shard folder, because AirLLM may otherwise try to reuse incomplete shards.

Preventive habits

  • Use a dedicated virtual environment for airllm.
  • Keep 20 percent or more free space on the shard drive.
  • Test new models at small scale before long runs.
  • Record versions and settings with every set of results.
  • Upgrade deliberately and read release notes first.

Isolate the stage that failed

Write down the last event you observed before the error. A Python import failure points towards the environment. An access denied response while fetching weights points towards the repository or authentication. An error while preparing shards points towards the files, their format or available disk space. An error during generation can involve memory, a model specific dependency or a prompt that is too large. Identifying the stage narrows the checks you need to perform.

Run the smallest relevant test from the same terminal or service that launches airllm. For an import failure, confirm the interpreter and package location. For a missing model file, verify which revision and path the process is trying to read. Print the full path before modifying cache settings. If disk space is the problem, check the volumes used for both original weights and prepared shards. Also check whether the process can write there and whether a stale or interrupted copy occupies space.

After a failed first download or split, save the error message and note which files were being written. Keep the original model files available while you investigate. If you need to test a new shard directory, use a separate path for that attempt so you can distinguish new output from the incomplete run. Avoid launching two preparation jobs against the same checkpoint cache while diagnosing a failure. The resulting files and timing are harder to interpret.

During a suspected memory error, lower the prompt and output limits together for the first diagnostic run. When it succeeds, increase one at a time and record which change brings the error back. Close unrelated GPU workloads for the baseline. If the small test also fails, inspect the exact exception. A missing CUDA library and an out of memory error call for different fixes even when they happen during the same line of Python.

Document each attempt in a short log with the change, the result and the version of the model. Restore the last known working settings before trying a different theory. If you need help from the project, provide the operating system, GPU, package versions, model repository and the minimal script that reproduces the failure. Redact private prompts, credentials and personal paths from the report. Include whether preparation ever completed and whether the error also occurs with a small checkpoint.

Once you find a fix, run the failing case again from a fresh process and confirm it completes on the same machine. Repeat it with a short prompt that checks the expected output. If the change only succeeds on the second run, record the role of the cache so you can explain what will happen on another machine. Put the working configuration beside the script so future runs start with a reproducible AirLLM setup.

Frequently asked questions

Usually because a CPU-only PyTorch build is installed. Reinstall PyTorch from the official index URL matching your CUDA version and confirm torch.cuda.is_available() returns True.

Close other GPU applications, reduce max_length and max_new_tokens, try 4-bit compression and set PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to reduce memory fragmentation.

Most often the disk has run out of space. Splitting temporarily needs room for both the original weights and the shards. Free space or set layer_shards_saving_path to a larger drive.

Use the Issues section of the official GitHub repository. Include your operating system, GPU, Python and PyTorch versions, AirLLM version, the model name and the full error message.

Conclusion

Most AirLLM problems fall into a few categories: the wrong PyTorch build, too little GPU memory headroom, insufficient disk space, gated models and slow storage. Work through the health check first, apply the targeted fix for your symptom and keep your packages current. With those habits, AirLLM becomes a dependable tool for running models far larger than your hardware would normally allow.