from huggingface_hub import HfApi
import sys

api = HfApi()

def search_gguf(query):
    print(f"\n--- Searching for: {query} ---")
    try:
        models = api.list_models(search=query, limit=3)
        found = list(models)
        if not found:
            print("No models found.")
            return
        for m in found:
            print(f"Repo: {m.id}")
            files = api.list_repo_files(repo_id=m.id)
            ggufs = [f for f in files if "q4_k_m" in f.lower() and f.endswith(".gguf")]
            if not ggufs:
                ggufs = [f for f in files if f.endswith(".gguf")][:3]
            print(f"  GGUFs: {ggufs}")
    except Exception as e:
        print(f"Error: {e}")

search_gguf("122b-a10b gguf")
search_gguf("Qwen3.5 122b gguf")
search_gguf("35b-a3b gguf")
search_gguf("gemma-4 26b gguf")
search_gguf("Qwen 122B")
