AQIT 0.1.0
Loading...
Searching...
No Matches
aquin.compute.model_families Namespace Reference

Functions

str _slug_from_hf (str hf_name)
dict[str, Any]|None _match_family (str hf_name, list[dict[str, Any]] families)
dict[str, Any]|None _family_by_id (str family_id)
dict[str, Any]|None _match_family_from_hf_config (str hf_name)
str|None normalize_llm_hf_id (str model_id)
tuple[int, int] _infer_llm_dims (str hf_name, *, bool trust_remote_code)
dict[str, Any] build_llm_family_config (str hf_name, dict[str, Any] family)
None _persist_family_config (str slug, dict[str, Any] cfg)
dict[str, Any]|None _load_family_config_from_disk (str slug)
dict[str, Any]|None get_runtime_llm_config (str slug)
tuple[str, dict[str, Any]] resolve_llm_family (str model_id)
bool is_llm_family_candidate (str model_id)
list[str] family_help_lines ()

Variables

dict _RUNTIME_LLM = {}
str FAMILY_MODEL_DIR = Path.home() / ".aquin" / "family_models"
dict _MODEL_TYPE_TO_FAMILY
tuple _ARCH_HINTS
list LLM_FAMILIES

Function Documentation

◆ _family_by_id()

dict[str, Any] | None _family_by_id ( str family_id)
protected

Definition at line 134 of file model_families.py.

Referenced by _match_family_from_hf_config().

◆ _infer_llm_dims()

tuple[int, int] _infer_llm_dims ( str hf_name,
* ,
bool trust_remote_code )
protected

Definition at line 181 of file model_families.py.

Referenced by build_llm_family_config().

◆ _load_family_config_from_disk()

dict[str, Any] | None _load_family_config_from_disk ( str slug)
protected

Definition at line 244 of file model_families.py.

Referenced by get_runtime_llm_config().

◆ _match_family()

dict[str, Any] | None _match_family ( str hf_name,
list[dict[str, Any]] families )
protected

Definition at line 126 of file model_families.py.

Referenced by is_llm_family_candidate(), and resolve_llm_family().

◆ _match_family_from_hf_config()

dict[str, Any] | None _match_family_from_hf_config ( str hf_name)
protected
Infer LLM family from HuggingFace config when the repo id is not an official org prefix.

Covers fine-tunes (e.g. Hahmdong/*-qwen3-*) that keep the base architecture in config.json.

Definition at line 141 of file model_families.py.

References _family_by_id().

Referenced by resolve_llm_family().

◆ _persist_family_config()

None _persist_family_config ( str slug,
dict[str, Any] cfg )
protected

Definition at line 237 of file model_families.py.

Referenced by resolve_llm_family().

◆ _slug_from_hf()

str _slug_from_hf ( str hf_name)
protected
Stable Aquin slug from a HuggingFace repo id.

Definition at line 119 of file model_families.py.

Referenced by build_llm_family_config(), and resolve_llm_family().

◆ build_llm_family_config()

dict[str, Any] build_llm_family_config ( str hf_name,
dict[str, Any] family )

Definition at line 201 of file model_families.py.

References _infer_llm_dims(), and _slug_from_hf().

Referenced by resolve_llm_family().

◆ family_help_lines()

list[str] family_help_lines ( )

Definition at line 317 of file model_families.py.

◆ get_runtime_llm_config()

dict[str, Any] | None get_runtime_llm_config ( str slug)

Definition at line 255 of file model_families.py.

References _load_family_config_from_disk().

Referenced by is_llm_family_candidate(), and resolve_llm_family().

◆ is_llm_family_candidate()

bool is_llm_family_candidate ( str model_id)

◆ normalize_llm_hf_id()

str | None normalize_llm_hf_id ( str model_id)

Definition at line 167 of file model_families.py.

Referenced by is_llm_family_candidate(), and resolve_llm_family().

◆ resolve_llm_family()

tuple[str, dict[str, Any]] resolve_llm_family ( str model_id)
Resolve catalog-external LLM slug or HF id via family rules. Raises ValueError if unsupported.

Definition at line 265 of file model_families.py.

References _match_family(), _match_family_from_hf_config(), _persist_family_config(), _slug_from_hf(), build_llm_family_config(), get_runtime_llm_config(), and normalize_llm_hf_id().

Variable Documentation

◆ _ARCH_HINTS

tuple aquin.compute.model_families._ARCH_HINTS
protected
Initial value:
= (
("Qwen3", "qwen"),
("Qwen2", "qwen"),
("Qwen", "qwen"),
("Llama", "llama"),
("Mistral", "llama"),
("GPTNeoX", "pythia"),
("GPT2", "gpt2"),
("LFM", "lfm"),
)

Definition at line 31 of file model_families.py.

◆ _MODEL_TYPE_TO_FAMILY

dict aquin.compute.model_families._MODEL_TYPE_TO_FAMILY
protected
Initial value:
= {
"gpt2": "gpt2",
"gpt_neox": "pythia",
"llama": "llama",
"mistral": "llama", # same LoRA targets / hook shape as Llama
"qwen": "qwen",
"qwen2": "qwen",
"qwen3": "qwen",
"qwen2_moe": "qwen",
}

Definition at line 19 of file model_families.py.

◆ _RUNTIME_LLM

dict aquin.compute.model_families._RUNTIME_LLM = {}
protected

Definition at line 15 of file model_families.py.

◆ FAMILY_MODEL_DIR

str aquin.compute.model_families.FAMILY_MODEL_DIR = Path.home() / ".aquin" / "family_models"

Definition at line 16 of file model_families.py.

◆ LLM_FAMILIES

list aquin.compute.model_families.LLM_FAMILIES

Definition at line 42 of file model_families.py.