← ClaudeAtlas

baml-expertlisted

BAML (Boundary ML) expert for projects defining LLM calls as typed functions in .baml files with a generated Python client. Use whenever the repo contains baml_src/, baml_client/, baml-cli commands, or imports from baml_py / baml_client. Covers .baml syntax (function, class, enum, client, test, retry_policy, attributes), Python integration (baml_client sync/async, streaming, ClientRegistry, Collector, TypeBuilder), Schema-Aligned Parsing, ctx.output_format, @@assert / @@check tests, @stream.done / @stream.not_null / @stream.with_state streaming, multimodal (image/audio/pdf), and debugging via BAML_LOG plus Boundary Studio. Triggers even unnamed — "add an LLM function", "fix a failing parse", "add a test for the prompt", "stream the response" in a project with baml_src/. Prefer over raw LLM-SDK guidance here; defer to jinja-expert for standalone chat-template / .j2 work.
air-gapped/skills · ★ 3 · AI & Automation · score 76
Install: claude install-skill air-gapped/skills
# BAML expert BAML = small DSL for typed LLM calls. Author `.baml` files in `baml_src/`, run `baml-cli generate`, get a typed Python package at `baml_client/`. The generated `b` object exposes each function as a typed method. BAML handles prompt rendering, HTTP, retries, fallbacks, streaming, and **Schema-Aligned Parsing (SAP)** — robust coercion of messy LLM output into typed objects. Use this skill for any task touching `.baml` files, `baml_client`, or calls into it. Read the full repo layout first if unclear: the convention is `baml_src/*.baml` + generated `baml_client/` (gitignored; regenerated on every change). ## Mental model (critical) ``` baml_src/*.baml ──baml-cli generate──▶ baml_client/ (Pydantic + async/sync client) ``` At call time, for each function: 1. Render the prompt (Minijinja). 2. Build HTTP request for the configured provider. 3. Apply retry / fallback / round-robin / timeout policy. 4. Parse raw output with **SAP** — tolerant of missing quotes, trailing commas, markdown fences, chain-of-thought preamble, fractions as floats, etc. 5. Return typed object OR raise a typed error (`BamlValidationError`, `BamlClientError`, `BamlTimeoutError`, `BamlAbortError`). **Never edit `baml_client/`.** It regenerates. Edit `.baml` files and rerun `baml-cli generate`. ## Workflow for typical tasks When the user asks for a change in a BAML project, do this: 1. **Read the BAML sources first.** `ls baml_src/`, then read the relevant `.baml` files. They're plain