Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsMay 11, 2026·2 min de lectura

BAML — Schema-First Prompting for Agents

BAML treats prompts as typed functions for reliable outputs. Install `baml-py`, define `.baml` functions, then call generated clients from Python.

Listo para agents

Este activo puede ser leído e instalado directamente por agents

TokRepo expone un comando CLI universal, contrato de instalación, metadata JSON, plan según adaptador y contenido raw para que los agents evalúen compatibilidad, riesgo y próximos pasos.

Stage only · 29/100Stage only
Superficie agent
Cualquier agent MCP/CLI
Tipo
Script
Instalación
Single
Confianza
Confianza: Established
Entrada
README.md
Comando CLI universal
npx tokrepo install b858ed4b-d059-4634-b406-35e6ec9c5eca
Introducción

BAML treats prompts as typed functions for reliable outputs. Install baml-py, define .baml functions, then call generated clients from Python.

  • Best for: teams iterating on prompts daily who want typesafety, streaming, and retry-friendly workflows without rewriting the whole app
  • Works with: BAML .baml files, Python via baml-py, and multi-language clients (per repo)
  • Setup time: 15 minutes

Quantitative Notes

  • PyPI package: baml-py (verified via pip index)
  • Setup time ~15 minutes
  • GitHub stars (verified): see Source & Thanks

Practical Notes

Adopt BAML when your bottleneck is iteration speed and output stability. Model your prompt as a function: inputs are typed, outputs are typed, and the prompt body is versionable. Keep a small library of BAML functions (extract, classify, route, summarize) and test them in your IDE before wiring them into agents. Over time, you get a maintainable prompt surface instead of a pile of ad-hoc strings.

Safety note: Keep function signatures small; overly generic types and huge prompts slow iteration and reduce reliability.

FAQ

Q: Do I need to write my whole app in BAML? A: No. The repo emphasizes using BAML for prompts/functions and wiring it into your existing app.

Q: What makes it different from plain prompting? A: You define a function signature with types and let the tool enforce output structure, retries, and streaming-friendly interfaces.

Q: Is it Python-only? A: No. The repo lists Python, TypeScript, Ruby, Go, and more client options via generated clients or REST patterns.


🙏

Fuente y agradecimientos

GitHub: https://github.com/BoundaryML/baml Owner avatar: https://avatars.githubusercontent.com/u/124114301?v=4 License (SPDX): Apache-2.0 GitHub stars (verified via api.github.com/repos/BoundaryML/baml): 8,206

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados