Skip to main content
A routing strategy is a set of rules your calls follow through the gateway. Your code sends model: "strategy/<id>", and Weflayr picks the model; edit the strategy and every call follows the new rules.

Create a strategy

Click New strategy, then start from a finished benchmark (its recommended models come set up) or from scratch.
  • Global routing rule: what every call follows. Dynamic routing picks, for each call, the model that meets your aim (Same quality, lowest cost or Best quality) among the models you select. Fixed order always tries your models in the order you set.
  • Routing overrides: exceptions to the global rule, checked from top to bottom: by Margin (a customer’s AI margin above or below a value), by Client cost (a customer’s spend), or for a Customer selection. Each override has its own rule and models.
  • Settings: Self-heal removes parameters a model does not take instead of failing the call, Skip unavailable or unhealthy models sets when to fall back to the next model, and Retry on error retries a model before falling back.
Overrides need the call’s customer: send weflayr.customer_name with each gateway call.

Use it in your code

Copy the strategy’s id from its page and send it as the model:
strategy/<id> follows the latest version. Pin one with strategy/<id>:<version>.

Versions and analytics

Every save creates a new version, listed under the version chip with History to restore an older one. The strategy page shows its setup and how its calls split across rules and models, with their cost, over the period you pick.