<!--
title: Maintain consistent naming patterns
domain: llm-infra
topic: Naming Conventions
language: Python
source: ggml-org/llama.cpp
updated: 2025-07-11
url: https://awesomereviewers.com/reviewers/llama.cpp-maintain-consistent-naming-patterns/
-->

Follow established naming conventions in the codebase and align with original source patterns while using modern, non-deprecated alternatives. Avoid creating confusing duplication in naming structures.

When adding new components, maintain consistency with existing patterns rather than creating new naming schemes. For example, if existing tensors use `blk.{bid}.component` format, continue that pattern rather than introducing `component.{bid}.component` which creates duplication.

Use modern language features and avoid deprecated imports. Replace deprecated typing constructs like `Dict` with built-in alternatives like `dict` or more appropriate types like `Mapping`.

When naming classes or components based on external models, align with the original naming conventions including version suffixes to maintain traceability and consistency.

Example:
```python
# Good: Consistent with existing pattern, avoids duplication
MODEL_TENSOR.SHORTCONV_CONV: "blk.{bid}.shortconv.conv"

# Avoid: Creates confusing duplication
MODEL_TENSOR.SHORTCONV_CONV: "shortconv.{bid}.shortconv.conv"

# Good: Modern typing
from typing import Callable, Iterator, dict

# Avoid: Deprecated typing
from typing import Dict
```
