Format Conversion and Smart Forwarding
PipeLLM Gateway’s core functionality is protocol conversion and smart forwarding. Use official SDKs (Anthropic, OpenAI, Google, etc.), we automatically convert requests to different platform protocols and convert responses back to your expected format. Biggest benefit: No new API to learn! Use familiar SDKs, we handle all protocol differences.🔄 How It Works
- Use native SDK (e.g., Anthropic)
- Send standard protocol request
- We convert to target platform format
- Target platform processes request
- We convert response back to your SDK format
- Your code unchanged
📊 Supported Protocol Conversions
1. Anthropic SDK ↔ Platforms
Use Anthropic’s official SDK, we handle protocol conversion. Example: Anthropic SDK → Bedrock| Your SDK | Target Platform | Conversion |
|---|---|---|
| Anthropic SDK | AWS Bedrock | Anthropic → Bedrock protocol |
| Anthropic SDK | Google Vertex | Anthropic → Vertex protocol |
| Anthropic SDK | Azure | Anthropic → Azure protocol |
| Anthropic SDK | Anthropic Official | Direct passthrough |
2. OpenAI SDK ↔ Platforms
Use OpenAI’s official SDK. Example: OpenAI SDK → Azure| Your SDK | Target Platform | Conversion |
|---|---|---|
| OpenAI SDK | Azure OpenAI | OpenAI → Azure protocol |
| OpenAI SDK | AWS Bedrock | OpenAI → Bedrock protocol |
| OpenAI SDK | Google Vertex | OpenAI → Vertex protocol |
| OpenAI SDK | OpenAI Official | Direct passthrough |
3. Google SDK ↔ Platforms
Use Google’s native libraries or standard Gemini API. Example: Gemini API → Vertex AI| Your SDK | Target Platform | Conversion |
|---|---|---|
| Gemini SDK | Google Vertex | Gemini → Vertex protocol |
| Gemini SDK | AWS Bedrock | Gemini → Bedrock protocol |
| Gemini SDK | Other Platforms | Gemini → Platform protocol |
🎯 Smart Forwarding Strategy
1. Auto Load Balancing
Choose best provider based on:- Availability: Real-time health monitoring
- Latency: Select fastest response
- Cost: Best value under quality guarantee
- Quota: Avoid single provider overload
2. Failover
If primary provider unavailable:3. Model Mapping
We maintain detailed model mapping:| Your Request Model | OpenAI | Anthropic | Gemini | AWS Bedrock |
|---|---|---|---|---|
gpt-4 | ✅ GPT-4 | ❌ | ❌ | ❌ |
gpt-3.5-turbo | ✅ | ❌ | ❌ | ❌ |
claude-3-sonnet | ❌ | ✅ | ❌ | ✅ |
gemini-pro | ❌ | ❌ | ✅ | ❌ |
auto | Smart selection |
- If specific model requested, use that model
- If
autoor generic name, choose best based on current status - If primary provider quota exhausted, auto switch to backup
⚙️ Advanced Configuration
1. Preferred Provider
Specify preferred provider via request header:openai- OpenAIanthropic- Anthropic Claudegoogle- Google Geminiazure- Azure OpenAIaws- AWS Bedrock
2. Force Provider
Bypass smart routing:3. Disable Format Conversion
Use native format directly:⚡ Performance Optimization
1. Zero Conversion Overhead
Format conversion has minimal overhead:- Request conversion: < 1ms
- Response conversion: < 1ms
- Total latency increase: < 2ms
2. Smart Caching
Automatic caching across providers:- Cross-provider caching (format independent)
- Smart cache key generation
- Auto cache refresh
3. Connection Reuse
- Long-lived connections
- Connection pool management
- Concurrent request optimization
🛠️ Developer Tools
1. Debug Mode
Enable debug mode to view conversion details:2. Performance Monitoring
Monitor via dashboard:- Provider usage statistics
- Conversion time analysis
- Cache hit rate
- Failover counts
📝 Usage Guidelines
1. Best Practices
Recommended:- Use standard OpenAI format
- Let gateway auto-select provider
- Use caching appropriately
- Implement retry logic
- Frequent provider switching
- Disable smart routing (unless necessary)
- Ignore error handling
2. Migration Guide
Step 1: Keep existing code unchanged- Adjust model selection based on needs
- Enable batch requests
- Configure monitoring alerts
🤝 Support
If you encounter format conversion issues:- Enable debug mode to get detailed information
- Check request logs to confirm conversion
- Contact support with debug information
Tip: In most cases, you don’t need to care about format conversion details. Our gateway handles everything automatically!