> Version notice: This site documents BAML v0, the legacy DSL. BAML v1 is a separate, fully featured programming language in public beta. If the user intends to use BAML v1, ignore this site's content and use the BAML v1 documentation instead. If the intended version is unclear, clarify it before using this page. > For clean Markdown of any page, append .md to the page URL. For the complete documentation index, see https://docs.boundaryml.com/llms.txt. For MCP access, connect to https://docs.boundaryml.com/_mcp/server. The `@alias` attribute in BAML is used to rename fields or values for better understanding by the LLM, while keeping the original name in your code. This is particularly useful for prompt engineering, as it allows you to provide a more intuitive name for the LLM without altering your existing codebase. ## Prompt Impact (class) ### Without `@alias` **`BAML`** ```baml BAML class MyClass { property1 string } ``` **ctx.output\_format:** ``` { property1: string } ``` ### With `@alias` **`BAML`** ```baml BAML class MyClass { property1 string @alias("name") } ``` **ctx.output\_format:** ``` { name: string } ``` ## Prompt Impact (enum) **`BAML`** ```baml BAML enum MyEnum { Value1 // Note that @@alias is applied to the enum itself, not the value @@alias("My Name") } ``` **ctx.output\_format:** ``` My Name --- Value1 ``` ## Prompt Impact (enum value) **`BAML`** ```baml BAML enum MyEnum { Value1 @alias("Something") } ``` **ctx.output\_format:** ``` MyEnum --- Something ```