# tinker_cookbook.hyperparam_utils.get_lora_param_count *Generated from tinker-cookbook at commit [`4a3a282`](https://github.com/thinking-machines-lab/tinker-cookbook/tree/4a3a2829190b45999021e423bc90b7523108edf4). Source links point at that snapshot.* ### [**tinker_cookbook.hyperparam_utils.get_lora_param_count**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/4a3a2829190b45999021e423bc90b7523108edf4/tinker_cookbook/hyperparam_utils.py#L258)(*model_name*, *lora_rank*, *train_mlp*, *train_attn*, *train_unembed*) Get the number of parameters in the LoRA adapter. Mirrors the signature of `ServiceClient.create_lora_training_client`: the returned count reflects exactly which submodules will be adapted. **Parameters:** - [**model_name**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/4a3a2829190b45999021e423bc90b7523108edf4/tinker_cookbook/hyperparam_utils.py#L259) (*str*) – Tinker base model identifier. - [**lora_rank**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/4a3a2829190b45999021e423bc90b7523108edf4/tinker_cookbook/hyperparam_utils.py#L260) (*int*) – Rank of the LoRA decomposition. - [**train_mlp**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/4a3a2829190b45999021e423bc90b7523108edf4/tinker_cookbook/hyperparam_utils.py#L261) (*bool*) – Whether MLP layers are LoRA-trained. - [**train_attn**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/4a3a2829190b45999021e423bc90b7523108edf4/tinker_cookbook/hyperparam_utils.py#L262) (*bool*) – Whether attention layers are LoRA-trained. - [**train_unembed**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/4a3a2829190b45999021e423bc90b7523108edf4/tinker_cookbook/hyperparam_utils.py#L263) (*bool*) – Whether the unembedding (LM head) is LoRA-trained. **Returns:** Total trainable parameter count. Notes: For MoE expert layers, Tinker uses a shared-outer LoRA scheme: the LoRA factor connected to the model hidden dimension is shared across experts, while the other factor remains expert-specific. This reduces LoRA parameter count and optimizer state while preserving per-expert adaptation. The parameter count returned by this function reflects this sharing.