Each generator that you define in your BAML project will tell baml-cli generate to generate code for a specific target language. You can define multiple generator clauses in your BAML project, and baml-cli generate will generate code for each of them.

If you created your project using baml-cli init, then one has already been generated for you!
1generator target {
2 output_type "python/pydantic"
3
4 // Where the generated code will be saved (relative to baml_src/)
5 output_dir "../"
6
7 // What interface you prefer to use for the generated code (sync/async)
8 // Both are generated regardless of the choice, just modifies what is exported
9 // at the top level
10 default_client_mode "sync"
11
12 // Version of runtime to generate code for (should match installed baml-py version)
13 version "0.76.2"
14}
Built with