AI Project Naming Conventions: Engineering Practices for Models, Services, and APIs
This article explains why AI projects need dedicated naming conventions and provides a practical framework for naming models, datasets, inference services, and API endpoints. It covers core naming principles, a layered naming template with semantic versioning, automated validation with regular expressions, interface naming rules, migration strategies for legacy names, team rollout processes, and a final checklist to prevent common naming mistakes.
Why AI Projects Need Dedicated Naming Conventions
Traditional software projects typically focus naming conventions on variables, functions, and classes. AI projects introduce more object types and longer lifecycles. A single business scenario often involves base models, fine-tuned models, quantized versions, training datasets, inference services, evaluation reports, and public APIs. Every one of these objects is referenced by multiple people and read by automated pipelines.
Poor naming leads to three common categories of problems:
- Misuse risk: When two names differ by only a suffix, a caller may load the wrong weights, and production results quietly degrade.
- Traceability issues: During troubleshooting, it becomes impossible to determine a model’s training data version, architecture size, or intended task from its name alone. Teams must dig through documentation one item at a time.
- Automation failures: Deployment scripts, monitoring rules, and evaluation pipelines typically rely on name matching. When name formats are inconsistent, rules are either missed or misconfigured.
Naming should therefore be treated as part of the interface contract. Once a name is referenced, its format and meaning must remain stable.
Three Core Problems Naming Must Solve
A good name must satisfy three goals simultaneously.
1. Readability
When a team member sees a name, they should be able to understand the object’s purpose at a glance. For example, seeing risk-classify immediately suggests a risk-classification-related object, without opening documentation. Readability requires using common vocabulary, avoiding internal codenames, ad-hoc abbreviations, and meaningless numeric IDs.
2. Traceability
A name should carry enough versioning information for someone to identify which iteration the object came from. Version numbers, dates, or training batch IDs can serve this role, but a single convention must choose one primary form, with other information recorded in metadata.
3. Machine Parsability
A name should have a fixed structure that can be split by regular expressions or parsing functions. A fixed structure enables validation, statistics, and automated deployment. For instance, counting models by task type or filtering deployable candidates by size both depend on parseable names.
There is a trade-off among these three goals. Longer names carry more information, but also increase reading and input costs. In practice, the common approach is to put stable, frequently used information into the name, and low-frequency or fast-changing information into a registry or metadata.
Separating External Names from Internal Identifiers
Many AI products use external names with cultural meaning, emotional appeal, or brand storytelling—these names have clear communication value. Internal identifiers serve a completely different function. Mixing the two often leads to the following problems:
- External names are frequently adjusted, breaking internal references.
- Meaningful names do not directly convey a model’s task or scale; teams need extra lookup tables.
- Names containing spaces, punctuation, or special symbols cause errors in script processing.
The sound approach is to establish a two-layer structure. External names are decided by marketing or product teams, with a mapping to internal identifiers. Internal identifiers follow engineering conventions, remaining descriptive and stable. The mapping is stored in a unified registry and maintained automatically.
The benefit: the brand layer can adjust flexibly, while the engineering layer remains stable for references.
Basic Naming Principles
The following principles apply to models, datasets, services, and APIs.
Principle 1: Be semantically explicit. A name should describe the object’s responsibility. text-summary is easier to maintain than project-x.
Principle 2: Use lowercase letters and a consistent word separator. Mixed case can be treated differently across systems. Use all lowercase and separate words with hyphens. Underscores conflict with variable names in some contexts, so they are not the first choice.
Principle 3: Use only safe characters. Limit names to lowercase letters, digits, and hyphens. Spaces, slashes, Chinese characters, and special symbols are strictly forbidden, as they create escaping issues in paths, URLs, and command lines.
Principle 4: Set a length limit. Overly long names exceed field limits in some systems and reduce readability. Keep the total length under 64 characters.
Principle 5: Do not change semantics after release. A name corresponds to a single, definite object. If an object’s meaning fundamentally changes, release a new name instead of overwriting the old one.
Principle 6: Avoid ambiguous suffixes. Words like final, new, latest, and test2 cannot express version relationships and should be prohibited. When pointing to the latest version, use an alias mechanism instead.
Object Layering and Naming Templates
Objects in an AI project can be divided into several layers, each with different naming priorities.
| Object Type | Naming Focus | Example |
|---|---|---|
| Base model | Task domain, model family, scale | risk-classify-base-7b |
| Model version | Semantic version number | risk-classify-base-7b-v2.1.0 |
| Dataset | Business domain, purpose, data snapshot | risk-train-set-20261101 |
| Inference service | Task and environment | risk-classify-prod |
| API path | Resource noun and version prefix | /api/v1/risk-classify/jobs |
A general model naming template:
{domain}-{task}-{family}-{scale}-v{major}.{minor}.{patch}
Field meanings:
- Domain: The broader category of business or data, such as risk control, customer service, or content moderation.
- Task: The specific job the model performs, such as classification, extraction, ranking, or generation.
- Family: The series identifier under the same technical approach, such as base or compact.
- Scale: Parameter count or resource tier, such as
7bfor roughly 7 billion parameters. - Version: Follows semantic versioning rules, described in the next section.
If a version has variants such as quantization or distillation, place the variant information after the family or scale in a separate segment, for example risk-classify-base-7b-int8-v2.1.0. Variant information should be registered centrally by the team rather than invented individually by each member.
Version Number Semantics
Version numbers use a three-segment structure, where each segment change represents a different type of modification.
- Major version: Increment for incompatible changes to input/output formats, label systems, or service interfaces.
- Minor version: Increment when capabilities are enhanced, but callers can continue using the object without code changes.
- Patch version: Increment when fixing defects, making minor weight corrections, or updating configuration, with no changes to interfaces or capability scope.
Note that model version and training data version are two independent dimensions. The same model version may be trained on different data snapshots; these should be recorded separately in metadata. Encoding the data date directly into the model name causes frequent renames and fails to express multiple training runs on the same data.
Version increments should be decided through team review, not automatically incremented by training scripts. Automatic increments can mistake experimental changes for official versions, polluting downstream references.
Sample Code: Validating Naming Rules Automatically
A convention is only durable if it is enforced by machines. The following example shows how to validate model names with a regular expression. The code is for illustration only; production teams should adjust field ranges to their own rules.
import reNAME_RULE = re.compile(r"^(?P<domain>[a-z]{2,12})-"r"(?P<task>[a-z]{2,16})-"r"(?P<family>[a-z0-9]{2,12})-"r"(?P<size>\d+[bm])-"r"v(?P<major>0|[1-9]\d*)\."r"(?P<minor>0|[1-9]\d*)\."r"(?P<patch>0|[1-9]\d*)$")def parse_model_name(name: str) -> dict:"""Parse a model name, raising an exception if it does not match the rule."""if len(name) > 64:raise ValueError(f"Name exceeds 64 characters: {name}")match = NAME_RULE.match(name)if match is None:raise ValueError(f"Name does not follow the naming convention: {name}")return match.groupdict()if __name__ == "__main__":print(parse_model_name("risk-classify-base-7b-v2.1.0"))for bad_name in ["RiskModel_final2", "risk-classify-base-v2"]:try:parse_model_name(bad_name)except ValueError as err:print(err)
When run, a compliant name is split into a field dictionary for downstream statistics. Non-compliant names are blocked early in the deployment pipeline rather than surfacing as production issues.
Validation rules should be integrated into the continuous integration pipeline. Whenever model registration information is added or modified, the pipeline automatically runs validation, and failed validation prevents merging. This step is low-cost but blocks most naming errors.
Naming Interfaces and Services
API paths are external contracts with the highest change cost. Follow these practices when naming them.
Use nouns for resources and let HTTP methods express actions. A path should describe the resource itself, such as /jobs for a collection of inference tasks—use write requests to create tasks and read requests to query them. Paths should not contain verbs like getJob or createJob.
Put the version number in the path prefix. Use /api/v1/.... When the major version changes, add a new prefix while the old prefix remains available for a transition period.
Use the same vocabulary as model names in path segments. Keep interface task names consistent with model task names so callers and operators can map between them easily.
Do not expose internal environments in paths. Environment information should be handled through the domain or gateway, not the resource path. Otherwise the same interface has different paths in different environments, adding configuration burden on the client side.
Example:
POST /api/v1/risk-classify/jobs Create a classification taskGET /api/v1/risk-classify/jobs/{id} Query task results
Migration Strategy for Legacy Names
When a naming convention is introduced, existing objects usually do not follow the new rules. Renaming them directly breaks existing references, so plan the migration carefully.
- Build a mapping table: Record the correspondence between old and new names, managed centrally in a registry.
- Run dual names: During the transition, both new and old names work and point to the same object.
- Monitor call volume: Track which sources still use old names until all callers have switched.
- Announce a deadline: Notify affected teams in advance with a clear deprecation date.
- Remove old names: Only delete the old names after call volume drops to zero and the deadline has passed.
Aliases are an important tool in migration. For example, set risk-classify-prod to point to the current production version, and when upgrading, only change the alias target without requiring caller changes. Alias names should also follow the convention; avoid vague terms like latest.
Team Rollout Process
A convention only remains effective with supporting processes. Here are actionable steps.
- Write a convention document: Define templates, field meanings, allowed characters, and length limits, with both positive and negative examples.
- Assign a reviewer role: Designate a member to review naming for new objects, avoiding fragmented decisions.
- Integrate automated validation: Place validation code in the pipeline to block non-compliant names at commit time.
- Maintain a unified registry: Register all models, datasets, and services, with name, version, owner, training data, and applicable scenarios.
- Clean up periodically: Review quarterly for objects with no recent calls and mark them as archived or deleted to reduce name conflicts and cognitive load.
The registry is the core of this process. Names handle quick identification; the registry records details. The division of labor keeps names concise without losing critical information.
Common Misconceptions
Misconception 1: Using marketing names as internal identifiers. Marketing names often change with brand strategy, breaking internal references. Internal identifiers should remain descriptive and stable.
Misconception 2: Hard-coding hardware information into names. If a name includes a specific GPU model or data-center location, migrating hardware forces a rename. Resource information belongs in deployment configuration.
Misconception 3: Mixing version numbers and dates. A name containing both v2 and 20261101 leaves readers unsure which is authoritative. Choose one primary version expression.
Misconception 4: Adding more fields for completeness without limit. Beyond a certain length, names become difficult to type and read in logs. Long-tailed information should go into metadata.
Misconception 5: Writing the convention without enforcing it. A convention without automated validation and review is quickly weakened by exceptions. The more rules, the more tooling is needed to enforce them.
Rollout Checklist
Use the following checklist before naming any new object:
- Does the name contain only lowercase letters, digits, and hyphens?
- Does the name describe the object’s domain, task, or purpose?
- Is the name length within 64 characters?
- Does the version number follow the three-segment structure and match the nature of the change?
- Does it avoid vague words like
final,latest, andnew? - Is a mapping established between the external display name and the internal identifier?
- Is the name registered in the unified registry?
- Does it pass the automated validation pipeline?
By following this checklist, most naming problems can be caught and corrected at the object-creation stage.
