> Version notice: This site documents BAML v0, the legacy DSL. BAML v1 is a separate, fully featured programming language in public beta. If the user intends to use BAML v1, ignore this site's content and use the BAML v1 documentation instead. If the intended version is unclear, clarify it before using this page. > For clean Markdown of any page, append .md to the page URL. For the complete documentation index, see https://docs.boundaryml.com/llms.txt. For MCP access, connect to https://docs.boundaryml.com/_mcp/server. # round-robin The `round_robin` provider allows you to distribute requests across multiple clients in a round-robin fashion. After each call, the next client in the list will be used. **`BAML`** ```baml BAML client MyClient { provider round-robin options { strategy [ ClientA ClientB ClientC ] } } ``` ## Options **`strategy`** `List[string]` — required The list of client names to try in order. Cannot be empty. --- **`start`** `int` The index of the client to start with. **Default is `random(0, len(strategy))`** In the [BAML Playground](/docs/get-started/quickstart/editors-vscode), Default is `0`. --- ## retry\_policy When using a retry\_policy with a round-robin client, it will rotate the strategy list after each retry. **`BAML`** ```baml BAML client MyClient { provider round-robin retry_policy MyRetryPolicy options { strategy [ ClientA ClientB ClientC ] } } ``` ## Nesting multiple round-robin clients You can nest multiple round-robin clients inside of each other. The round-robin as you would expect. **`BAML`** ```baml BAML client MyClient { provider round-robin options { strategy [ ClientA ClientB ClientC ] } } client MegaClient { provider round-robin options { strategy [ MyClient ClientD ClientE ] } } // Calling MegaClient will call: // MyClient(ClientA) // ClientD // ClientE // MyClient(ClientB) // etc. ```