omar NOCD
07/28/2025, 5:31 AMfrom baml_py import Collector, ClientRegistry
prim_model = "NOCDGPT41Nano"
fallback_models = ["NOCDGPT4o","NOCDGPT41Mini"]
cr = ClientRegistry()
collector = Collector(name="fallback-collector-test")
cr.add_llm_client(name=prim_model,provider='fallback',options={
"strategy": list(fallback_models)
})
cr.set_primary(prim_model)
res = b.PingModelGPT41(" ",baml_options={"client_registry":cr})
The issue that I am having with this code is that every time I specify a primary model, BAML will always use the first fallback. Even when switching the given fallback with the primary model, it will still go use the first fallback meaning that BAML is just skipping using the primary model. Has anyone else experienced this? Please let me know. Thank you!aaronv (BAML)
07/28/2025, 5:59 AMaaronv (BAML)
07/28/2025, 5:59 AMomar NOCD
07/28/2025, 3:57 PMaaronv (BAML)
07/28/2025, 11:03 PMomar NOCD
07/29/2025, 3:33 PMomar NOCD
07/31/2025, 5:03 PMaaronv (BAML)
07/31/2025, 6:51 PMaaronv (BAML)
08/01/2025, 10:43 PMba11b0y
08/01/2025, 11:29 PMNOCDGPT41Nano as the first client which gets called
# Fallback client with multiple fallback models
cr.add_llm_client(name='FallbackClient', provider='fallback', options={
"strategy": ["NOCDGPT41Nano", "NOCDGPT4o", "NOCDGPT41Mini"],
})
# Set the primary client
cr.set_primary('FallbackClient')
res = b.PingModelGPT41(" ",baml_options={"client_registry":cr})ba11b0y
08/01/2025, 11:30 PMba11b0y
08/01/2025, 11:31 PMba11b0y
08/01/2025, 11:45 PM