BAML

Active
GitHub Rust Apache-2.0

Description

BAML is an AI framework that adds engineering rigor to prompt engineering, offering type-safe prompt definitions, automatic testing, version management, and multi-model support across Python, TypeScript, Ruby, Java, C#, Rust, and Go.

Key Features

  • Type-safe prompt definition language that transforms prompt engineering into schema engineering
  • Built-in IDE plugins (VS Code / JetBrains) for rapid prompt testing and iteration
  • SAP (Schema-Aligned Parsing) algorithm for reliable structured output even without native tool-calling support
  • Switch between 100+ models (OpenAI, Anthropic, Gemini, Vertex, Bedrock, etc.) with a single line change
  • Fully type-safe streaming with React hooks for building streaming UIs
  • Runs completely offline, 100% open-source (Apache 2.0), no internet required

Use Cases

💡 Building AI workflows and agents requiring reliable structured outputs
💡 Rapidly iterating and testing prompts across different LLM models
💡 Unifying LLM prompt management across polyglot codebases
💡 Enabling structured outputs for models without native tool-calling support
💡 Building production-grade streaming AI application interfaces

Strengths & Limitations

Strengths

  • Actively maintained, recent updates
  • High community interest (9.0k stars)
  • Permissive open-source license (Apache-2.0)
  • Established track record (2 years in production)

Quick Start

Install: pip install baml-py. Define function signatures and prompts in .baml files specifying client and output types. Run `baml-cli generate` to create type-safe clients. Import baml_client in Python/TS/Go/Ruby to call BAML functions. Use IDE plugins for real-time prompt testing.

Related Projects

PostHog

37.7k · Python
Active B

PostHog is a full-stack observability platform for AI agents and self-driving products, combining analytics, session replay, feature flags and error tracking.

analyticssession-replayfeature-flags +3
  • · AI observability — Trace, token usage and diagnostic dashboards purpose-built for AI agents
  • · Session replay — Capture complete agent execution event streams for replay and debugging
  • · Feature flags & experiments — A/B testing and progressive rollouts coordinated with agent behavior