LLM Infrastructure Tools
LLM Infrastructure Tools
Tools for discovering, categorizing, and managing large language models. These are production-grade utilities that power Aurora’s model management capabilities.
Overview
Working with LLMs at scale requires infrastructure. These tools help us:
- Discover models from major providers
- Categorize models by capability and use case
- Filter by parameters, quantization, and other criteria
- Manage model downloads and caching
Available Tools
fetch_models.py
HuggingFace Model Categorizer
A comprehensive tool that fetches GGUF models from all major quantization uploaders on HuggingFace, categorizes them by type and capability, and produces a structured model list.
Key Features:
- Fetches from 20+ major uploaders (TheBloke, QuantFactory, Lewdiculous, etc.)
- Categorizes into 15+ primary categories (Audio, Vision, Coding, Reasoning, etc.)
- Auto-categorizes remaining models by architecture (Llama, Mistral, Phi, etc.)
- Filters by parameter count (0.1B-14B by default)
- Produces pipe-delimited output for easy parsing
Use Cases:
- Building model menus for LLM interfaces
- Powering model selection UIs
- Analyzing the LLM ecosystem
- Creating custom model collections
friend.zip - Mobile LLM Project
On-Device LLM Infrastructure
A complete mobile/on-device LLM implementation with shell scripts for:
- LLM calling
- Conversation management
- Configuration
- Setup and initialization
Key Features:
- Self-contained, portable implementation
- Bash-based with minimal dependencies
- Designed for resource-constrained environments
- Modular architecture
Use Cases:
- Running LLMs on edge devices
- Mobile AI assistants
- Offline LLM applications
- Embedded AI systems
The Model Categorization Challenge
With thousands of GGUF models on HuggingFace, manual categorization is impossible. fetch_models.py solves this with a two-stage approach:
Stage 1: Primary Categories (XOR - First Match Wins)
Models are first matched against specific use-case categories:
| Category | Keywords | Example Models |
|---|---|---|
| Audio | tts, speech, voice, whisper | Whisper, Bark, Outé |
| Vision | vl, vision, llava, moondream | LLaVA, BakLLaVA, MiniCPM-V |
| Coding | coder, starcoder, codegemma | StarCoder2, CodeLlama, DeepSeek-Coder |
| Reasoning | reasoning, math, r1, o1 | DeepSeek-R1, QWQ, Skywork |
| Medical | medical, clinical, health | MedLlama, Meditron |
| Legal | legal, law, lawyer | LawLlama, JurisAI |
| Finance | finance, financial, trading | FinLlama, BloombergGPT |
| Roleplay | roleplay, rpg, persona | TavernAI, RoleplayLlama |
| Uncensored | uncensored, nsfw, adult | UncensoredLlama, LewdPlay |
| Creative | dolphin, hermes, openchat | Dolphin, Hermes, Zephyr |
| Long Context | long, context, 128k, 256k | LongLlama, Yarn, Infini |
| Multilingual | multilingual, bloom, xglm | Bloom, XGLM, Aya |
| Merged | merge, franken, slerp | FrankenLlama, Supernova |
| Tiny | smollm, tinyllama, mobile | TinyLlama, Phi-1, Edge |
| Instruct | instruct, chat, assistant | Llama-3-Instruct, Mistral-Instruct |
Stage 2: Auto-Categorization (Fallback)
Models that don’t match primary categories are auto-categorized by architecture:
| Category | Keywords |
|---|---|
| Auto/Gemma | gemma |
| Auto/Llama | llama |
| Auto/Qwen | qwen |
| Auto/Mistral | mistral |
| Auto/Phi | phi |
| Auto/Falcon | falcon |
| Auto/DeepSeek | deepseek |
| Auto/GLM | glm |
| Auto/Other | (catch-all) |
Architecture Patterns
fetch_models.py Design
# 1. Define uploaders (sources)
UPLOADERS = ["Lewdiculous", "QuantFactory", "TheBloke", ...]
# 2. Define categorization rules
PRIMARY_RULES = [("Audio", [r"tts\b", r"\bspeech\b", ...]), ...]
AUTO_RULES = [("Auto/Gemma", [r"\bgemma\b"]), ...]
# 3. Fetch from each uploader
for uploader in UPLOADERS:
data = fetch_from_huggingface(uploader)
# 4. Filter and categorize
for model in data:
if passes_filters(model):
category = categorize(model)
models.append(model_with_category)
# 5. Sort and output
models.sort(key=lambda x: (x["date"], x["likes"]), reverse=True)
write_output(models)
Parameter Extraction
The tool handles complex parameter notation:
7B,13B,70B— Standard notation30B-A3B— MoE (uses total params: 30B)0.5B,1.5B— Decimal parameters7B fp16— Ignores quantization suffix128K,256K— Context window (not parameter count)
Usage Examples
Basic Usage
# Fetch models, cache in ./cache, output to models.txt
python3 fetch_models.py ./cache models.txt
Output Format
# llama-menu model list — fetched from HuggingFace
# NAME|CATEGORY|REPO|FILE|SIZE|LIKES|DOWNLOADS|DATE
Llama-3-8B-Instruct|Instruct|meta-llama/Meta-Llama-3-8B-Instruct-GGUF|Q4_K_M.gguf|6.8GB|15000|85000|2026-07-15
Mistral-7B-Instruct|Instruct|TheBloke/Mistral-7B-Instruct-v0.2-GGUF|Q4_K_M.gguf|4.1GB|12000|75000|2026-07-10
Phi-3-mini-4k-instruct|Instruct|mradermacher/Phi-3-mini-4k-instruct-4k-GGUF|Q4_K_M.gguf|2.1GB|8000|45000|2026-07-20
Integration with Model Menus
Many LLM interfaces (like llama-menu.sh) use this output:
# Parse model list
while IFS='|' read -r name category repo file size likes downloads date; do
if [ "$category" = "Coding" ]; then
echo "[$name] ($size) - $category"
fi
done < models.txt
Performance Considerations
Fetching Speed
- Fetches from 20+ uploaders sequentially
- ~500 models per uploader (limit=500)
- Total: ~10,000+ models processed
- Runtime: ~2-5 minutes (depends on network)
Caching
- Models are cached in JSON format
- Cache directory structure:
cache/<uploader>.json - Subsequent runs skip already-fetched data
Filtering
- Parameter range: 0.1B-14B (configurable)
- Excludes: base models, embeddings, rerankers
- Quantization: Prefers Q4_K_M, Q4_K_S, Q4_0
Source Code
All tools are available for download and study:
- fetch_models.py Source — Local version
- friend.zip Contents — Mobile LLM project
Related
- Aurora Tools — The AI agent that uses these tools
- Physics Tools — Mathematical and physics calculators
- Utility Scripts — General-purpose tools
- LLM Memory Architectures — How we use models
Good infrastructure makes complex systems simple. Great infrastructure makes them invisible.
fetch_models.py - HuggingFace Model Categorizer
fetch_models.py
Comprehensive GGUF Model Fetcher and Categorizer
Fetches GGUF models from all major quantization uploaders on HuggingFace. Filters by param count (0.1B-14B). Categorizes by keyword rules. Anything not matched goes into Auto/
via a second-pass clusterer.
Overview
fetch_models.py is a production-grade tool that solves a critical problem: How do you make sense of thousands of LLM models on HuggingFace?
It fetches models from all major GGUF quantization uploaders, intelligently categorizes them, and produces a clean, structured output that can be used to power model selection interfaces, analysis tools, or any application that needs to work with the LLM ecosystem at scale.
friend.zip - Mobile LLM Project
friend.zip
Mobile/On-Device LLM Infrastructure
A self-contained LLM implementation designed for edge devices and mobile environments. This is a complete AI assistant system that runs entirely locally with minimal dependencies.
Overview
friend.zip contains a portable, self-contained LLM system built entirely in Bash. It’s designed to run on resource-constrained devices (mobile, edge, embedded) where traditional Python-based LLM systems would be too heavy.
Contents
The archive contains 8 files totaling ~16KB:
| File | Size | Purpose |
|---|---|---|
setup.sh | 1.5KB | Installation and initialization |
config.sh | 778B | Configuration management |
llm_call.sh | 2.7KB | Core LLM calling interface |
memory.sh | 2.5KB | Memory/conversation management |
tools.sh | 2.1KB | Utility functions and helpers |
dream.sh | 3.1KB | Memory consolidation (similar to Aurora’s) |
talk.sh | 3.0KB | Main conversation interface |
system_prompt.txt | 602B | Default system prompt |
Architecture
Component Overview
┌─────────────────────────────────────────────────────────┐
│ FRIEND SYSTEM │
├─────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌────────────┐ │
│ │ talk.sh │────►│ llm_call.sh │────►│ LLM │ │
│ │ (Interface) │ │ (Core) │ │ (Backend) │ │
│ └─────────────┘ └─────────────┘ └────────────┘ │
│ ▲ ▲ │
│ │ │ │
│ ┌──────┴──────┐ ┌──────┴──────┐ │
│ │ memory.sh │ │ config.sh │ │
│ │ (State) │ │ (Settings) │ │
│ └──────┬──────┘ └─────────────┘ │
│ │ │
│ ┌──────▼──────┐ │
│ │ dream.sh │ │
│ │ (Consolidation) │
│ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────┘
Data Flow
User Input → talk.sh → memory.sh (load context) → llm_call.sh → LLM
↑
dream.sh (consolidate)
↓
memory.sh (save context)
Components
1. talk.sh (3.0KB)
Main conversation interface — The entry point for interacting with the LLM.