- Python
- TypeScript
User Targeting
Target specific users or segments to specific model variants. This is useful for:- Beta testing - Roll out new models to specific users first
- Enterprise features - Give premium users access to better models
- Gradual rollouts - Target by region, plan, or any custom attribute
How It Works
Targeting rules are evaluated client-side for zero latency:- Individual Targets - Exact match on
customerIdor any field - Rules - Condition-based targeting (all conditions in a rule must match)
- Fallback - If no targeting matches, use weighted random distribution
Configuration
Configure targeting in the dashboard when editing a model config:Supported Operators
Custom Model Providers
A/B test between standard API models and custom-hosted models (self-hosted, Novita, Together, Fireworks, Ollama, etc.).Dashboard Setup
Create a config with custom model names using any naming convention:Provider Routing
Create a helper function to route model IDs to the correct provider:- TypeScript
- Python
Full Example
- TypeScript
- Python
Use Cases
- Cost optimization - A/B test expensive vs cheap models
- Latency testing - Compare self-hosted vs API latency
- Gradual migration - Roll out new model providers safely
- Fallback routing - Scale custom models to 0% instantly if issues arise
Resilience Guarantees
Zero Latency
Targeting evaluated client-side, no network call
Background Sync
Config sync never blocks your requests
Graceful Degradation
Returns fallback on any error
Sticky Sessions
Same session always gets same model
Next Steps
Prompt Management
Test different prompts alongside model variants.
View Analytics
Analyze experiment results in your dashboard.

