Skip to main content

generation_config_candidates

Function generation_config_candidates 

Source
pub fn generation_config_candidates(
    repo_id: &str,
    tags: &[String],
) -> Vec<String>
Expand description

Where to look for a generation_config.json, best candidate first.

The file lives in the base repo — Qwen/Qwen3-4B — while the GGUF a person downloads almost always comes from a quant repo such as unsloth/Qwen3-4B-GGUF, which carries the weights and little else. Asking only the repo gglib downloaded from would find nothing on the overwhelming majority of imports.

Three sources, in descending order of how much they are actually knowledge:

  1. base_model: tags. HuggingFace generates these on a quant repo from its model card, in the forms base_model:Qwen/Qwen3-4B and base_model:quantized:Qwen/Qwen3-4B. This is the publisher stating the relationship, so it goes first.
  2. The download repo itself. Some publishers do ship the file beside the GGUFs, and a repo that is not a quant repo is its own base.
  3. The name with a quant suffix stripped, under the same owner. A guess, and last for that reason — unsloth/Qwen3-4B-GGUF implies unsloth/Qwen3-4B, which frequently does not exist. Harmless because a miss is a 404 the caller already has to handle.

Deduplicated, order-preserving, so a repo that is its own base is not asked twice.