How to use Model locally using in CLI for testing purposes no GUI tool A community forum answer lays out a two-step method for running a language model locally from the command line without a GUI: download Qwen/Qwen2.5-0.5B-Instruct once with `hf download ... --local-dir ./qwen` from the huggingface_hub package, then load it via the transformers `pipeline` with `local_files_only=True` and `device_map="auto"`. The answer attributes most "hundreds of errors" to pointing the loader at a single file instead of the folder containing config.json, or to missing torch and accelerate installs, and notes that `transformers chat Qwen/Qwen2.5-0.5B-Instruct` offers a no-code terminal chat. A second reply recommends Ollama as a single-install, single-command CLI alternative requiring no Python environment. Hello everybody, How can I download the models locally, and how inference them smoothly without having hundered of errors. and it’s too hard to use transfomer lib to and forcing him to load the local model. can anyone help? Hi Easiest way is two steps. 1. Download the model once pip install -U huggingface hub hf download Qwen/Qwen2.5-0.5B-Instruct --local-dir ./qwen 2. Load it from that folder pip install torch transformers accelerate python from transformers import pipeline pipe = pipeline "text-generation", model="./qwen", folder that contains config.json device map="auto", local files only=True, never hits the internet messages = {"role": "user", "content": "Hello "} out = pipe messages, max new tokens=100 print out 0 "generated text" -1 "content" Most “hundreds of errors” come from a wrong path it must be the folder with config.json , not a single file or from missing torch / accelerate . If you just want to chat in the terminal with no code, this also works see the “Chat basics” docs : transformers chat Qwen/Qwen2.5-0.5B-Instruct If you still get an error, paste the last lines of the traceback and the model name, and we can look at it. One more beginner friendly option if the transformers route gives you trouble: Ollama gives you a pure CLI chat with a single install and a single command to pull and run a model, no Python environment needed. It is worth trying when you just want to test a model quickly. If you stick with transformers, make sure the local folder really contains config.json and the model weights, since a wrong path is the most common error.