UniCraft N8N custom nodes - Unified AI Model Router with Multi-Modal Support by CloudCraft Labs for OpenAI, Anthropic, Google Gemini, and more
npm install n8n-nodes-unicraftUnified AI Model Router by CloudCraft Labs - N8N Integration
UniCraft N8N custom nodes provide seamless integration with the UniCraft AI Model Router, enabling you to use multiple AI providers (OpenAI, Anthropic, Google Gemini, Cohere, Mistral, Groq, Together AI, Perplexity AI) through a single, intelligent interface with Smart Routing and Multi-Modal capabilities.
1. Install the package:
``bash`
npm install n8n-nodes-unicraft
2. Restart N8N to load the new nodes
3. Configure credentials:
- Go to N8N Settings → Credentials
- Add "UniCraft API" credential
- Enter your UniCraft API key and base URL
`json`
{
"operation": "Chat Completion",
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"temperature": 0.7,
"maxTokens": 1000
}
`json`
{
"operation": "Chat Completion",
"useSmartRouting": true,
"smartRoutingStrategy": "cost_optimized",
"priority": "normal",
"messages": [
{
"role": "user",
"content": "Explain quantum computing"
}
]
}
`json`
{
"operation": "Smart Chat Completion",
"smartRoutingStrategy": "performance_optimized",
"priority": "high",
"messages": [
{
"role": "user",
"content": "Write a Python function to sort a list"
}
]
}
`json`
{
"operation": "Get Optimal Model",
"strategy": "balanced",
"inputLength": 500,
"priority": "normal"
}
`json`
{
"operation": "Set Routing Config",
"routingStrategy": "cost_optimized",
"maxCostPer1KTokens": 0.005,
"maxResponseTime": 5000,
"preferredProviders": ["openai", "anthropic"],
"blockedProviders": []
}
)📊 Response Formats
$3
`json
{
"message": "Hello! I'm doing well, thank you for asking."
}
`$3
`json
{
"message": "Hello! I'm doing well, thank you for asking.",
"model": "gpt-3.5-turbo",
"usage": {
"prompt_tokens": 10,
"completion_tokens": 15,
"total_tokens": 25
},
"smartRouting": {
"strategy": "cost_optimized",
"selectedModel": "gpt-3.5-turbo"
}
}
`$3
`json
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "gpt-3.5-turbo",
"choices": [...],
"usage": {...}
}
`🎨 Smart Routing Workflows
$3
1. Use UniCraft Smart Routing node to configure cost optimization
2. Use UniCraft Chat with smart routing enabled
3. Monitor cost savings with analytics$3
1. Configure performance optimization strategy
2. Set high priority for time-sensitive requests
3. Use dedicated smart chat completion for best results$3
1. List available models with UniCraft Models node
2. Configure provider preferences
3. Use smart routing to automatically select the best provider🔍 Advanced Features
$3
- Preferred Providers: Set preferred providers for routing
- Blocked Providers: Exclude specific providers
- Provider Analytics: Track performance by provider$3
- Cost Limits: Set maximum cost per 1K tokens
- Cost Tracking: Monitor spending across providers
- Cost Optimization: Automatic selection of cost-effective models$3
- Response Time Tracking: Monitor response times
- Success Rate Monitoring: Track request success rates
- Performance Analytics: Detailed performance metrics🚨 Error Handling
The nodes include comprehensive error handling:
- API Errors: Proper error messages for API failures
- Validation Errors: Input validation with helpful messages
- Network Errors: Retry logic for network issues
- Rate Limiting: Automatic handling of rate limits
📈 Analytics and Monitoring
$3
- Total requests processed
- Cost savings achieved
- Average response times
- Success rates by provider
- Strategy performance metrics$3
- Token usage by model
- Cost breakdown by provider
- Request patterns and trends
- Performance optimization opportunities🤖 AI Agent Integration
$3
The new UniCraft AI Agent node provides a complete AI agent solution with advanced features:
#### Memory Management:
- Conversation Buffer: Maintain complete conversation history
- Conversation Summary: Summarize history to save tokens
- Token Buffer: Keep history within token limits
- Conversation Window: Keep only recent N messages
- No Memory: Stateless operation
#### Tools Integration:
- Define custom tools/functions for the agent
- JSON schema parameter validation
- Automatic tool calling based on context
- Support for external API endpoints
#### Agent Types:
- Conversational: Basic conversational agent with memory
- Tool-Enabled: Agent with access to tools/functions
- Smart Routing: Agent with intelligent model selection
- Custom: Fully customizable agent configuration
$3
The UniCraft Chat Model node is designed to work seamlessly with N8N's AI Agent system:
#### Configuration Options:
- Manual Selection: Choose specific models for consistent behavior
- Smart Routing: Let the system automatically select the best model
#### Smart Routing for AI Agents:
`json
{
"modelSelection": "smart",
"smartRoutingStrategy": "cost_optimized",
"priority": "normal",
"temperature": 0.7
}
``#### Benefits for AI Agents:
- Automatic Optimization: AI Agents automatically get the best model
- Cost Efficiency: Smart routing reduces costs for AI Agent operations
- Performance: Optimal model selection for different agent tasks
- Reliability: Automatic failover and provider management
If you're upgrading from v1 of the nodes:
1. Backup your workflows before upgrading
2. Update node configurations to use new smart routing features
3. Test workflows with the new functionality
4. Configure smart routing for optimal performance
5. Update AI Agent configurations to use smart routing
- Documentation: UniCraft Documentation
- Support: support@cloudcraftlabs.io
- GitHub: Report Issues
MIT License - see LICENSE file for details.
Contributions are welcome! Please see our Contributing Guidelines for details.
---
Made with ❤️ by CloudCraft Labs