Overview
Model mapping allows you to route API requests for specific models (like GPT-4 or Claude) to your preferred Google AI models.Configuration
Custom Mapping
Custom exact model mapping tableMaps incoming model names to target Google AI models.Type:
Location:
HashMap<String, String>Location:
config.rs:491Mapping Examples
Basic Mapping
Route GPT-4 requests to Gemini Pro:Wildcard Mapping
Use wildcards for pattern matching:Preset Configurations
Antigravity provides built-in presets for common use cases:Default Preset
Balanced performance and cost:Performance Preset
Maximum quality, higher cost:Cost-Effective Preset
Minimum cost, good performance:z.ai Provider Integration
Route Claude requests to z.ai (GLM models):Enable z.ai provider integrationLocation:
config.rs:227z.ai API base URLLocation:
config.rs:228-229z.ai API keyLocation:
config.rs:231How to dispatch requests to z.aiOptions:
off: Never use z.aiexclusive: Use z.ai for all Anthropic protocol requestspooled: Treat z.ai as one slot in the shared poolfallback: Use z.ai only when Google pool is unavailable
config.rs:161-175z.ai Model Mapping
Per-model overrides for z.ai routingMaps Claude model IDs to z.ai model IDs.Type:
Location:
HashMap<String, String>Location:
config.rs:236-237Default z.ai model for Opus familyLocation:
config.rs:182Default z.ai model for Sonnet familyLocation:
config.rs:185Default z.ai model for Haiku familyLocation:
config.rs:188z.ai Configuration Example
Advanced Features
MCP (Model Context Protocol)
Enable advanced capabilities for z.ai models:Enable MCP featuresLocation:
config.rs:203Enable web search capabilityLocation:
config.rs:205Enable web content readingLocation:
config.rs:207Enable vision/image understandingLocation:
config.rs:209UI Configuration
You can configure model mappings through the Web UI:- Navigate to API Proxy settings
- Expand the Model Router section
- Select a preset or create custom mappings
- Click Apply to activate
Best Practices
- Test mappings with a small request before production use
- Use wildcards (
*) for flexible pattern matching - Consider cost vs. performance when choosing target models
- Save custom mappings as presets for easy switching
- Monitor token usage after changing mappings
Troubleshooting
Mapping Not Applied
- Verify the exact model name from client requests
- Check wildcard pattern syntax
- Ensure proxy service is running
- Review debug logs for routing decisions
Model Not Found
- Confirm target model exists in your accounts
- Check model availability in your region
- Verify account quota hasn’t been exhausted