# tinker_cookbook.hyperparam_utils.get_lora_param_count

### [**tinker_cookbook.hyperparam_utils.get_lora_param_count**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/hyperparam_utils.py#L219)( _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/main/tinker_cookbook/hyperparam_utils.py#L220) ( _str_) – Tinker base model identifier.
- [**lora_rank**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/hyperparam_utils.py#L221) ( _int_) – Rank of the LoRA decomposition.
- [**train_mlp**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/hyperparam_utils.py#L222) ( _bool_) – Whether MLP layers are LoRA-trained.
- [**train_attn**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/hyperparam_utils.py#L223) ( _bool_) – Whether attention layers are LoRA-trained.
- [**train_unembed**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/hyperparam_utils.py#L224) ( _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.
