baml-expert

Generate typed Python clients from .baml sources with streaming support.

5|1|Updated Apr 19, 2026
One-click install
npx skills add https://github.com/air-gapped/skills --skill baml-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: baml-expert
Source: https://github.com/air-gapped/skills/tree/main/.claude/skills/baml-expert
Command: npx skills add https://github.com/air-gapped/skills --skill baml-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

BAML projects often require building typed Python clients from .baml sources while ensuring robust prompt rendering, schema alignment, and streaming behavior across providers and runtimes.

Core Features & Use Cases

  • Schema-Aligned Parsing (SAP) for tolerant coercion of LLM outputs into typed models
  • Streaming support with per-field and per-item granularity via @stream attributes
  • Python integration with generated baml_client (sync/async), ClientRegistry, and Collector
  • End-to-end workflows including tests with @@assert / @@check and multimodal inputs (image/audio/pdf)
  • Runtime client overrides and heterogeneous provider configurations

Quick Start

Create a minimal baml-expert example with a simple .baml function, a generated Python client, and one test to validate end-to-end flow.

Frequently Asked Questions about baml-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a type-safe Python client from .baml sources?

Schema-Aligned Parsing (SAP) in BAML provides tolerant coercion of raw LLM outputs into typed Python models. It handles malformed JSON or partial responses by mapping them to your defined schema, ensuring robust extraction even with unpredictable provider outputs.

How does streaming work with BAML and the generated Python client?

BAML streaming works via @stream attributes in your .baml functions, providing per-field and per-item granularity. The generated sync/async Python client consumes these streams, allowing real-time parsing of partial LLM outputs as they arrive from the provider.

Can I override LLM provider configurations at runtime using baml_py?

Yes, you can override LLM provider configurations at runtime using baml_py. The ClientRegistry and Collector components allow you to dynamically route requests to heterogeneous providers and capture execution metadata without modifying the original .baml source files.

How do I validate BAML functions end-to-end with multimodal inputs?

You validate BAML functions end-to-end by writing tests using @@assert and @@check annotations. This supports multimodal inputs including image, audio, and PDF formats, verifying that the generated Python client correctly processes complex inputs and enforces schema alignment.

What is the best way to handle complex prompt rendering and schema alignment in BAML?

The best way to handle prompt rendering and schema alignment in BAML is by leveraging Schema-Aligned Parsing (SAP) alongside the generated Python client. This combination ensures tolerant coercion of LLM outputs into typed models while maintaining consistent prompt rendering across heterogeneous providers.