Files

1 line
91 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"repo": "barkeydog/minefit", "files": {"scripts/scrape_hf_models.py": {"92a7d168a80fe7bbe2e828bc25d62859c39b3982": {"t": 1785674659.449193, "n": 85464, "h": "b34f60d8c60e220d", "c": "#!/usr/bin/env python3\n\"\"\"\nScraper for popular LLM models from Hugging Face.\nFetches model metadata and computes RAM/VRAM requirements from parameter counts.\nOutputs a JSON file consumable by llmfit's models.rs.\n\nUsage:\n python3 scrape_hf_models.py # Curated list only\n python3 scrape_hf_models.py --discover # Curated + top trending models\n python3 scrape_hf_models.py --discover -n 50 # Curated + top 50 trending\n\"\"\"\n\nimport argparse\nimport json\nimport os\nimport sys\nimport time\nimport urllib.request\nimport urllib.error\n\nHF_API = \"https://huggingface.co/api/models\"\n\n# Global auth token, set from --token flag or HF_TOKEN / HUGGING_FACE_HUB_TOKEN env var\n_hf_token: str | None = None\n\n\ndef _auth_headers() -> dict[str, str]:\n \"\"\"Return HTTP headers with auth if a HuggingFace token is available.\"\"\"\n headers = {\"User-Agent\": \"llmfit-scraper/1.0\"}\n if _hf_token:\n headers[\"Authorization\"] = f\"Bearer {_hf_token}\"\n return headers\n\n# Top text-generation models to scrape (owner/repo)\nTARGET_MODELS = [\n # Meta Llama family\n \"meta-llama/Llama-3.1-8B\",\n \"meta-llama/Llama-3.1-8B-Instruct\",\n \"meta-llama/Llama-3.1-70B-Instruct\",\n \"meta-llama/Llama-3.1-405B-Instruct\",\n \"meta-llama/Llama-3.2-1B\",\n \"meta-llama/Llama-3.2-3B\",\n \"meta-llama/Llama-3.2-11B-Vision-Instruct\", # NEW: Multimodal vision model\n \"meta-llama/Llama-3.3-70B-Instruct\",\n # Meta Llama 4 (MoE)\n \"meta-llama/Llama-4-Scout-17B-16E-Instruct\",\n \"meta-llama/Llama-4-Maverick-17B-128E-Instruct\",\n # Code Llama\n \"meta-llama/CodeLlama-7b-Instruct-hf\", # NEW: Popular code model\n \"meta-llama/CodeLlama-13b-Instruct-hf\", # NEW: Larger code model\n \"meta-llama/CodeLlama-34b-Instruct-hf\", # NEW: Large code model\n # Mistral\n \"mistralai/Mistral-7B-Instruct-v0.3\",\n \"mistralai/Mixtral-8x7B-Instruct-v0.1\",\n \"mistralai/Mixtral-8x22B-Instruct-v0.1\",\n \"mistralai/Mistral-Large-Instruct-2407\",\n \"mistralai/Mistral-Small-24B-Instruct-2501\",\n \"mistralai/Mistral-Small-3.1-24B-Instruct-2503\",\n \"mistralai/Ministral-8B-Instruct-2410\",\n \"mistralai/Mistral-Nemo-Instruct-2407\",\n # Qwen\n \"Qwen/Qwen2.5-7B-Instruct\",\n \"Qwen/Qwen2.5-14B-Instruct\",\n \"Qwen/Qwen2.5-32B-Instruct\",\n \"Qwen/Qwen2.5-72B-Instruct\",\n \"Qwen/Qwen2.5-Coder-1.5B-Instruct\", # NEW: Ultra-lightweight coder\n \"Qwen/Qwen2.5-Coder-7B-Instruct\", # NEW: Popular coder\n \"Qwen/Qwen2.5-Coder-14B-Instruct\", # NEW: Mid-size coder\n \"Qwen/Qwen2.5-Coder-32B-Instruct\", # NEW: Large coder\n \"Qwen/Qwen2.5-VL-3B-Instruct\", # NEW: Vision-language 3B\n \"Qwen/Qwen2.5-VL-7B-Instruct\", # NEW: Vision-language 7B\n \"Qwen/Qwen3-0.6B\",\n \"Qwen/Qwen3-1.7B\",\n \"Qwen/Qwen3-4B\",\n \"Qwen/Qwen3-8B\",\n \"Qwen/Qwen3-14B\",\n \"Qwen/Qwen3-32B\",\n \"Qwen/Qwen3-30B-A3B\",\n \"Qwen/Qwen3-235B-A22B\",\n \"Qwen/Qwen3-Coder-480B-A35B-Instruct\",\n \"Qwen/Qwen3-Coder-Next\",\n # Qwen 3.5 (native multimodal, Feb 2026)\n \"Qwen/Qwen3.5-27B\",\n \"Qwen/Qwen3.5-35B-A3B\",\n \"Qwen/Qwen3.5-122B-A10B\",\n \"Qwen/Qwen3.5-397B-A17B\",\n # Qwen3.5 Small Series (Instruct)\n \"Qwen/Qwen3.5-0.8B\",\n \"Qwen/Qwen3.5-2B\",\n \"Qwen/Qwen3.5-4B\",\n \"Qwen/Qwen3.5-9B\",\n # Qwen3.5 Small Series (Base)\n \"Qwen/Qwen3.5-0.8B-Base\",\n \"Qwen/Qwen3.5-2B-Base\",\n \"Qwen/Qwen3.5-4B-Base\",\n \"Qwen/Qwen3.5-9B-Base\",\n # Microsoft Phi\n \"microsoft/phi-3-mini-4k-instruct\",\n \"microsoft/Phi-3-medium-14b-instruct\",\n \"microsoft/Phi-3.5-mini-instruct\", # NEW: Newer Phi variant\n \"microsoft/phi-4\",\n \"microsoft/Phi-4-mini-instruct\",\n # Microsoft Orca\n \"microsoft/Orca-2-7b\", # NEW: Reasoning model\n \"microsoft/Orca-2-13b\", # NEW: Larger reasoning model\n # Google Gemma\n \"google/gemma-2-2b-it\", # NEW: Smaller variant for edge\n \"google/gemma-2-9b-it\",\n \"google/gemma-2-27b-it\",\n \"google/gemma-3-1b-it\",\n \"google/gemma-3-4b-it\",\n \"google/gemma-3-12b-it\",\n \"google/gemma-3-27b-it\",\n # DeepSeek\n \"deepseek-ai/DeepSeek-R1-Distill-Qwen-7B\",\n \"deepseek-ai/DeepSeek-R1-Distill-Qwen-32B\",\n \"deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct\",\n \"deepseek-ai/DeepSeek-V3\",\n \"deepseek-ai/DeepSeek-R1\",\n # Cohere\n \"CohereForAI/c4ai-command-r-v01\",\n # 01.ai Yi family\n \"01-ai/Yi-6B-Chat\", # NEW: Popular multilingual 6B\n \"01-ai/Yi-34B-Chat\", # NEW: Popular multilingual 34B\n # Upstage Solar\n \"upstage/SOLAR-10.7B-Instruct-v1.0\", # NEW: High-performance 10.7B\n # TII Falcon\n \"tiiuae/falcon-7b-instruct\", # NEW: Popular UAE model\n \"tiiuae/falcon-40b-instruct\",\n \"tiiuae/falcon-180B-chat\",\n \"tiiuae/Falcon3-7B-Instruct\",\n \"tiiuae/Falcon3-10B-Instruct\",\n # HuggingFace Zephyr\n \"HuggingFaceH4/zephyr-7b-beta\", # NEW: Very popular fine-tune\n # OpenChat\n \"openchat/openchat-3.5-0106\", # NEW: Popular alternative\n # LMSYS Vicuna\n \"lmsys/vicuna-7b-v1.5\", # NEW: Popular community model\n \"lmsys/vicuna-13b-v1.5\", # NEW: Larger Vicuna\n # NousResearch\n \"NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO\", # NEW: Popular fine-tune\n # WizardLM\n \"WizardLMTeam/WizardLM-13B-V1.2\", # NEW: Popular instruction model\n # Code models\n \"bigcode/starcoder2-7b\",\n \"bigcode/starcoder2-15b\",\n \"WizardLMTeam/WizardCoder-15B-V1.0\", # NEW: Code specialist\n # Small / edge models\n \"TinyLlama/TinyLlama-1.1B-Chat-v1.0\",\n \"stabilityai/stablelm-2-1_6b-chat\",\n # IBM Granite\n \"ibm-granite/granite-3.1-8b-instruct\",\n \"ibm-granite/granite-4.0-h-tiny\",\n \"ibm-granite/granite-4.0-h-micro\",\n \"ibm-granite/granite-4.0-h-small\",\n # Allen Institute OLMo\n \"allenai/OLMo-2-0325-32B-Instruct\",\n # Zhipu GLM\n \"THUDM/glm-4-9b-chat\",\n # xAI Grok\n \"xai-org/grok-1\",\n # Moonshot Kimi\n \"moonshotai/Kimi-K2-Instruct\",\n # BigScience BLOOM\n \"bigscience/bloom\",\n # Baidu ERNIE\n \"baidu/ERNIE-4.5-300B-A47B-Paddle\",\n # Rednote dots.llm\n \"rednote-hilab/dots.llm1.inst\",\n # Meituan LongCat\n \"meituan/LongCat-Flash\",\n # Ant Group Ling\n \"inclusionAI/Ling-lite\",\n # Liquid AI LFM2 (dense)\n \"LiquidAI/LFM2-350M\",\n \"LiquidAI/LFM2-700M\",\n \"LiquidAI/LFM2-1.2B\",\n \"LiquidAI/LFM2-2.6B\",\n \"LiquidAI/LFM2-2.6B-Exp\",\n # Liquid AI LFM2 (MoE)\n \"LiquidAI/LFM2-8B-A1B\",\n \"LiquidAI/LFM2-24B-A2B\",\n # Liquid AI LFM2.5\n \"LiquidAI/LFM2.5-1.2B-Base\",\n \"LiquidAI/LFM2.5-1.2B-Instruct\",\n \"LiquidAI/LFM2.5-1.2B-Thinking\",\n \"LiquidAI/LFM2.5-1.2B-JP\",\n # Liquid AI LFM2 Vision-Language\n \"LiquidAI/LFM2-VL-450M\",\n \"LiquidAI/LFM2-VL-1.6B\",\n \"LiquidAI/LFM2-VL-3B\",\n \"LiquidAI/LFM2.5-VL-1.6B\",\n # Liquid AI LFM2 Audio\n \"LiquidAI/LFM2-Audio-1.5B\",\n \"LiquidAI/LFM2.5-Audio-1.5B\",\n # Liquid AI Liquid Nanos (task-specific fine-tunes)\n \"LiquidAI/LFM2-1.2B-Tool\",\n \"LiquidAI/LFM2-1.2B-RAG\",\n \"LiquidAI/LFM2-1.2B-Extract\",\n \"LiquidAI/LFM2-350M-Extract\",\n \"LiquidAI/LFM2-350M-Math\",\n \"LiquidAI/LFM2-350M-ENJP-MT\",\n \"LiquidAI/LFM2-350M-PII-Extract-JP\",\n \"LiquidAI/LFM2-ColBERT-350M\",\n \"LiquidAI/LFM2-2.6B-Transcript\",\n # Embeddings (useful for RAG sizing)\n \"nomic-ai/nomic-embed-text-v1.5\",\n \"BAAI/bge-large-en-v1.5\",\n # --- New models added Feb 2026 ---\n # DeepSeek V3.2 family\n \"deepseek-ai/DeepSeek-V3.2\",\n \"deepseek-ai/DeepSeek-V3.2-Speciale\",\n # Zhipu/Z.ai GLM-5\n \"zai-org/GLM-5\",\n # Moonshot Kimi K2.5\n \"moonshotai/Kimi-K2.5\",\n # MiniMax M2.5\n \"MiniMaxAI/MiniMax-M2.5\",\n # Xiaomi MiMo\n \"XiaomiMiMo/MiMo-V2-Flash\",\n \"XiaomiMiMo/MiMo-7B-RL\",\n # NVIDIA Nemotron\n \"nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16\",\n \"nvidia/NVIDIA-Nemotron-Nano-9B-v2\",\n # Microsoft Phi-4 reasoning family\n \"microsoft/Phi-4-reasoning\",\n \"microsoft/Phi-4-mini-reasoning\",\n \"microsoft/Phi-4-multimodal-instruct\",\n # LG AI EXAONE 4.0\n \"LGAI-EXAONE/EXAONE-4.0-32B\",\n \"LGAI-EXAONE/EXAONE-4.0-1.2B\",\n # HuggingFace SmolLM3\n \"HuggingFaceTB/SmolLM3-3B\",\n # Google Gemma 3n (effective parameter models)\n \"google/gemma-3n-E4B-it\",\n \"google/gemma-3n-E2B-it\",\n]\n\n# Bytes-per-parameter for different quantization levels\nQUANT_BPP = {\n \"F32\": 4.0,\n \"F16\": 2.0,\n \"BF16\": 2.0,\n \"Q8_0\": 1.0,\n \"Q6_K\": 0.75,\n \"Q5_K_M\": 0.625,\n \"Q4_K_M\": 0.5,\n \"Q4_0\": 0.5,\n \"Q3_K_M\": 0.4375,\n \"Q2_K\": 0.3125,\n \"AWQ-4bit\": 0.5,\n \"AWQ-8bit\": 1.0,\n \"GPTQ-Int4\": 0.5,\n \"GPTQ-Int8\": 1.0,\n}\n\n# Overhead multiplier for runtime memory beyond just model weights\nRUNTIME_OVERHEAD = 1.2 # ~20% overhead for KV cache, activations, OS\n\n# Known MoE (Mixture of Experts) architecture configurations\nMOE_CONFIGS = {\n \"mixtral\": {\"num_experts\": 8, \"active_experts\": 2},\n \"deepseek_v2\": {\"num_experts\": 64, \"active_experts\": 6},\n \"deepseek_v3\": {\"num_experts\": 256, \"active_experts\": 8},\n \"qwen3_moe\": {\"num_experts\": 128, \"active_experts\": 8},\n \"llama4\": {\"num_experts\": 16, \"active_experts\": 1},\n \"grok\": {\"num_experts\": 8, \"active_experts\": 2},\n \"glm5\": {\"num_experts\": 256, \"active_experts\": 8},\n \"minimax_m2\": {\"num_experts\": 32, \"active_experts\": 2},\n \"mimo_v2\": {\"num_experts\": 128, \"active_experts\": 8},\n \"nemotron3_nano\": {\"num_experts\": 128, \"active_experts\": 6},\n \"qwen3_5_moe\": {\"num_experts\": 256, \"active_experts\": 8},\n \"qwen3_vl_moe\": {\"num_experts\": 256, \"active_experts\": 8},\n}\n\n# Published active parameter counts for well-known MoE models\nMOE_ACTIVE_PARAMS = {\n \"mistralai/Mixtral-8x7B-Instruct-v0.1\": 12_900_000_000,\n \"mistralai/Mixtral-8x22B-Instruct-v0.1\": 39_100_000_000,\n \"NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO\": 12_900_000_000,\n \"deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct\": 2_400_000_000,\n \"deepseek-ai/DeepSeek-V3\": 37_000_000_000,\n \"deepseek-ai/DeepSeek-R1\": 37_000_000_000,\n \"deepseek-ai/DeepSeek-V3.2\": 37_000_000_000,\n \"deepseek-ai/DeepSeek-V3.2-Speciale\": 37_000_000_000,\n \"Qwen/Qwen3-30B-A3B\": 3_300_000_000,\n \"Qwen/Qwen3-235B-A22B\": 22_000_000_000,\n \"Qwen/Qwen3-Coder-480B-A35B-Instruct\": 35_000_000_000,\n \"Qwen/Qwen3-Coder-Next\": 3_000_000_000,\n \"Qwen/Qwen3.5-35B-A3B\": 3_000_000_000,\n \"Qwen/Qwen3.5-122B-A10B\": 10_000_000_000,\n \"Qwen/Qwen3.5-397B-A17B\": 17_000_000_000,\n \"meta-llama/Llama-4-Scout-17B-16E-Instruct\": 17_000_000_000,\n \"meta-llama/Llama-4-Maverick-17B-128E-Instruct\": 17_000_000_000,\n \"xai-org/grok-1\": 86_000_000_000,\n \"moonshotai/Kimi-K2-Instruct\": 32_000_000_000,\n \"moonshotai/Kimi-K2.5\": 32_000_000_000,\n \"zai-org/GLM-5\": 40_000_000_000,\n \"MiniMaxAI/MiniMax-M2.5\": 10_000_000_000,\n \"XiaomiMiMo/MiMo-V2-Flash\": 15_000_000_000,\n \"nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16\": 3_000_000_000,\n \"LiquidAI/LFM2-8B-A1B\": 1_500_000_000,\n \"LiquidAI/LFM2-24B-A2B\": 2_300_000_000, # 23.8B total, 2.3B active\n}\n\n\ndef fetch_model_info(repo_id: str) -> dict | None:\n \"\"\"Fetch model info from HuggingFace API.\"\"\"\n url = f\"{HF_API}/{repo_id}\"\n req = urllib.request.Request(url, headers=_auth_headers())\n try:\n with urllib.request.urlopen(req, timeout=30) as resp:\n return json.loads(resp.read().decode())\n except urllib.error.HTTPError as e:\n if e.code == 401 and not _hf_token:\n print(f\" ⚠ HTTP 401 for {repo_id} — model is gated, set HF_TOKEN to access\",\n file=sys.stderr)\n else:\n print(f\" ⚠ HTTP {e.code} for {repo_id} — skipping\", file=sys.stderr)\n return None\n except Exception as e:\n print(f\" ⚠ Error fetching {repo_id}: {e}\", file=sys.stderr)\n return None\n\n\ndef format_param_count(total_params: int) -> str:\n \"\"\"Convert raw parameter count into human-readable string.\"\"\"\n if total_params >= 1_000_000_000:\n val = total_params / 1_000_000_000\n return f\"{val:.1f}B\" if val != int(val) else f\"{int(val)}B\"\n elif total_params >= 1_000_000:\n val = total_params / 1_000_000\n return f\"{val:.0f}M\"\n else:\n return f\"{total_params / 1_000:.0f}K\"\n\n\ndef estimate_ram(total_params: int, quant: str) -> tuple[float, float]:\n \"\"\"\n Estimate min RAM (Q4 quantized) and recommended RAM (comfortable headroom).\n Returns (min_ram_gb, recommended_ram_gb).\n \"\"\"\n bpp = QUANT_BPP.get(quant, 0.5)\n model_size_gb = (total_params * bpp) / (1024**3)\n min_ram_gb = model_size_gb * RUNTIME_OVERHEAD\n # Recommended: enough for Q4 + generous KV cache + OS headroom\n recommended_ram_gb = model_size_gb * 2.0\n\n # Apply sensible floor\n min_ram_gb = max(min_ram_gb, 1.0)\n recommended_ram_gb = max(recommended_ram_gb, 2.0)\n\n return round(min_ram_gb, 1), round(recommended_ram_gb, 1)\n\n\ndef estimate_vram(total_params: int, quant: str) -> float:\n \"\"\"Estimate minimum VRAM to fit model weights on GPU.\"\"\"\n bpp = QUANT_BPP.get(quant, 0.5)\n model_size_gb = (total_params * bpp) / (1024**3)\n # VRAM needs to hold weights + some activation memory\n vram_gb = model_size_gb * 1.1\n return round(max(vram_gb, 0.5), 1)\n\n\ndef detect_moe(repo_id: str, config: dict | None, architecture: str,\n total_params: int) -> dict:\n \"\"\"Detect MoE architecture and compute active parameters.\"\"\"\n result = {\n \"is_moe\": False,\n \"num_experts\": None,\n \"active_experts\": None,\n \"active_parameters\": None,\n }\n\n # Check config.json for MoE indicators\n num_experts = None\n active_experts = None\n if config:\n num_experts = config.get(\"num_local_experts\") or config.get(\"num_experts\")\n active_experts = config.get(\"num_experts_per_tok\")\n\n # Check if architecture is in known MoE configs\n if architecture in MOE_CONFIGS:\n moe = MOE_CONFIGS[architecture]\n num_experts = num_experts or moe[\"num_experts\"]\n active_experts = active_experts or moe[\"active_experts\"]\n\n if num_experts and active_experts:\n result[\"is_moe\"] = True\n result[\"num_experts\"] = num_experts\n result[\"active_experts\"] = active_experts\n\n # Use published active params if known, otherwise estimate\n if repo_id in MOE_ACTIVE_PARAMS:\n result[\"active_parameters\"] = MOE_ACTIVE_PARAMS[repo_id]\n else:\n result[\"active_parameters\"] = estimate_active_params(\n total_params, num_experts, active_experts)\n\n return result\n\n\ndef estimate_active_params(total_params: int, num_experts: int,\n active_experts: int) -> int:\n \"\"\"Estimate active parameters for MoE models.\n\n Assumes expert MLP layers are ~95% of total params and\n shared attention/embedding layers are ~5%.\n \"\"\"\n shared_fraction = 0.05\n shared = int(total_params * shared_fraction)\n expert_pool = total_params - shared\n per_expert = expert_pool // num_experts\n return shared + active_experts * per_expert\n\n\ndef infer_use_case(repo_id: str, pipeline_tag: str | None, config: dict | None) -> str:\n \"\"\"Infer a brief use-case description from model metadata.\"\"\"\n rid = repo_id.lower()\n if \"embed\" in rid or \"bge\" in rid:\n return \"Text embeddings for RAG\"\n if \"coder\" in rid or \"starcoder\" in rid or \"code\" in rid:\n return \"Code generation and completion\"\n if \"r1\" in rid or \"reason\" in rid:\n return \"Advanced reasoning, chain-of-thought\"\n if \"instruct\" in rid or \"chat\" in rid:\n return \"Instruction following, chat\"\n if \"tiny\" in rid or \"small\" in rid or \"mini\" in rid:\n return \"Lightweight, edge deployment\"\n if pipeline_tag == \"text-generation\":\n return \"General purpose text generation\"\n return \"General purpose\"\n\n\ndef infer_context_length(config: dict | None) -> int:\n \"\"\"Try to extract context length from model config.\"\"\"\n if not config:\n return 4096\n\n # Common config keys for max sequence length\n keys_to_check = [\n \"max_position_embeddings\",\n \"max_sequence_length\",\n \"seq_length\",\n \"n_positions\",\n \"sliding_window\",\n ]\n\n # Check top-level config\n for key in keys_to_check:\n if key in config:\n val = config[key]\n if isinstance(val, int) and val > 0:\n return val\n\n # For multimodal models (e.g., Qwen3.5), check text_config\n if \"text_config\" in config and isinstance(config[\"text_config\"], dict):\n for key in keys_to_check:\n if key in config[\"text_config\"]:\n val = config[\"text_config\"][key]\n if isinstance(val, int) and val > 0:\n return val\n\n return 4096\n\n\ndef fetch_config_json(repo_id: str) -> dict | None:\n \"\"\"Fetch the full config.json from a HF repo (has max_position_embeddings).\"\"\"\n url = f\"https://huggingface.co/{repo_id}/resolve/main/config.json\"\n req = urllib.request.Request(url, headers=_auth_headers())\n try:\n with urllib.request.urlopen(req, timeout=15) as resp:\n return json.loads(resp.read().decode())\n except Exception:\n return None\n\n\ndef extract_provider(repo_id: str) -> str:\n \"\"\"Map HF org name to a friendly provider name.\"\"\"\n org = repo_id.split(\"/\")[0].lower()\n mapping = {\n \"meta-llama\": \"Meta\",\n \"mistralai\": \"Mistral AI\",\n \"qwen\": \"Alibaba\",\n \"microsoft\": \"Microsoft\",\n \"google\": \"Google\",\n \"deepseek-ai\": \"DeepSeek\",\n \"bigcode\": \"BigCode\",\n \"cohereforai\": \"Cohere\",\n \"tinyllama\": \"Community\",\n \"stabilityai\": \"Stability AI\",\n \"nomic-ai\": \"Nomic\",\n \"baai\": \"BAAI\",\n \"01-ai\": \"01.ai\", # NEW\n \"upstage\": \"Upstage\", # NEW\n \"tiiuae\": \"TII\", # NEW\n \"huggingfaceh4\": \"HuggingFace\", # NEW\n \"openchat\": \"OpenChat\", # NEW\n \"lmsys\": \"LMSYS\", # NEW\n \"nousresearch\": \"NousResearch\", # NEW\n \"wizardlmteam\": \"WizardLM\", # NEW\n \"liquidai\": \"Liquid AI\",\n }\n return mapping.get(org, org)\n\n\ndef infer_capabilities(repo_id: str, pipeline_tag: str | None, use_case: str) -> list[str]:\n \"\"\"Infer model capabilities like vision and tool use.\"\"\"\n caps: list[str] = []\n rid = repo_id.lower()\n uc = use_case.lower()\n\n # Vision\n if (\n pipeline_tag == \"image-text-to-text\"\n or \"vision\" in rid\n or \"-vl-\" in rid\n or rid.endswith(\"-vl\")\n or \"llava\" in rid\n or \"onevision\" in rid\n or \"pixtral\" in rid\n or \"vision\" in uc\n or \"multimodal\" in uc\n ):\n caps.append(\"vision\")\n\n # Tool use (known families)\n if (\n \"tool\" in uc\n or \"function call\" in uc\n or \"qwen3\" in rid\n or \"qwen2.5\" in rid\n or \"command-r\" in rid\n or (\"llama-3\" in rid and \"instruct\" in rid)\n or (\"mistral\" in rid and \"instruct\" in rid)\n or \"hermes\" in rid\n ):\n caps.append(\"tool_use\")\n\n return caps\n\n\ndef detect_quant_format(repo_id: str, config: dict | None) -> tuple[str, str]:\n \"\"\"Detect quantization format and label from config.json.\n\n Returns (format, quant_label) where:\n - format: \"gguf\", \"awq\", \"gptq\", \"mlx\", or \"safetensors\"\n - quant_label: e.g. \"AWQ-4bit\", \"GPTQ-Int4\", \"Q4_K_M\"\n \"\"\"\n if not config:\n return _detect_format_from_name(repo_id)\n\n quant_config = config.get(\"quantization_config\", {})\n if not quant_config:\n return _detect_format_from_name(repo_id)\n\n quant_method = quant_config.get(\"quant_method\", \"\")\n bits = quant_config.get(\"bits\", quant_config.get(\"num_bits\", 4))\n\n # AWQ\n if quant_method == \"awq\":\n label = f\"AWQ-{bits}bit\"\n return (\"awq\", label)\n\n # GPTQ (including gptq_marlin)\n if quant_method.startswith(\"gptq\"):\n label = f\"GPTQ-Int{bits}\"\n return (\"gptq\", label)\n\n # compressed-tensors: dig into config_groups for bits, check name for format\n if quant_method == \"compressed-tensors\":\n # Try to extract bits from config_groups\n config_groups = quant_config.get(\"config_groups\", {})\n for group in config_groups.values():\n if isinstance(group, dict):\n weights = group.get(\"weights\", {})\n if \"num_bits\" in weights:\n bits = weights[\"num_bits\"]\n break\n\n name_upper = repo_id.upper()\n if \"-AWQ\" in name_upper:\n label = f\"AWQ-{bits}bit\"\n return (\"awq\", label)\n elif \"-GPTQ\" in name_upper:\n label = f\"GPTQ-Int{bits}\"\n return (\"gptq\", label)\n\n return _detect_format_from_name(repo_id)\n\n\ndef _detect_format_from_name(repo_id: str) -> tuple[str, str]:\n \"\"\"Fallback: detect format from model name patterns.\"\"\"\n name_upper = repo_id.upper()\n\n if \"-AWQ-8BIT\" in name_upper:\n return (\"awq\", \"AWQ-8bit\")\n if \"-AWQ\" in name_upper:\n return (\"awq\", \"AWQ-4bit\")\n if \"-GPTQ-INT8\" in name_upper or \"-GPTQ-8BIT\" in name_upper:\n return (\"gptq\", \"GPTQ-Int8\")\n if \"-GPTQ\" in name_upper:\n return (\"gptq\", \"GPTQ-Int4\")\n if \"-MLX-\" in name_upper or name_upper.endswith(\"-MLX\"):\n return (\"mlx\", \"Q4_K_M\") # MLX uses its own quant scheme handled elsewhere\n\n return (\"gguf\", \"Q4_K_M\")\n\n\ndef scrape_model(repo_id: str) -> dict | None:\n \"\"\"Scrape a single model and return an LlmModel-compatible dict.\"\"\"\n info = fetch_model_info(repo_id)\n if not info:\n return None\n\n # Extract parameter count from safetensors metadata\n safetensors = info.get(\"safetensors\", {})\n total_params = safetensors.get(\"total\")\n if not total_params:\n params_by_dtype = safetensors.get(\"parameters\", {})\n if params_by_dtype:\n total_params = max(params_by_dtype.values())\n\n if not total_params:\n print(f\" ⚠ No parameter count found for {repo_id}\", file=sys.stderr)\n return None\n\n config = info.get(\"config\", {})\n pipeline_tag = info.get(\"pipeline_tag\")\n\n # Fetch full config.json for accurate context length\n full_config = fetch_config_json(repo_id)\n\n # Detect quantization format from config.json\n model_format, default_quant = detect_quant_format(repo_id, full_config)\n context_length = infer_context_length(full_config) if full_config else infer_context_length(config)\n\n min_ram, rec_ram = estimate_ram(total_params, default_quant)\n min_vram = estimate_vram(total_params, default_quant)\n\n architecture = config.get(\"model_type\", \"unknown\")\n\n # Detect MoE architecture\n moe_info = detect_moe(repo_id, full_config, architecture, total_params)\n\n use_case_str = infer_use_case(repo_id, pipeline_tag, config)\n\n result = {\n \"name\": repo_id,\n \"provider\": extract_provider(repo_id),\n \"parameter_count\": format_param_count(total_params),\n \"parameters_raw\": total_params,\n \"min_ram_gb\": min_ram,\n \"recommended_ram_gb\": rec_ram,\n \"min_vram_gb\": min_vram,\n \"quantization\": default_quant,\n \"format\": model_format,\n \"context_length\": context_length,\n \"use_case\": use_case_str,\n \"capabilities\": infer_capabilities(repo_id, pipeline_tag, use_case_str),\n \"pipeline_tag\": pipeline_tag or \"unknown\",\n \"architecture\": architecture,\n \"hf_downloads\": info.get(\"downloads\", 0),\n \"hf_likes\": info.get(\"likes\", 0),\n \"release_date\": (info.get(\"createdAt\") or \"\")[:10] or None,\n }\n\n # Add MoE fields if detected\n if moe_info[\"is_moe\"]:\n result[\"is_moe\"] = True\n result[\"num_experts\"] = moe_info[\"num_experts\"]\n result[\"active_experts\"] = moe_info[\"active_experts\"]\n result[\"active_parameters\"] = moe_info[\"active_parameters\"]\n\n return result\n\n\n# ---------------------------------------------------------------------------\n# GGUF source enrichment — find pre-quantized GGUF repos for known models\n# ---------------------------------------------------------------------------\n\n# Providers known to publish high-quality GGUF quantizations\nGGUF_PROVIDERS = [\"unsloth\", \"bartowski\", \"ggml-org\", \"TheBloke\", \"mradermacher\"]\n\nGGUF_CACHE_FILE = os.path.join(os.path.dirname(__file__), \"..\", \"data\", \"gguf_sources_cache.json\")\nGGUF_CACHE_MAX_AGE_DAYS = 7 # Re-check repos older than this\n\n\ndef _load_gguf_cache() -> dict:\n \"\"\"Load the GGUF source cache from disk.\n\n Returns dict mapping model repo_id -> {\"sources\": [...], \"checked\": ISO timestamp}\n \"\"\"\n try:\n with open(GGUF_CACHE_FILE) as f:\n return json.load(f)\n except (FileNotFoundError, json.JSONDecodeError):\n return {}\n\n\ndef _save_gguf_cache(cache: dict):\n \"\"\"Save the GGUF source cache to disk.\"\"\"\n os.makedirs(os.path.dirname(GGUF_CACHE_FILE), exist_ok=True)\n with open(GGUF_CACHE_FILE, \"w\") as f:\n json.dump(cache, f, indent=2)\n\n\ndef _cache_entry_fresh(entry: dict) -> bool:\n \"\"\"Check if a cache entry is still valid.\"\"\"\n try:\n from datetime import datetime, timedelta, timezone\n checked = datetime.fromisoformat(entry[\"checked\"])\n return (datetime.now(timezone.utc) - checked) < timedelta(days=GGUF_CACHE_MAX_AGE_DAYS)\n except (KeyError, ValueError):\n return False\n\n\ndef _model_gguf_repo_candidates(repo_id: str) -> list[tuple[str, str]]:\n \"\"\"Generate candidate GGUF repo names for a model.\n\n Returns list of (provider, candidate_repo_id) tuples.\n e.g. for \"meta-llama/Llama-3.1-8B-Instruct\" →\n [(\"unsloth\", \"unsloth/Llama-3.1-8B-Instruct-GGUF\"),\n (\"bartowski\", \"bartowski/Llama-3.1-8B-Instruct-GGUF\")]\n \"\"\"\n model_name = repo_id.split(\"/\")[-1]\n candidates = []\n for provider in GGUF_PROVIDERS:\n candidates.append((provider, f\"{provider}/{model_name}-GGUF\"))\n return candidates\n\n\ndef check_gguf_repo_exists(repo_id: str) -> bool:\n \"\"\"Check if a HuggingFace repo exists and has GGUF files.\"\"\"\n url = f\"{HF_API}/{repo_id}\"\n req = urllib.request.Request(url, headers=_auth_headers())\n try:\n with urllib.request.urlopen(req, timeout=10) as resp:\n info = json.loads(resp.read().decode())\n tags = info.get(\"tags\", [])\n return \"gguf\" in tags\n except Exception:\n return False\n\n\ndef enrich_gguf_sources(models: list[dict]) -> int:\n \"\"\"Add gguf_sources to models by checking GGUF provider repos.\n\n Uses a persistent cache to avoid re-checking repos on every scrape.\n Returns the number of models enriched.\n \"\"\"\n cache = _load_gguf_cache()\n enriched = 0\n cache_hits = 0\n total = len(models)\n from datetime import datetime, timezone\n\n for i, model in enumerate(models, 1):\n repo_id = model[\"name\"]\n\n # Skip non-GGUF models (AWQ/GPTQ don't use GGUF sources)\n if model.get(\"format\", \"gguf\") != \"gguf\":\n continue\n\n # Check cache first\n if repo_id in cache and _cache_entry_fresh(cache[repo_id]):\n sources = cache[repo_id][\"sources\"]\n cache_hits += 1\n else:\n # Query HuggingFace\n candidates = _model_gguf_repo_candidates(repo_id)\n sources = []\n for provider, candidate_repo in candidates:\n print(f\" [{i}/{total}] Checking {candidate_repo}...\", end=\"\")\n if check_gguf_repo_exists(candidate_repo):\n sources.append({\"repo\": candidate_repo, \"provider\": provider})\n print(\" ✓\")\n else:\n print(\" ✗\")\n time.sleep(0.15) # Be polite to the API\n\n # Update cache\n cache[repo_id] = {\n \"sources\": sources,\n \"checked\": datetime.now(timezone.utc).isoformat(),\n }\n\n if sources:\n model[\"gguf_sources\"] = sources\n enriched += 1\n\n _save_gguf_cache(cache)\n print(f\" Cache: {cache_hits} hits, {total - cache_hits} API checks\")\n return enriched\n\n\n# ---------------------------------------------------------------------------\n# Auto-discovery from HuggingFace trending / most-downloaded\n# ---------------------------------------------------------------------------\n\n# Pipeline tags to search for discoverable models\nDISCOVER_PIPELINES = [\"text-generation\", \"text2text-generation\"]\n\n# Orgs to skip — these publish many fine-tunes that clutter the list\nSKIP_ORGS = {\n \"TheBloke\", # GGUF repacks, not original models\n \"unsloth\", # Training framework repacks\n \"mlx-community\", # MLX conversions\n \"bartowski\", # GGUF repacks\n \"mradermacher\", # GGUF repacks\n \"trl-internal-testing\", # Test fixtures\n \"openai-community\", # Legacy model mirrors (gpt2 etc.)\n \"distilbert\", # Distilled legacy models\n}\n\n\ndef discover_trending_models(limit: int = 30, min_downloads: int = 10000) -> list[str]:\n \"\"\"Query HuggingFace API for top text-generation models by download count.\n\n Returns a list of repo IDs (e.g. [\"mistralai/Mistral-7B-v0.1\", ...])\n that are NOT already in TARGET_MODELS.\n \"\"\"\n curated = set(TARGET_MODELS)\n discovered = []\n\n for pipeline in DISCOVER_PIPELINES:\n # Fetch more than we need since we'll filter heavily\n fetch_limit = limit * 5\n url = (\n f\"{HF_API}?\"\n f\"pipeline_tag={pipeline}&\"\n f\"sort=downloads&\"\n f\"direction=-1&\"\n f\"limit={fetch_limit}\"\n )\n req = urllib.request.Request(url, headers=_auth_headers())\n try:\n with urllib.request.urlopen(req, timeout=30) as resp:\n models = json.loads(resp.read().decode())\n except Exception as e:\n print(f\" ⚠ Failed to fetch trending {pipeline} models: {e}\",\n file=sys.stderr)\n continue\n\n for m in models:\n repo_id = m.get(\"id\", \"\")\n if not repo_id or \"/\" not in repo_id:\n continue\n\n # Skip if already curated\n if repo_id in curated:\n continue\n\n # Skip already discovered\n if repo_id in discovered:\n continue\n\n # Skip known repack / converter orgs\n org = repo_id.split(\"/\")[0]\n if org in SKIP_ORGS:\n continue\n\n # Skip models with too few downloads\n downloads = m.get(\"downloads\", 0)\n if downloads < min_downloads:\n continue\n\n # Skip GGUF-only repos, adapters, and merges\n tags = set(m.get(\"tags\", []))\n if tags & {\"gguf\", \"adapter\", \"merge\", \"lora\", \"qlora\"}:\n continue\n\n # Must have safetensors tag (listing API doesn't include param counts,\n # but the safetensors tag means scrape_model() will find params)\n if \"safetensors\" not in tags:\n continue\n\n discovered.append(repo_id)\n if len(discovered) >= limit:\n break\n\n if len(discovered) >= limit:\n break\n\n return discovered[:limit]\n\n\ndef main():\n parser = argparse.ArgumentParser(\n description=\"Scrape LLM model metadata from HuggingFace for llmfit.\"\n )\n parser.add_argument(\n \"--discover\", action=\"store_true\",\n help=\"Auto-discover trending text-generation models from HuggingFace \"\n \"in addition to the curated TARGET_MODELS list.\"\n )\n parser.add_argument(\n \"-n\", \"--discover-limit\", type=int, default=30,\n help=\"Max number of trending models to discover (default: 30). \"\n \"Duplicates of curated models are skipped automatically.\"\n )\n parser.add_argument(\n \"--min-downloads\", type=int, default=10000,\n help=\"Minimum download count for discovered models (default: 10000).\"\n )\n parser.add_argument(\n \"--gguf-sources\", action=\"store_true\", default=True,\n help=\"Enrich models with known GGUF download sources from \"\n \"providers like unsloth and bartowski on HuggingFace (default: enabled).\"\n )\n parser.add_argument(\n \"--no-gguf-sources\", action=\"store_false\", dest=\"gguf_sources\",\n help=\"Skip GGUF download source enrichment (faster scrape).\"\n )\n parser.add_argument(\n \"--token\", type=str, default=None,\n help=\"HuggingFace API token for accessing gated models. \"\n \"Can also be set via HF_TOKEN or HUGGING_FACE_HUB_TOKEN env var.\"\n )\n args = parser.parse_args()\n\n # Resolve auth token: CLI flag > HF_TOKEN > HUGGING_FACE_HUB_TOKEN\n global _hf_token\n _hf_token = (\n args.token\n or os.environ.get(\"HF_TOKEN\")\n or os.environ.get(\"HUGGING_FACE_HUB_TOKEN\")\n )\n if _hf_token:\n print(f\"🔑 Authenticated with HuggingFace token ({_hf_token[:4]}...{_hf_token[-4:]})\")\n else:\n print(\"ℹ No HF token set. Gated models will use fallback data.\")\n print(\" Set HF_TOKEN env var or pass --token to access gated models.\\n\")\n\n # Fallback entries for gated/auth-required models where the API\n # doesn't return safetensors metadata without a token.\n FALLBACKS = [\n {\n \"name\": \"meta-llama/Llama-3.3-70B-Instruct\",\n \"provider\": \"Meta\", \"parameter_count\": \"70.6B\",\n \"parameters_raw\": 70_553_706_496,\n \"min_ram_gb\": 39.4, \"recommended_ram_gb\": 65.7, \"min_vram_gb\": 36.1,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"llama\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"mistralai/Mistral-Small-24B-Instruct-2501\",\n \"provider\": \"Mistral AI\", \"parameter_count\": \"24B\",\n \"parameters_raw\": 24_000_000_000,\n \"min_ram_gb\": 13.4, \"recommended_ram_gb\": 22.4, \"min_vram_gb\": 12.3,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"mistral\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"Qwen/Qwen2.5-14B-Instruct\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"14.8B\",\n \"parameters_raw\": 14_770_000_000,\n \"min_ram_gb\": 8.2, \"recommended_ram_gb\": 13.7, \"min_vram_gb\": 7.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"qwen2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"Qwen/Qwen2.5-32B-Instruct\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"32.5B\",\n \"parameters_raw\": 32_510_000_000,\n \"min_ram_gb\": 18.2, \"recommended_ram_gb\": 30.3, \"min_vram_gb\": 16.7,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"qwen2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"microsoft/phi-3-mini-4k-instruct\",\n \"provider\": \"Microsoft\", \"parameter_count\": \"3.8B\",\n \"parameters_raw\": 3_821_000_000,\n \"min_ram_gb\": 2.1, \"recommended_ram_gb\": 3.6, \"min_vram_gb\": 2.0,\n \"quantization\": \"Q4_K_M\", \"context_length\": 4096,\n \"use_case\": \"Lightweight, edge deployment\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"phi3\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"microsoft/phi-4\",\n \"provider\": \"Microsoft\", \"parameter_count\": \"14B\",\n \"parameters_raw\": 14_000_000_000,\n \"min_ram_gb\": 7.8, \"recommended_ram_gb\": 13.0, \"min_vram_gb\": 7.2,\n \"quantization\": \"Q4_K_M\", \"context_length\": 16384,\n \"use_case\": \"Reasoning, STEM, code generation\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"phi\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"google/gemma-3-12b-it\",\n \"provider\": \"Google\", \"parameter_count\": \"12B\",\n \"parameters_raw\": 12_000_000_000,\n \"min_ram_gb\": 6.7, \"recommended_ram_gb\": 11.2, \"min_vram_gb\": 6.1,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Multimodal, vision and text\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"gemma3\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"deepseek-ai/DeepSeek-V3\",\n \"provider\": \"DeepSeek\", \"parameter_count\": \"685B\",\n \"parameters_raw\": 685_000_000_000,\n \"min_ram_gb\": 382.8, \"recommended_ram_gb\": 638.0, \"min_vram_gb\": 351.3,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"State-of-the-art, MoE architecture\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"deepseek_v3\",\n \"is_moe\": True, \"num_experts\": 256, \"active_experts\": 8,\n \"active_parameters\": 37_000_000_000,\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"CohereForAI/c4ai-command-r-v01\",\n \"provider\": \"Cohere\", \"parameter_count\": \"35B\",\n \"parameters_raw\": 35_000_000_000,\n \"min_ram_gb\": 19.5, \"recommended_ram_gb\": 32.6, \"min_vram_gb\": 17.9,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"RAG, tool use, agents\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"cohere\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"bigcode/starcoder2-15b\",\n \"provider\": \"BigCode\", \"parameter_count\": \"15.7B\",\n \"parameters_raw\": 15_700_000_000,\n \"min_ram_gb\": 8.8, \"recommended_ram_gb\": 14.6, \"min_vram_gb\": 8.0,\n \"quantization\": \"Q4_K_M\", \"context_length\": 16384,\n \"use_case\": \"Code generation and completion\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"starcoder2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"nomic-ai/nomic-embed-text-v1.5\",\n \"provider\": \"Nomic\", \"parameter_count\": \"137M\",\n \"parameters_raw\": 137_000_000,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.5,\n \"quantization\": \"F16\", \"context_length\": 8192,\n \"use_case\": \"Text embeddings for RAG\",\n \"pipeline_tag\": \"feature-extraction\", \"architecture\": \"nomic_bert\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct\",\n \"provider\": \"DeepSeek\", \"parameter_count\": \"16B\",\n \"parameters_raw\": 15_700_000_000,\n \"min_ram_gb\": 8.8, \"recommended_ram_gb\": 14.6, \"min_vram_gb\": 8.0,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Code generation and completion\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"deepseek_v2\",\n \"is_moe\": True, \"num_experts\": 64, \"active_experts\": 6,\n \"active_parameters\": 2_400_000_000,\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"microsoft/Phi-3-medium-14b-instruct\",\n \"provider\": \"Microsoft\", \"parameter_count\": \"14B\",\n \"parameters_raw\": 14_000_000_000,\n \"min_ram_gb\": 7.8, \"recommended_ram_gb\": 13.0, \"min_vram_gb\": 7.2,\n \"quantization\": \"Q4_K_M\", \"context_length\": 4096,\n \"use_case\": \"Balanced performance and size\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"phi3\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n # NEW FALLBACKS for popular models\n {\n \"name\": \"google/gemma-2-2b-it\",\n \"provider\": \"Google\", \"parameter_count\": \"2.6B\",\n \"parameters_raw\": 2614341376,\n \"min_ram_gb\": 1.5, \"recommended_ram_gb\": 2.4, \"min_vram_gb\": 1.3,\n \"quantization\": \"Q4_K_M\", \"context_length\": 8192,\n \"use_case\": \"Lightweight, edge deployment\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"gemma2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"meta-llama/CodeLlama-7b-Instruct-hf\",\n \"provider\": \"Meta\", \"parameter_count\": \"7.0B\",\n \"parameters_raw\": 7016400896,\n \"min_ram_gb\": 3.9, \"recommended_ram_gb\": 6.5, \"min_vram_gb\": 3.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 16384,\n \"use_case\": \"Code generation and completion\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"llama\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"meta-llama/CodeLlama-13b-Instruct-hf\",\n \"provider\": \"Meta\", \"parameter_count\": \"13.0B\",\n \"parameters_raw\": 13015864320,\n \"min_ram_gb\": 7.3, \"recommended_ram_gb\": 12.1, \"min_vram_gb\": 6.7,\n \"quantization\": \"Q4_K_M\", \"context_length\": 16384,\n \"use_case\": \"Code generation and completion\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"llama\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"meta-llama/CodeLlama-34b-Instruct-hf\",\n \"provider\": \"Meta\", \"parameter_count\": \"34.0B\",\n \"parameters_raw\": 34018971648,\n \"min_ram_gb\": 19.0, \"recommended_ram_gb\": 31.7, \"min_vram_gb\": 17.4,\n \"quantization\": \"Q4_K_M\", \"context_length\": 16384,\n \"use_case\": \"Code generation and completion\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"llama\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"meta-llama/Llama-3.2-11B-Vision-Instruct\",\n \"provider\": \"Meta\", \"parameter_count\": \"11.0B\",\n \"parameters_raw\": 10665463808,\n \"min_ram_gb\": 6.0, \"recommended_ram_gb\": 9.9, \"min_vram_gb\": 5.5,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Multimodal, vision and text\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"llama\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"mistralai/Ministral-8B-Instruct-2410\",\n \"provider\": \"Mistral AI\", \"parameter_count\": \"8.0B\",\n \"parameters_raw\": 8030261248,\n \"min_ram_gb\": 4.5, \"recommended_ram_gb\": 7.5, \"min_vram_gb\": 4.1,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"mistral\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"mistralai/Mistral-Nemo-Instruct-2407\",\n \"provider\": \"Mistral AI\", \"parameter_count\": \"12.2B\",\n \"parameters_raw\": 12247076864,\n \"min_ram_gb\": 6.8, \"recommended_ram_gb\": 11.4, \"min_vram_gb\": 6.3,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"mistral\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"microsoft/Phi-3.5-mini-instruct\",\n \"provider\": \"Microsoft\", \"parameter_count\": \"3.8B\",\n \"parameters_raw\": 3821000000,\n \"min_ram_gb\": 2.1, \"recommended_ram_gb\": 3.6, \"min_vram_gb\": 2.0,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Lightweight, long context\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"phi3\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"microsoft/Orca-2-7b\",\n \"provider\": \"Microsoft\", \"parameter_count\": \"7.0B\",\n \"parameters_raw\": 7016400896,\n \"min_ram_gb\": 3.9, \"recommended_ram_gb\": 6.5, \"min_vram_gb\": 3.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 4096,\n \"use_case\": \"Reasoning, step-by-step solutions\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"llama\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"microsoft/Orca-2-13b\",\n \"provider\": \"Microsoft\", \"parameter_count\": \"13.0B\",\n \"parameters_raw\": 13015864320,\n \"min_ram_gb\": 7.3, \"recommended_ram_gb\": 12.1, \"min_vram_gb\": 6.7,\n \"quantization\": \"Q4_K_M\", \"context_length\": 4096,\n \"use_case\": \"Reasoning, step-by-step solutions\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"llama\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"01-ai/Yi-6B-Chat\",\n \"provider\": \"01.ai\", \"parameter_count\": \"6.1B\",\n \"parameters_raw\": 6061356032,\n \"min_ram_gb\": 3.4, \"recommended_ram_gb\": 5.6, \"min_vram_gb\": 3.1,\n \"quantization\": \"Q4_K_M\", \"context_length\": 4096,\n \"use_case\": \"Multilingual, Chinese/English chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"yi\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"01-ai/Yi-34B-Chat\",\n \"provider\": \"01.ai\", \"parameter_count\": \"34.4B\",\n \"parameters_raw\": 34386780160,\n \"min_ram_gb\": 19.2, \"recommended_ram_gb\": 32.0, \"min_vram_gb\": 17.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 4096,\n \"use_case\": \"Multilingual, Chinese/English chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"yi\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"upstage/SOLAR-10.7B-Instruct-v1.0\",\n \"provider\": \"Upstage\", \"parameter_count\": \"10.7B\",\n \"parameters_raw\": 10700000000,\n \"min_ram_gb\": 6.0, \"recommended_ram_gb\": 10.0, \"min_vram_gb\": 5.5,\n \"quantization\": \"Q4_K_M\", \"context_length\": 4096,\n \"use_case\": \"High-performance instruction following\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"llama\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"tiiuae/falcon-7b-instruct\",\n \"provider\": \"TII\", \"parameter_count\": \"7.0B\",\n \"parameters_raw\": 7000000000,\n \"min_ram_gb\": 3.9, \"recommended_ram_gb\": 6.5, \"min_vram_gb\": 3.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 2048,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"falcon\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"tiiuae/falcon-40b-instruct\",\n \"provider\": \"TII\", \"parameter_count\": \"40.0B\",\n \"parameters_raw\": 40000000000,\n \"min_ram_gb\": 22.4, \"recommended_ram_gb\": 37.3, \"min_vram_gb\": 20.5,\n \"quantization\": \"Q4_K_M\", \"context_length\": 2048,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"falcon\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"HuggingFaceH4/zephyr-7b-beta\",\n \"provider\": \"HuggingFace\", \"parameter_count\": \"7.2B\",\n \"parameters_raw\": 7241732096,\n \"min_ram_gb\": 4.0, \"recommended_ram_gb\": 6.7, \"min_vram_gb\": 3.7,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"mistral\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"openchat/openchat-3.5-0106\",\n \"provider\": \"OpenChat\", \"parameter_count\": \"7.0B\",\n \"parameters_raw\": 7000000000,\n \"min_ram_gb\": 3.9, \"recommended_ram_gb\": 6.5, \"min_vram_gb\": 3.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 8192,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"mistral\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"lmsys/vicuna-7b-v1.5\",\n \"provider\": \"LMSYS\", \"parameter_count\": \"7.0B\",\n \"parameters_raw\": 6738415616,\n \"min_ram_gb\": 3.8, \"recommended_ram_gb\": 6.3, \"min_vram_gb\": 3.4,\n \"quantization\": \"Q4_K_M\", \"context_length\": 4096,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"llama\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"lmsys/vicuna-13b-v1.5\",\n \"provider\": \"LMSYS\", \"parameter_count\": \"13.0B\",\n \"parameters_raw\": 13015864320,\n \"min_ram_gb\": 7.3, \"recommended_ram_gb\": 12.1, \"min_vram_gb\": 6.7,\n \"quantization\": \"Q4_K_M\", \"context_length\": 4096,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"llama\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO\",\n \"provider\": \"NousResearch\", \"parameter_count\": \"46.7B\",\n \"parameters_raw\": 46702792704,\n \"min_ram_gb\": 26.1, \"recommended_ram_gb\": 43.5, \"min_vram_gb\": 23.9,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"mixtral\",\n \"is_moe\": True, \"num_experts\": 8, \"active_experts\": 2,\n \"active_parameters\": 12900000000,\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"WizardLMTeam/WizardLM-13B-V1.2\",\n \"provider\": \"WizardLM\", \"parameter_count\": \"13.0B\",\n \"parameters_raw\": 13015864320,\n \"min_ram_gb\": 7.3, \"recommended_ram_gb\": 12.1, \"min_vram_gb\": 6.7,\n \"quantization\": \"Q4_K_M\", \"context_length\": 4096,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"llama\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"WizardLMTeam/WizardCoder-15B-V1.0\",\n \"provider\": \"WizardLM\", \"parameter_count\": \"15.5B\",\n \"parameters_raw\": 15515334656,\n \"min_ram_gb\": 8.7, \"recommended_ram_gb\": 14.5, \"min_vram_gb\": 7.9,\n \"quantization\": \"Q4_K_M\", \"context_length\": 8192,\n \"use_case\": \"Code generation and completion\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"starcoder\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"Qwen/Qwen2.5-Coder-1.5B-Instruct\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"1.5B\",\n \"parameters_raw\": 1539938304,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.8,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Code generation and completion\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"qwen2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"Qwen/Qwen2.5-Coder-7B-Instruct\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"7.6B\",\n \"parameters_raw\": 7615616000,\n \"min_ram_gb\": 4.3, \"recommended_ram_gb\": 7.1, \"min_vram_gb\": 3.9,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Code generation and completion\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"qwen2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"Qwen/Qwen2.5-Coder-14B-Instruct\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"14.7B\",\n \"parameters_raw\": 14770000000,\n \"min_ram_gb\": 8.2, \"recommended_ram_gb\": 13.7, \"min_vram_gb\": 7.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Code generation and completion\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"qwen2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"Qwen/Qwen2.5-Coder-32B-Instruct\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"32.5B\",\n \"parameters_raw\": 32510000000,\n \"min_ram_gb\": 18.2, \"recommended_ram_gb\": 30.3, \"min_vram_gb\": 16.7,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Code generation and completion\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"qwen2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"Qwen/Qwen2.5-VL-3B-Instruct\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"3.8B\",\n \"parameters_raw\": 3821000000,\n \"min_ram_gb\": 2.1, \"recommended_ram_gb\": 3.6, \"min_vram_gb\": 2.0,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Multimodal, vision and text\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"qwen2_vl\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"Qwen/Qwen2.5-VL-7B-Instruct\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"8.3B\",\n \"parameters_raw\": 8290000000,\n \"min_ram_gb\": 4.6, \"recommended_ram_gb\": 7.7, \"min_vram_gb\": 4.2,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Multimodal, vision and text\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"qwen2_vl\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"Qwen/Qwen3-14B\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"14.8B\",\n \"parameters_raw\": 14770000000,\n \"min_ram_gb\": 8.2, \"recommended_ram_gb\": 13.7, \"min_vram_gb\": 7.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"General purpose text generation\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"qwen3\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n # --- New fallbacks added Feb 2026 ---\n {\n \"name\": \"deepseek-ai/DeepSeek-V3.2\",\n \"provider\": \"DeepSeek\", \"parameter_count\": \"685B\",\n \"parameters_raw\": 685000000000,\n \"min_ram_gb\": 383.2, \"recommended_ram_gb\": 638.7, \"min_vram_gb\": 351.3,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"State-of-the-art, MoE architecture\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"deepseek_v3\",\n \"is_moe\": True, \"num_experts\": 256, \"active_experts\": 8,\n \"active_parameters\": 37000000000,\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-12-01\",\n },\n {\n \"name\": \"deepseek-ai/DeepSeek-V3.2-Speciale\",\n \"provider\": \"DeepSeek\", \"parameter_count\": \"685B\",\n \"parameters_raw\": 685000000000,\n \"min_ram_gb\": 383.2, \"recommended_ram_gb\": 638.7, \"min_vram_gb\": 351.3,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Advanced reasoning, chain-of-thought\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"deepseek_v3\",\n \"is_moe\": True, \"num_experts\": 256, \"active_experts\": 8,\n \"active_parameters\": 37000000000,\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-12-01\",\n },\n {\n \"name\": \"zai-org/GLM-5\",\n \"provider\": \"Zhipu AI\", \"parameter_count\": \"744B\",\n \"parameters_raw\": 744000000000,\n \"min_ram_gb\": 416.2, \"recommended_ram_gb\": 693.6, \"min_vram_gb\": 381.4,\n \"quantization\": \"Q4_K_M\", \"context_length\": 200000,\n \"use_case\": \"State-of-the-art, MoE architecture\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"glm\",\n \"is_moe\": True, \"num_experts\": 256, \"active_experts\": 8,\n \"active_parameters\": 40000000000,\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2026-02-11\",\n },\n {\n \"name\": \"moonshotai/Kimi-K2.5\",\n \"provider\": \"Moonshot\", \"parameter_count\": \"171B\",\n \"parameters_raw\": 171000000000,\n \"min_ram_gb\": 95.6, \"recommended_ram_gb\": 159.4, \"min_vram_gb\": 87.7,\n \"quantization\": \"Q4_K_M\", \"context_length\": 262144,\n \"use_case\": \"Multimodal, vision and text\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"kimi\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2026-01-26\",\n },\n {\n \"name\": \"MiniMaxAI/MiniMax-M2.5\",\n \"provider\": \"MiniMax\", \"parameter_count\": \"230B\",\n \"parameters_raw\": 230000000000,\n \"min_ram_gb\": 128.6, \"recommended_ram_gb\": 214.4, \"min_vram_gb\": 117.9,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Coding, agentic tool use\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"minimax\",\n \"is_moe\": True, \"num_experts\": 32, \"active_experts\": 2,\n \"active_parameters\": 10000000000,\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2026-02-11\",\n },\n {\n \"name\": \"XiaomiMiMo/MiMo-V2-Flash\",\n \"provider\": \"Xiaomi\", \"parameter_count\": \"309B\",\n \"parameters_raw\": 309000000000,\n \"min_ram_gb\": 172.8, \"recommended_ram_gb\": 288.0, \"min_vram_gb\": 158.4,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Efficient reasoning, coding\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"mimo\",\n \"is_moe\": True, \"num_experts\": 128, \"active_experts\": 8,\n \"active_parameters\": 15000000000,\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-12-01\",\n },\n {\n \"name\": \"XiaomiMiMo/MiMo-7B-RL\",\n \"provider\": \"Xiaomi\", \"parameter_count\": \"7.0B\",\n \"parameters_raw\": 7000000000,\n \"min_ram_gb\": 3.9, \"recommended_ram_gb\": 6.5, \"min_vram_gb\": 3.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Advanced reasoning, math and code\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"mimo\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-05-01\",\n },\n {\n \"name\": \"nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16\",\n \"provider\": \"NVIDIA\", \"parameter_count\": \"30B\",\n \"parameters_raw\": 30000000000,\n \"min_ram_gb\": 16.8, \"recommended_ram_gb\": 28.0, \"min_vram_gb\": 15.4,\n \"quantization\": \"Q4_K_M\", \"context_length\": 1048576,\n \"use_case\": \"Efficient MoE, agentic tasks\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"nemotron\",\n \"is_moe\": True, \"num_experts\": 128, \"active_experts\": 6,\n \"active_parameters\": 3000000000,\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-06-01\",\n },\n {\n \"name\": \"nvidia/NVIDIA-Nemotron-Nano-9B-v2\",\n \"provider\": \"NVIDIA\", \"parameter_count\": \"9B\",\n \"parameters_raw\": 9000000000,\n \"min_ram_gb\": 5.0, \"recommended_ram_gb\": 8.4, \"min_vram_gb\": 4.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Hybrid Mamba2, reasoning\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"nemotron\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-06-01\",\n },\n {\n \"name\": \"microsoft/Phi-4-reasoning\",\n \"provider\": \"Microsoft\", \"parameter_count\": \"14B\",\n \"parameters_raw\": 14000000000,\n \"min_ram_gb\": 7.8, \"recommended_ram_gb\": 13.0, \"min_vram_gb\": 7.2,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Advanced reasoning, math and code\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"phi4\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-04-01\",\n },\n {\n \"name\": \"microsoft/Phi-4-mini-reasoning\",\n \"provider\": \"Microsoft\", \"parameter_count\": \"3.8B\",\n \"parameters_raw\": 3800000000,\n \"min_ram_gb\": 2.1, \"recommended_ram_gb\": 3.5, \"min_vram_gb\": 1.9,\n \"quantization\": \"Q4_K_M\", \"context_length\": 16384,\n \"use_case\": \"Lightweight reasoning\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"phi4\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-04-01\",\n },\n {\n \"name\": \"microsoft/Phi-4-multimodal-instruct\",\n \"provider\": \"Microsoft\", \"parameter_count\": \"14B\",\n \"parameters_raw\": 14000000000,\n \"min_ram_gb\": 7.8, \"recommended_ram_gb\": 13.0, \"min_vram_gb\": 7.2,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Multimodal, vision and audio\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"phi4\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-04-01\",\n },\n {\n \"name\": \"LGAI-EXAONE/EXAONE-4.0-32B\",\n \"provider\": \"LG AI\", \"parameter_count\": \"32B\",\n \"parameters_raw\": 32000000000,\n \"min_ram_gb\": 17.9, \"recommended_ram_gb\": 29.8, \"min_vram_gb\": 16.4,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Hybrid reasoning, multilingual\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"exaone\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-07-15\",\n },\n {\n \"name\": \"LGAI-EXAONE/EXAONE-4.0-1.2B\",\n \"provider\": \"LG AI\", \"parameter_count\": \"1.2B\",\n \"parameters_raw\": 1200000000,\n \"min_ram_gb\": 0.7, \"recommended_ram_gb\": 1.1, \"min_vram_gb\": 0.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Lightweight, on-device\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"exaone\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-07-15\",\n },\n {\n \"name\": \"HuggingFaceTB/SmolLM3-3B\",\n \"provider\": \"HuggingFace\", \"parameter_count\": \"3B\",\n \"parameters_raw\": 3000000000,\n \"min_ram_gb\": 1.7, \"recommended_ram_gb\": 2.8, \"min_vram_gb\": 1.5,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Lightweight, multilingual reasoning\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"smollm\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-07-08\",\n },\n {\n \"name\": \"google/gemma-3n-E4B-it\",\n \"provider\": \"Google\", \"parameter_count\": \"8B\",\n \"parameters_raw\": 8000000000,\n \"min_ram_gb\": 4.5, \"recommended_ram_gb\": 7.5, \"min_vram_gb\": 4.1,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Multimodal, on-device (effective 4B)\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"gemma3n\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-06-25\",\n },\n {\n \"name\": \"google/gemma-3n-E2B-it\",\n \"provider\": \"Google\", \"parameter_count\": \"4B\",\n \"parameters_raw\": 4000000000,\n \"min_ram_gb\": 2.2, \"recommended_ram_gb\": 3.7, \"min_vram_gb\": 2.1,\n \"quantization\": \"Q4_K_M\", \"context_length\": 131072,\n \"use_case\": \"Multimodal, on-device (effective 2B)\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"gemma3n\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-06-25\",\n },\n # Qwen3-Coder-Next (80B MoE, 3B active, Jan 2026)\n {\n \"name\": \"Qwen/Qwen3-Coder-Next\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"80B\",\n \"parameters_raw\": 80000000000,\n \"min_ram_gb\": 44.8, \"recommended_ram_gb\": 74.6, \"min_vram_gb\": 41.0,\n \"quantization\": \"Q4_K_M\", \"context_length\": 262144,\n \"use_case\": \"Code generation, agentic coding\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"qwen3_next\",\n \"is_moe\": True, \"num_experts\": 64, \"active_experts\": 4,\n \"active_parameters\": 3000000000,\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2026-01-30\",\n },\n {\n \"name\": \"Qwen/Qwen3.5-27B\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"27.8B\",\n \"parameters_raw\": 27781427952,\n \"min_ram_gb\": 15.5, \"recommended_ram_gb\": 25.9, \"min_vram_gb\": 14.2,\n \"quantization\": \"Q4_K_M\", \"context_length\": 262144,\n \"use_case\": \"Multimodal, vision and text\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"qwen3_5\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n },\n {\n \"name\": \"Qwen/Qwen3.5-35B-A3B\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"36.0B\",\n \"parameters_raw\": 35951822704,\n \"min_ram_gb\": 20.1, \"recommended_ram_gb\": 33.5, \"min_vram_gb\": 18.4,\n \"quantization\": \"Q4_K_M\", \"context_length\": 262144,\n \"use_case\": \"Multimodal, vision and text\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"qwen3_5_moe\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n \"is_moe\": True, \"num_experts\": 256, \"active_experts\": 8,\n \"active_parameters\": 3_000_000_000,\n },\n {\n \"name\": \"Qwen/Qwen3.5-122B-A10B\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"125.1B\",\n \"parameters_raw\": 125086497008,\n \"min_ram_gb\": 69.9, \"recommended_ram_gb\": 116.5, \"min_vram_gb\": 64.1,\n \"quantization\": \"Q4_K_M\", \"context_length\": 262144,\n \"use_case\": \"Multimodal, vision and text\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"qwen3_5_moe\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n \"is_moe\": True, \"num_experts\": 256, \"active_experts\": 8,\n \"active_parameters\": 10_000_000_000,\n },\n {\n \"name\": \"Qwen/Qwen3.5-397B-A17B\",\n \"provider\": \"Alibaba\", \"parameter_count\": \"403.4B\",\n \"parameters_raw\": 403397928944,\n \"min_ram_gb\": 225.4, \"recommended_ram_gb\": 375.7, \"min_vram_gb\": 206.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 262144,\n \"use_case\": \"Multimodal, vision and text\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"qwen3_5_moe\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": None,\n \"is_moe\": True, \"num_experts\": 256, \"active_experts\": 8,\n \"active_parameters\": 17_000_000_000,\n },\n # Liquid AI LFM2 dense models\n {\n \"name\": \"LiquidAI/LFM2-350M\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"354M\",\n \"parameters_raw\": 354483968,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.5,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Lightweight, edge deployment\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-700M\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"742M\",\n \"parameters_raw\": 742489344,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.5,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Lightweight, edge deployment\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-1.2B\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"1.2B\",\n \"parameters_raw\": 1170340608,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"General purpose text generation\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-2.6B\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"2.6B\",\n \"parameters_raw\": 2569272320,\n \"min_ram_gb\": 1.4, \"recommended_ram_gb\": 2.4, \"min_vram_gb\": 1.3,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"General purpose text generation\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-2.6B-Exp\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"2.6B\",\n \"parameters_raw\": 2569272320,\n \"min_ram_gb\": 1.4, \"recommended_ram_gb\": 2.4, \"min_vram_gb\": 1.3,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Instruction following, math, knowledge\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n # Liquid AI LFM2 MoE models\n {\n \"name\": \"LiquidAI/LFM2-8B-A1B\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"8.3B\",\n \"parameters_raw\": 8300000000,\n \"min_ram_gb\": 4.6, \"recommended_ram_gb\": 7.7, \"min_vram_gb\": 4.3,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"General purpose, edge MoE\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"is_moe\": True, \"num_experts\": 32, \"active_experts\": 4,\n \"active_parameters\": 1500000000,\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-24B-A2B\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"23.8B\",\n \"parameters_raw\": 23_843_661_440,\n \"min_ram_gb\": 13.3, \"recommended_ram_gb\": 22.2, \"min_vram_gb\": 12.2,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Agentic tasks, RAG, summarization\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"is_moe\": True, \"num_experts\": 32, \"active_experts\": 4,\n \"active_parameters\": 2300000000,\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n # Liquid AI LFM2.5 models\n {\n \"name\": \"LiquidAI/LFM2.5-1.2B-Base\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"1.2B\",\n \"parameters_raw\": 1170340608,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"General purpose text generation\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2.5-1.2B-Instruct\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"1.2B\",\n \"parameters_raw\": 1170340608,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Instruction following, chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2.5-1.2B-Thinking\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"1.2B\",\n \"parameters_raw\": 1170340608,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Advanced reasoning, chain-of-thought\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2.5-1.2B-JP\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"1.2B\",\n \"parameters_raw\": 1170340608,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Japanese language, multilingual chat\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n # Liquid AI LFM2 Vision-Language models\n {\n \"name\": \"LiquidAI/LFM2-VL-450M\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"451M\",\n \"parameters_raw\": 450822656,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.5,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Multimodal, vision and text\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-VL-1.6B\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"1.6B\",\n \"parameters_raw\": 1584804000,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.8,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Multimodal, vision and text\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-VL-3B\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"3.0B\",\n \"parameters_raw\": 2998975216,\n \"min_ram_gb\": 1.7, \"recommended_ram_gb\": 2.8, \"min_vram_gb\": 1.5,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Multimodal, vision and text\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2.5-VL-1.6B\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"1.6B\",\n \"parameters_raw\": 1596625904,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.8,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Multimodal, vision and text\",\n \"pipeline_tag\": \"image-text-to-text\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n # Liquid AI LFM2 Audio models\n {\n \"name\": \"LiquidAI/LFM2-Audio-1.5B\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"1.5B\",\n \"parameters_raw\": 1500000000,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.8,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Speech-to-speech, ASR, TTS\",\n \"pipeline_tag\": \"audio-to-audio\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2.5-Audio-1.5B\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"1.5B\",\n \"parameters_raw\": 1500000000,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.8,\n \"quantization\": \"Q4_K_M\", \"context_length\": 32768,\n \"use_case\": \"Speech-to-speech, ASR, TTS\",\n \"pipeline_tag\": \"audio-to-audio\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n # Liquid AI Liquid Nanos (task-specific fine-tunes)\n {\n \"name\": \"LiquidAI/LFM2-1.2B-Tool\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"1.2B\",\n \"parameters_raw\": 1170340608,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Tool calling, function calling\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-1.2B-RAG\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"1.2B\",\n \"parameters_raw\": 1170340608,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Retrieval-augmented generation\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-1.2B-Extract\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"1.2B\",\n \"parameters_raw\": 1170340608,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.6,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Data extraction, structured output\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-350M-Extract\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"354M\",\n \"parameters_raw\": 354483968,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.5,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Data extraction, structured output\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-350M-Math\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"354M\",\n \"parameters_raw\": 354483968,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.5,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Math reasoning, chain-of-thought\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-350M-ENJP-MT\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"354M\",\n \"parameters_raw\": 354483968,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.5,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"English-Japanese translation\",\n \"pipeline_tag\": \"translation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-350M-PII-Extract-JP\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"354M\",\n \"parameters_raw\": 354483968,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.5,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"PII extraction, Japanese\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-ColBERT-350M\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"353M\",\n \"parameters_raw\": 353322752,\n \"min_ram_gb\": 1.0, \"recommended_ram_gb\": 2.0, \"min_vram_gb\": 0.5,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Semantic search, sentence similarity\",\n \"pipeline_tag\": \"sentence-similarity\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n {\n \"name\": \"LiquidAI/LFM2-2.6B-Transcript\",\n \"provider\": \"Liquid AI\", \"parameter_count\": \"2.6B\",\n \"parameters_raw\": 2569272320,\n \"min_ram_gb\": 1.4, \"recommended_ram_gb\": 2.4, \"min_vram_gb\": 1.3,\n \"quantization\": \"Q4_K_M\", \"context_length\": 128000,\n \"use_case\": \"Meeting transcription, summarization\",\n \"pipeline_tag\": \"text-generation\", \"architecture\": \"lfm2\",\n \"hf_downloads\": 0, \"hf_likes\": 0, \"release_date\": \"2025-11-28\",\n },\n ]\n\n print(f\"Scraping {len(TARGET_MODELS)} curated models from HuggingFace...\\n\")\n\n results = []\n scraped_names = set()\n for i, repo_id in enumerate(TARGET_MODELS, 1):\n print(f\"[{i}/{len(TARGET_MODELS)}] {repo_id}...\")\n model = scrape_model(repo_id)\n if model:\n print(f\" ✓ {model['parameter_count']} params, \"\n f\"min {model['min_ram_gb']} GB RAM, \"\n f\"ctx {model['context_length']}\")\n results.append(model)\n scraped_names.add(repo_id)\n # Be polite to the API\n time.sleep(0.3)\n\n # Fill in fallbacks for models that couldn't be scraped\n fallback_count = 0\n for fb in FALLBACKS:\n if fb[\"name\"] not in scraped_names:\n print(f\" + Fallback: {fb['name']} ({fb['parameter_count']})\")\n results.append(fb)\n scraped_names.add(fb[\"name\"])\n fallback_count += 1\n\n # Auto-discover trending models if --discover flag is set\n discovered_count = 0\n if args.discover:\n print(f\"\\nDiscovering trending models (limit={args.discover_limit}, \"\n f\"min_downloads={args.min_downloads})...\")\n trending = discover_trending_models(\n limit=args.discover_limit,\n min_downloads=args.min_downloads,\n )\n print(f\" Found {len(trending)} new models not in curated list\\n\")\n\n for i, repo_id in enumerate(trending, 1):\n if repo_id in scraped_names:\n continue\n print(f\"[discover {i}/{len(trending)}] {repo_id}...\")\n model = scrape_model(repo_id)\n if model:\n model[\"_discovered\"] = True # mark as auto-discovered\n print(f\" ✓ {model['parameter_count']} params, \"\n f\"{model['hf_downloads']:,} downloads, \"\n f\"ctx {model['context_length']}\")\n results.append(model)\n scraped_names.add(repo_id)\n discovered_count += 1\n time.sleep(0.3)\n\n # Sort by parameter count\n results.sort(key=lambda m: m[\"parameters_raw\"])\n\n # Enrich with GGUF download sources if requested\n gguf_enriched = 0\n if args.gguf_sources:\n print(f\"\\nEnriching {len(results)} models with GGUF download sources...\")\n gguf_enriched = enrich_gguf_sources(results)\n print(f\" Found GGUF sources for {gguf_enriched} models\")\n\n # Write to both locations: repo root (for reference) and llmfit-core (compiled into binary)\n output_paths = [\"data/hf_models.json\", \"llmfit-core/data/hf_models.json\"]\n for output_path in output_paths:\n os.makedirs(os.path.dirname(output_path), exist_ok=True)\n with open(output_path, \"w\") as f:\n json.dump(results, f, indent=2)\n\n print(f\"\\n✅ Wrote {len(results)} models to {', '.join(output_paths)}\")\n print(f\" Curated: {len(TARGET_MODELS)}, Fallbacks: {fallback_count}, \"\n f\"Discovered: {discovered_count}, GGUF-sourced: {gguf_enriched}\")\n\n # Print summary table\n print(f\"\\n{'Model':<50} {'Params':>8} {'Min RAM':>8} {'Rec RAM':>8} {'VRAM':>6}\")\n print(\"─\" * 84)\n for m in results:\n print(f\"{m['name']:<50} {m['parameter_count']:>8} \"\n f\"{m['min_ram_gb']:>7.1f}G {m['recommended_ram_gb']:>7.1f}G \"\n f\"{m['min_vram_gb']:>5.1f}G\")\n\n\nif __name__ == \"__main__\":\n main()\n"}}}}