LLaMA 7B GPU Memory Requirement Loading LLaMA 7B in FP16 via `torch_dtype=torch.float16` in current Transformers versions cuts the memory needed for model weights, and 4-bit loading with bitsandbytes provides additional headroom when FP16 still exhausts a T4 GPU. The guidance notes that the KV cache grows with sequence length, so a model that loads successfully can still run out of memory during generation, which is why lowering batch size reduces inference memory use. Keeping `max_new_tokens` low for the first test helps avoid that failure. The accepted answer gets the model loaded in FP16. One detail worth adding for anyone trying this on a T4: when the OOM happens tells you what to change. dtype=torch.float16 in current Transformers versions torch dtype=torch.float16 in older versions . If FP16 still leaves too little room on the T4, 4-bit loading with bitsandbytes gives you more headroom. LlamaForCausalLM , keep max new tokens low for the first test too. The KV cache grows as the sequence gets longer, so a model that loads successfully can still run out of memory during generation. That’s why lowering the batch size helped in the FAIR example. It reduces memory used during inference. Loading in FP16 reduces the memory needed for the weights.