Skip to content

app : add the llama download subcommand - #24982

Merged
angt merged 2 commits into
ggml-org:masterfrom
angt:app-add-the-download-command-with-llama-download
Jun 25, 2026
Merged

app : add the llama download subcommand#24982
angt merged 2 commits into
ggml-org:masterfrom
angt:app-add-the-download-command-with-llama-download

Conversation

@angt

@angt angt commented Jun 24, 2026

Copy link
Copy Markdown
Member

Overview

Add the tool llama-download and the download subcommand of llama.

Additional information

I try to keep the current usage and avoid code duplication, but maybe it's also the opportunity to rework this part ?

Requirements

Signed-off-by: Adrien Gallouët <angt@huggingface.co>
@angt
angt requested a review from a team as a code owner June 24, 2026 19:51
@angt
angt requested a review from julien-c June 24, 2026 19:57
@ngxson

ngxson commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

IMO we don't really need a dedicated llama-download binary for it. The goal of llama-* binaries is mostly for compatibility (i.e. users who already use llama-* continue to use it), but this subcommand is new so it's quite redundant to be both a subcommand and a dedicated binary

@CISC

CISC commented Jun 25, 2026

Copy link
Copy Markdown
Member

IMO we don't really need a dedicated llama-download binary for it. The goal of llama-* binaries is mostly for compatibility (i.e. users who already use llama-* continue to use it), but this subcommand is new so it's quite redundant to be both a subcommand and a dedicated binary

Also would not a more appropriate name be llama cache as download suggests to me the files would be placed in a folder of my choosing for more permanent storing.

@angt

angt commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

IMO we don't really need a dedicated llama-download binary for it. The goal of llama-* binaries is mostly for compatibility (i.e. users who already use llama-* continue to use it), but this subcommand is new so it's quite redundant to be both a subcommand and a dedicated binary

I agree with that too, @ggerganov ?

@angt

angt commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

Also would not a more appropriate name be llama cache as download suggests to me the files would be placed in a folder of my choosing for more permanent storing.

llama cache will be also provided to handle the cache, here we only focus on downloading models, selecting the best tag, without launching the server.

we are approximately reproducing the UX of hf:

Main commands:
  ...
  cache                Manage local cache directory.
  download             Download files from the Hub.
  ...

@ggerganov

Copy link
Copy Markdown
Member

IMO we don't really need a dedicated llama-download binary for it. The goal of llama-* binaries is mostly for compatibility (i.e. users who already use llama-* continue to use it), but this subcommand is new so it's quite redundant to be both a subcommand and a dedicated binary

I agree with that too, @ggerganov ?

Either way is fine. Let's remove the llama-download binary build for now.

Signed-off-by: Adrien Gallouët <angt@huggingface.co>
@angt

angt commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

Done

$ ./build/bin/llama download --help
----- example-specific params -----

-h,    --help, --usage                  print usage and exit
--mmproj-auto, --no-mmproj, --no-mmproj-auto
                                        whether to use multimodal projector file (if available), useful when
                                        using -hf (default: enabled)
                                        (env: LLAMA_ARG_MMPROJ_AUTO)
-m,    --model FNAME                    model path to load
                                        (env: LLAMA_ARG_MODEL)
-mu,   --model-url MODEL_URL            model download url (default: unused)
                                        (env: LLAMA_ARG_MODEL_URL)
-dr,   --docker-repo [<repo>/]<model>[:quant]
                                        Docker Hub model repository. repo is optional, default to ai/. quant
                                        is optional, default to :latest.
                                        example: gemma3
                                        (default: unused)
                                        (env: LLAMA_ARG_DOCKER_REPO)
-hf,   -hfr, --hf-repo <user>/<model>[:quant]
                                        Hugging Face model repository; quant is optional, case-insensitive,
                                        default to Q4_K_M, or falls back to the first file in the repo if
                                        Q4_K_M doesn't exist.
                                        mmproj is also downloaded automatically if available. to disable, add
                                        --no-mmproj
                                        example: ggml-org/GLM-4.7-Flash-GGUF:Q4_K_M
                                        (default: unused)
                                        (env: LLAMA_ARG_HF_REPO)
-hff,  --hf-file FILE                   Hugging Face model file. If specified, it will override the quant in
                                        --hf-repo (default: unused)
                                        (env: LLAMA_ARG_HF_FILE)
-hft,  --hf-token TOKEN                 Hugging Face access token (default: value from HF_TOKEN environment
                                        variable)
                                        (env: HF_TOKEN)
--mtp                                   also download the multi-token prediction (MTP) head, if available
                                        (default: unused)

examples:
  download -hf ggml-org/gemma-3-4b-it-qat-GGUF
  download -hf ggml-org/gemma-3-4b-it-qat-GGUF:Q4_K_M
  download -hf ggml-org/models -hff model.gguf
  download -mu https://example.com/model.gguf -m model.gguf

@angt angt changed the title app : add the download command (with llama-download) app : add the download command Jun 25, 2026
@angt angt changed the title app : add the download command app : add the llama download subcommand Jun 25, 2026
@julien-c

Copy link
Copy Markdown
Contributor

do we need the --docker-repo etc flags? not sure if they're actually used widely in practice:)

@angt
angt merged commit 683b04c into ggml-org:master Jun 25, 2026
24 of 25 checks passed
papamoose pushed a commit to papamoose/llama.cpp that referenced this pull request Jun 27, 2026
* app : add the download command (with llama-download)

Signed-off-by: Adrien Gallouët <angt@huggingface.co>

* Remove llama-download tool for now

Signed-off-by: Adrien Gallouët <angt@huggingface.co>

---------

Signed-off-by: Adrien Gallouët <angt@huggingface.co>
adrianhoehne pushed a commit to adrianhoehne/llama.cpp that referenced this pull request Jul 5, 2026
* app : add the download command (with llama-download)

Signed-off-by: Adrien Gallouët <angt@huggingface.co>

* Remove llama-download tool for now

Signed-off-by: Adrien Gallouët <angt@huggingface.co>

---------

Signed-off-by: Adrien Gallouët <angt@huggingface.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants