# BAML

Type-safe prompt programming language & LLM function compiler

BAML is a domain-specific language that turns complex LLM prompts into strongly-typed functions with automatic client generation.

## Overview

- **Website**: https://boundaryml.com
- **Docs**: https://docs.boundaryml.com
- **GitHub**: https://github.com/boundaryml/baml
- **License / Pricing**: Open Source
- **Directory Entry**: https://agentaccess.dk/enablers/baml

## About

BAML (Basically A Made-up Language) brings software engineering rigor to prompt engineering. Write typed schemas and prompts in `.baml` files, test them with live preview in VS Code, and compile them into zero-overhead, type-safe clients for Python, TypeScript, and Go.

## Key Features

- Compiles prompts into native TypeScript, Python, and Go SDKs
- 4x token savings over verbose JSON schema formats
- Schema-Aligned Parsing (SAP) heals malformed LLM responses
- Interactive VS Code playground with hot-reloading testing

## Danish System Application Recipes

### Compile Type-Safe Danish Address & CPR Parsing Functions
Define strict BAML schemas for Danish municipal forms and generate TypeScript clients that parse messy user inputs with guaranteed types.

## Quickstart

```typescript
// Define structured types in BAML
class DanishCompany {
  name string
  cvr int
  industry string
}

function ExtractCompany(text: string) -> DanishCompany {
  client GPT4o
  prompt #"
    Extract the Danish company details:
    {{ text }}
    {{ ctx.output_format }}
  "#
}
```

---
Source: [AgentAccess Enablers](https://agentaccess.dk/enablers/baml)