Adam B
04/13/2026, 11:56 AMbaml-schema-wasm compiles the full runtime to WASM and already makes real LLM calls (the playground uses it). The gap is that it exposes a playground/IDE API rather than the `callFunction`/`streamFunction`/`TypeBuilder` etc. API that the generated client code expects.
My rough read on what's left:
- Add callFunction, streamFunction, buildRequest, TypeBuilder, ClientRegistry, RuntimeContextManager as #[wasm_bindgen] exports to baml-schema-wasm (the pattern is already there via run_tests)
- A thin wasm-entry.js shim in language_client_typescript that initialises the WASM and re-exports everything under the same interface as the NAPI module
- package.json export conditions (workerd, browser) pointing at the shim
- A couple of small process.env / process.on guards in async_context_vars.ts
- wasm-pack build wired into the publish pipeline alongside the existing napi build
Before I start digging in I wanted to ask:
1. Is this actually wanted? Don't want to open a big PR into a dead end
2. Is baml-schema-wasm the right place to add these bindings or should they live in a new crate?
3. Any known blockers I've missed - e.g. WASM binary size concerns, streaming edge cases?
4. Preferred way to contribute - draft PR early, or work something out in an issue first?
Happy to take a stab at the Rust bindings side if the direction is clear.aaronv (BAML)
04/13/2026, 4:36 PMaaronv (BAML)
04/13/2026, 4:36 PMaaronv (BAML)
04/13/2026, 4:36 PMaaronv (BAML)
04/13/2026, 4:37 PMgenerator made for it yet in compilerv2aaronv (BAML)
04/13/2026, 4:37 PMaaronv (BAML)
04/13/2026, 4:39 PMAdam B
04/14/2026, 8:25 AMAdam B
04/14/2026, 8:37 AMbridge_wasm? Don't want to duplicate work there.baml-sam
04/14/2026, 6:01 PMbaml-sam
04/14/2026, 6:02 PMbaml-sam
04/14/2026, 6:03 PMAdam B
04/15/2026, 9:53 AMbaml-sam
04/17/2026, 11:56 PM