
BAML

BAML (Boundary Markup Language) is an open-source domain-specific language that brings type safety and structure to AI development. It allows developers to define prompt functions, input and output schemas, and validation rules that automatically generate reliable code across languages like Python, TypeScript, Ruby, and Go. BAML ensures consistent, schema-validated responses from large language models, making AI applications more predictable, testable, and production-ready.
BAML Details
Reviewed by Add AI Directory Editorial Team
View our review methodology →Sources
- Official website
- DocumentationNot provided
- Pricing pageNot provided
- Privacy policyNot provided
- Terms / public policyNot provided
- Testing status
- Researched Only
- Availability status
- Not yet verified
- Limitations
- No additional limitations documented.
Ready to try BAML?
Check out BAML for pricing and explore how it can streamline your workflow.
Overview of BAML
BAML is a programming language and developer framework created for building reliable AI agents, structured language model workflows, and applications that depend on predictable model responses. It gives developers a structured way to define prompts as typed functions instead of managing them as loose strings scattered throughout an application.
Developers can use BAML to describe the exact information an AI model should return, test prompts inside a dedicated development environment, and generate typed clients for use in existing applications. This approach can make AI features easier to build, inspect, maintain, and update as projects become more complex.
BAML is especially useful for applications that need structured information rather than unformatted text. Common examples include extracting information from documents, classifying support requests, generating typed objects, creating AI agents, processing resumes, building chat systems, and connecting language models to existing software.
What Is BAML?
BAML stands for Basically a Made Up Language. It is designed to help developers create dependable functions powered by large language models. A BAML function can accept typed inputs, send a prompt to a selected model, and return a clearly defined output type.
Instead of asking a model to return loosely formatted JSON and writing additional code to validate the response, developers can define the expected output directly in BAML. The return type becomes part of the function, which helps the application understand the intended structure of the response.
BAML can be introduced into an existing project without requiring the entire application to be rewritten. Developers can define their AI functions in BAML and generate clients that can be called from supported programming environments. This makes it suitable for teams that already have applications written in languages such as TypeScript, Python, Go, Java, Ruby, or C Sharp.
The language is also designed around the idea that prompts should behave more like maintainable software functions. Prompts can have inputs, outputs, model settings, tests, fallback behavior, and reusable schemas. This gives development teams a more organized alternative to storing prompts as ordinary text inside application files.
How To Use BAML
To begin using BAML, developers install the BAML toolchain and initialize it inside a new or existing software project. The project normally contains a BAML source directory where functions, data classes, model clients, and tests can be defined.
The first step is usually to create the data structure that the model should return. For example, a resume extraction function could return a structured object containing a candidate name, email address, work history, skills, and education. Each field can have its own type, and optional information can be marked accordingly.
After creating the output structure, the developer defines a BAML function. The function includes its input values, return type, selected language model, and prompt instructions. BAML uses the return type to help guide and parse the model response.
Developers can then run and test the function using BAML development tools. The editor experience allows prompts and outputs to be reviewed while changes are being made. Tests can be created for sample inputs so developers can compare results and identify prompt changes that improve or reduce performance.
Once the function behaves as expected, BAML can generate a typed client for the main application. The application can call the generated client like a regular software function. This allows the language model workflow to remain organized in BAML while the rest of the product continues using its existing technology stack.
Teams can also configure multiple model providers, retry rules, fallback models, and runtime model selection. This can help an application continue operating when a provider is unavailable or when a different model is better suited to a particular request.
BAML Key Features
Typed Language Model Functions
BAML allows developers to define language model prompts as functions with typed inputs and outputs. The expected response is part of the function definition rather than an informal instruction hidden inside the prompt.
This structure makes it easier for developers to understand what information a function accepts and what information it should return. It also improves autocomplete and reduces the amount of manual parsing code required inside the main application.
Structured Output Parsing
Language models do not always return perfectly formatted data. They may add explanatory text, place a response inside formatting markers, or produce an output that is close to the requested schema without matching it exactly.
BAML includes structured output parsing designed to recover useful typed data from imperfect model responses. This can make structured workflows more dependable across different language models, including models that do not provide their own native structured output features.
Support for Multiple Model Providers
BAML is not limited to one language model company. Developers can configure clients for different providers and switch models without completely rewriting the function.
This flexibility allows teams to compare model quality, cost, speed, and availability. It also reduces the amount of provider specific logic that needs to be placed throughout the application.
Generated Application Clients
BAML can generate typed clients that connect BAML functions to an existing application. These clients make AI functions feel more like ordinary functions inside the host programming language.
A developer can call a BAML function, pass typed inputs, and receive a typed response. This creates a clearer boundary between the AI workflow and the rest of the application.
Streaming Structured Responses
BAML supports streaming for structured model responses. Applications can begin receiving partial typed information while the model is still generating the complete result.
This can improve the user experience in applications where waiting for the entire response would create a noticeable delay. Streaming can be useful for chat interfaces, document processing tools, research assistants, and other interactive AI products.
Prompt Testing and Evaluation
Developers can create tests for BAML functions and run them against sample inputs. This helps teams evaluate whether a prompt produces the desired structure and content before it is used in production.
Tests can also make prompt changes safer. When a developer updates instructions, schemas, or model settings, existing test cases can reveal whether the change affected important behavior.
Visual Development Tools
BAML provides development tools for writing, previewing, and testing prompts. Developers can inspect model inputs and outputs without building a separate interface for every experiment.
This creates a faster workflow for prompt development. It can also make collaboration easier because prompts, schemas, and tests remain together in the project rather than being spread across notebooks, dashboards, and application files.
Model Fallbacks and Retry Policies
AI applications can experience provider outages, rate limits, timeouts, and inconsistent responses. BAML allows developers to define retry and fallback behavior for language model functions.
A function can attempt another request or use a different model when the original request fails. Centralizing this behavior can make production workflows easier to manage.
Reusable Data Types
Developers can define reusable classes, enums, unions, and other data structures. These types can be shared across multiple language model functions.
For example, a customer support application could define a shared customer type, ticket category type, priority type, and response type. Multiple functions could then use the same definitions for classification, routing, summarization, and reply generation.
Incremental Adoption
A company does not need to move its entire codebase into BAML. Teams can begin with one prompt or one structured extraction workflow and expand their use of BAML over time.
This makes it practical for developers who want to improve prompt organization and output reliability without replacing their existing backend or frontend systems.
BAML Use Cases
Document Data Extraction
BAML can be used to convert unstructured documents into structured application data. A developer can define the fields that should be extracted from resumes, invoices, contracts, reports, forms, or other files.
The language model function can return a typed object that the application can store, search, validate, or send to another service. This is useful when the source documents do not follow a single consistent format.
AI Agent Development
Developers can use BAML to define the functions and data structures used by an AI agent. These functions may classify user intent, choose an action, call external tools, summarize results, and decide what the agent should do next.
Typed responses can make agent behavior easier to control because every decision can be represented through a defined schema instead of arbitrary text.
Customer Support Automation
A support system can use BAML to classify incoming messages, identify urgency, extract order information, determine the appropriate department, and draft a response.
Each step can be implemented as a separate typed function. This makes the workflow easier to test and allows human reviewers to inspect the information produced at every stage.
Resume and Candidate Processing
Recruiting tools can use BAML to extract candidate names, contact details, employment history, qualifications, and skills from resumes.
The resulting data can be returned in a consistent structure even when resumes use different layouts. Additional functions can compare candidate experience with job requirements or summarize qualifications for a recruiter.
Sales Lead Qualification
BAML can help sales applications analyze form submissions, emails, meeting notes, and company information. A function could return a lead category, estimated intent, relevant product, priority level, and recommended next action.
Because the output follows a defined type, the result can be passed directly into a customer relationship management system or an internal sales workflow.
Content Classification
Publishers and content platforms can use BAML to categorize articles, identify topics, generate tags, detect content types, and route material to the appropriate review process.
Typed classifications are easier to store and filter than free form model responses. Developers can also restrict categories to a predefined list.
Chatbots and Retrieval Systems
BAML can support chatbots that retrieve information from a knowledge base and generate responses using that context. Typed functions can help separate search queries, retrieved evidence, answer generation, and follow up actions.
This structure can make a retrieval workflow easier to debug because developers can inspect the output of each function rather than treating the entire chatbot as one large prompt.
Tool Calling Workflows
An AI application may need to choose between several tools, such as searching a database, sending a message, looking up an order, or creating a support ticket.
BAML can represent each tool decision as a typed output. The main application can then validate the selected action and execute the appropriate function.
Data Transformation
BAML can transform unstructured language into structured records. Examples include converting meeting notes into tasks, turning customer feedback into product categories, extracting property information from listings, or organizing research into predefined fields.
This can reduce the amount of manual data entry required when information arrives through text rather than standardized forms.
Multi Model Applications
Some applications use different models for different tasks. A smaller model may handle classification, while a larger model handles complex reasoning or content generation.
BAML allows developers to define model configurations for individual functions. This can help teams balance response quality, speed, and operating cost across a larger AI system.
BAML FAQ
Is BAML a programming language?
Yes. BAML is a programming language designed for AI agents, typed language model functions, structured outputs, testing, and AI workflow development. It can be used alongside an existing application rather than replacing the entire application stack.
What does BAML stand for?
BAML stands for Basically a Made Up Language. The name reflects its origin as a purpose built language for organizing prompts and language model functions.
Who created BAML?
BAML was created by Boundary. The project is developed as an open source tool for building reliable AI applications and agent workflows.
Does BAML replace Python or TypeScript?
BAML does not need to replace Python, TypeScript, or another application language. Developers can use BAML for language model functions and call those functions from their existing software.
This allows teams to keep their primary application architecture while moving prompt definitions, schemas, and model configuration into a more specialized environment.
Can BAML work with different language models?
Yes. BAML supports workflows that use models from multiple providers. Developers can configure model clients and change the model used by a function without rebuilding the entire workflow.
Is BAML only for structured outputs?
Structured output generation is one of BAML's central capabilities, but the language can also be used for agent logic, orchestration, testing, evaluations, model configuration, retries, fallbacks, and application integration.
Can BAML be added to an existing project?
Yes. BAML supports incremental adoption. A development team can begin by moving one prompt or extraction workflow into BAML and then add more functions as needed.
Does BAML support testing?
Yes. Developers can create test cases for BAML functions and inspect how functions respond to sample inputs. Testing helps teams compare prompts, models, schemas, and expected results.
Can BAML stream responses?
Yes. BAML supports streaming, including partial structured responses. This allows an application to begin processing or displaying information before the full model response has finished.
Is BAML open source?
Yes. BAML is available as an open source project. Developers can review the code, contribute to the project, and use the toolchain in their own applications.
What types of developers may benefit from BAML?
BAML may be useful for developers building AI agents, document processing systems, chatbots, support automation, extraction tools, classification systems, retrieval applications, and other products that require dependable language model responses.
It may be especially valuable for teams that want prompts to be typed, testable, reusable, and stored alongside the rest of their application code.
Why We Featured BAML on Add AI Agents
BAML addresses an important challenge in AI development: turning inconsistent language model responses into dependable software behavior. It gives developers a structured environment for defining prompts, outputs, model clients, tests, and application integrations.
We featured BAML because it can help teams move beyond loosely managed prompt strings and build language model features that are easier to understand and maintain. Its typed functions, structured output parsing, model flexibility, testing tools, and generated clients make it relevant to developers creating production AI applications.
BAML is also notable because it can be added to an existing technology stack gradually. Developers can use it for the parts of an application that interact with language models while continuing to use their preferred languages and frameworks for everything else.
Ready to try BAML?
Check out BAML for pricing and explore how it can streamline your workflow.
Explore More AI Agents
Discover other AI agents and tools to enhance your workflow and productivity.
Browse All AgentsSimilar to BAML

