Skip to content

refactor(fetcher): split HuggingFace model fetching modules (#41)#140

Open
RaghavRD wants to merge 1 commit into
Andyyyy64:mainfrom
RaghavRD:refactor/fetcher-split
Open

refactor(fetcher): split HuggingFace model fetching modules (#41)#140
RaghavRD wants to merge 1 commit into
Andyyyy64:mainfrom
RaghavRD:refactor/fetcher-split

Conversation

@RaghavRD

Copy link
Copy Markdown
Contributor

Part of #41.

What

Splits the oversized src/whichllm/models/fetcher.py into focused modules by responsibility:

Module Purpose Lines
models/fetcher.py compatibility shim / legacy import surface 110
models/hf.py HuggingFace API orchestration and endpoint handling 293
models/parser.py HF payload -> ModelInfo parsing 295
models/parameters.py parameter-count, MoE active-param, curated override normalization 218
models/gguf.py GGUF quant extraction, size estimation, split-file aggregation 84
models/sliding_window.py sliding-window-attention metadata resolution 95
models/serialization.py cache serialization/deserialization helpers 94

fetcher.py remains as a re-export shim so existing imports like:

from whichllm.models.fetcher import fetch_models, _parse_model, _extract_quant_type

Move fetcher responsibilities into focused modules for HF API orchestration, model parsing, parameter normalization, GGUF extraction, sliding-window metadata, and cache serialization.

Keep whichllm.models.fetcher as a compatibility shim so existing public and test imports continue to work.

Refs Andyyyy64#41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant