Upgrading BAML / Fixing Version Mismatches

Remember that the generated baml_client code is generated by your baml_py / @boundaryml/baml package dependency (using baml-cli generate), but can also be generated by the VSCode extension when you save a BAML file.

To upgrade BAML versions:

  1. Update the generator clause in your generators.baml file (or wherever you have it defined) to the new version. If you ran baml-cli init, one has already been generated for you!
generators.baml
1generator TypescriptGenerator {
2 output_type "typescript"
3 ....
4 // Version of runtime to generate code for (should match the package @boundaryml/baml version)
5 version "0.62.0"
6}
  1. Update your baml_py / @boundaryml/baml package dependency to the same version.
1pip install --upgrade baml-py
  1. Update VSCode BAML extension to point to the same version. Read here for how to keep VSCode in sync with your baml_py / @boundaryml/baml package dependency: VSCode BAML Extension reference

You only need to do this for minor version upgrades (e.g., 0.54.0 -> 0.62.0), not patch versions (e.g., 0.62.0 -> 0.62.1).

Troubleshooting

See the VSCode BAML Extension reference for more information on how to prevent version mismatches.