Skip to main content

Overview

Model routing allows you to map incoming model requests to different backend models. This enables seamless integration with existing tools while leveraging the best available models.

Custom Mappings

Adding Mappings

Create custom model mappings in the API Proxy settings:
1

Navigate to Model Router

Open API ProxyModel Router & Mapping
2

Add Mapping

Select the source model pattern and target model from the dropdowns.
3

Apply Changes

Click Add Mapping to save the configuration.

Wildcard Patterns

Use wildcards for flexible routing:
Wildcard matching is case-insensitive and uses suffix/prefix matching.

Preset Configurations

Antigravity includes several built-in presets for common use cases:

Default Preset

Balanced performance and compatibility:

Performance Preset

Maximize response quality:

Cost-Effective Preset

Optimize for quota consumption:

Applying Presets

Presets merge with existing custom mappings without overwriting unrelated entries.

Custom Presets

Save your current mappings as a reusable preset:
1

Configure Mappings

Set up your desired model mappings in the router.
2

Open Preset Manager

Click Save as Preset in the Model Router section.
3

Name Your Preset

Enter a descriptive name and optional description.
4

Save

Click Save Preset to add it to your collection.

Dynamic Model Forwarding

Automatic forwarding for deprecated models:
Dynamic forwarding rules are automatically synchronized from account quota data.

Tiered Routing

Intelligent routing based on account tiers:
The routing system prioritizes:
  1. Ultra Accounts: Highest tier, best quota resets
  2. Pro Accounts: Mid-tier with good quotas
  3. Free Accounts: Basic tier, limited quotas

Background Request Detection

Automatic downgrading for background tasks:
Background task detection is based on request patterns and may not catch all cases.

Model Normalization

Standardize model identifiers:

Quota Protection Integration

Model routing respects quota protection settings:

Resetting Mappings

Reset all custom mappings to defaults:
Resetting mappings will remove all custom and preset configurations.

Best Practices

  1. Use Wildcards Wisely: Pattern gpt-4* catches all GPT-4 variants
  2. Test Mappings: Verify mappings work with your specific tools
  3. Save Presets: Save working configurations before experimenting
  4. Monitor Quotas: Check quota usage after changing mappings
  5. Document Custom Presets: Add descriptions to remember mapping purposes