Log in to pull Gemma 4 from HuggingFace

python & transformers

// what it does

huggingface-cli login stores an access token so downloads authenticate as you. Create the token at huggingface.co/settings/tokens with read scope. Even for Apache 2.0 weights, some Gemma repos still ask you to acknowledge terms on the model page before the first pull.

// shell

$ huggingface-cli login

// gotcha

A 401 or 403 on download usually means you either skipped login or have not clicked the acknowledgment on the model's Hugging Face page — accept it in the browser, then retry.

// resources