Vibekit
VibeKit is a hosted AI coding platform that gives each web app its own persistent AI agent and development environment. Users can build, edit, deploy, and maintain web apps from a phone or browser without keeping their own computer online. VibeKit supports GitHub integration, scheduled tasks, databases, MCP, environment variables, custom domains, and bring your own API keys for supported AI providers. The platform is designed for developers and founders who want to build small web apps, PWAs, prototypes, or internal tools with an AI coding agent that can continue working across sessions.

Agentskills Codes
agentskills.codes is an open registry for discovering and installing reusable Agent Skills for AI coding assistants such as Claude Code, Codex, and GitHub Copilot. It helps developers compare skills, review source and compatibility information, check safety and repository health signals, and install portable skills for coding and agent workflows.

Mem0
Mem0 is an AI memory layer for applications and agents that enables persistent, personalized context across conversations and sessions. It helps developers build AI systems that can remember user preferences, previous interactions, decisions, and other relevant information over time. Mem0 provides APIs and SDKs for storing, retrieving, updating, and managing memories, making it useful for AI assistants, customer support systems, personalized agents, and other context-aware AI applications.
Trending AI Agents

DeskCaller
DeskCaller is an AI phone receptionist built for UK service businesses. It answers inbound calls 24/7, captures and qualifies leads, books appointments, and records call outcomes in a centralized dashboard. DeskCaller integrates with calendars and CRM systems so businesses can automate call handling and follow-up without relying on a full-time receptionist.

AI for Database
AI for Database is an AI-powered data and analytics platform that lets users query databases in plain English without writing SQL. It connects with databases such as PostgreSQL, MySQL, and MongoDB to generate insights, create self-refreshing dashboards, and automate workflows based on changing data. Teams can use it for business intelligence, database monitoring, reporting, and actions such as sending emails, alerts, or webhooks.

ReWords AI
ReWords AI is an AI image text editor that lets users replace words embedded inside PNG, JPG, and WebP images. The platform detects existing text, removes the original wording, and inserts replacement text while attempting to preserve the font, color, size, placement, and surrounding background. It can be used to correct text in AI generated images, update promotional graphics, edit product images, localize visual content, and revise finished designs without access to the original source file.
