Adds a new CLI script that scrapes sampling parameters, context length, sources, and notes from HuggingFace model pages and emits project-compatible YAML. Includes 63 offline unit + integration tests documenting exact input/output behaviour.
Script (bin/hf-model-settings-scraper.py)
Input — any of:
hf-model-settings-scraper.py owner/model
hf-model-settings-scraper.py https://huggingface.co/owner/model
hf-model-settings-scraper.py -f models.txt -o model-settings.yml
Output — YAML in the project's model-settings format:
models:hf.co/Qwen/Qwen2.5-Coder-7B-Instruct:settings:temperature:0.7top_p:0.8top_k:20do_sample:truemax_ctx:32768sources:- https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instructnotes:| Here provides a code snippet with `apply_chat_template` ...hf.co/unsloth/Qwen3-30B-A3B-Thinking-2507-GGUF:modes:thinking:# detected via name/tag keywordstemperature:0.6top_k:20sources:- https://huggingface.co/unsloth/Qwen3-30B-A3B-Thinking-2507-GGUF- https://huggingface.co/Qwen/Qwen3-30B-A3B-Thinking-2507 # base model fallbackKey behaviours:
- Falls back to
base_model'sgeneration_config.jsonwhen missing (common for GGUF repos) - Detects thinking/reasoning models by name keywords (
thinking,reasoning,cot) or HF tags → emitsmodes.thinkinginstead ofsettings - Extracts sampling params from README code blocks (YAML/Python/JSON styles) as last resort; ignores trivial
max_new_tokensvalues < 1024 - Strips markdown blockquote markers (
>,[!IMPORTANT]) from notes - Source URL filtering: enforces
/{owner}/{repo}shape on HF URLs; blocksdatasets/,papers/,blob/,resolve/, fragments, CDN images, and org-only pages; caps at 6 per model - Gated models (HTTP 401) degrade gracefully to sources-only output
Tests (bin/tests/test_hf_model_settings_scraper.py)
63 pytest tests, zero network calls. Covers every extraction function via inline synthetic fixtures, plus a full end-to-end integration test using unittest.mock.patch on _fetch_json/_fetch_text that verifies the YAML dict and file output from spec string to disk.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.