Examples

Quick, focused routing patterns you can copy and adapt.

This directory contains focused, practical examples of LangDB's routing capabilities. Each example demonstrates a specific routing pattern that you can adapt for your use case.

Quick Examples

Example
Description
Use Case

Route users to different models based on their subscription tier

SaaS applications with premium/standard tiers

Enforce usage quotas and route accordingly

Prevent abuse, manage costs

Route to specialized models based on content topic

Content-specific optimization

Distribute requests across multiple models

High availability, performance

How to Use These Examples

  1. Copy the JSON configuration from any example

  2. Modify the conditions and targets to match your requirements

  3. Test with your specific use case

  4. Combine multiple patterns for complex routing scenarios

Advanced Examples

For more complex, multi-layered routing configurations, see:

Example: Building an Enterprise Routing ConfigurationExample: Routing with Interceptors and Compliance

Last updated

Was this helpful?