vicentereig/sorbet-baml
A Ruby gem that converts T::Struct and T::Enum to BAML (Boundary AI Markup Language) type definitions. BAML uses 60% fewer tokens than JSON Schema while maintaining type safety.
What's novel
A Ruby gem that converts T::Struct and T::Enum to BAML (Boundary AI Markup Language) type definitions. BAML uses 60% fewer tokens than JSON Schema while maintaining type safety.
Code Analysis
11 files read · 7 roundsConverts Sorbet T::Struct and T::Enum type definitions into BAML (Boundary AI Markup Language) format for more efficient LLM prompting with automatic dependency resolution and field description extraction.
Strengths
Clean separation of concerns with dedicated modules for conversion, type mapping, and dependency resolution. Excellent README accuracy showing real examples. Smart defaults that automatically include dependencies and descriptions. Good handling of complex types including unions, arrays, hashes, and nested structs.
Weaknesses
Limited test coverage visible - only basic converter tests shown, no evidence of edge case testing for circular dependencies or complex union scenarios. Some error handling could be more robust (e.g., missing dependency resolution).
Score Breakdown
Signal breakdown
Innovation
Craft
Traction
Scope
Evidence
Commits
53
Contributors
2
Files
164
Active weeks
6
Repository
Language
Ruby
Stars
8
Forks
1
License
MIT