Supported Providers
Supported Providers
Section titled “Supported Providers”UniCraft supports a wide range of AI providers, allowing you to access multiple models through a single, unified interface.
Provider Overview
Section titled “Provider Overview”| Provider | Status | Models | Pricing | Features |
|---|---|---|---|---|
| OpenAI | ✅ Active | GPT-4, GPT-3.5, Embeddings | Pay-per-token | Chat, Completions, Embeddings |
| Anthropic | ✅ Active | Claude 3 Haiku, Sonnet, Opus | Pay-per-token | Chat, Completions |
| ✅ Active | Gemini Pro, PaLM 2 | Pay-per-token | Chat, Completions, Embeddings | |
| Cohere | ✅ Active | Command, Embed | Pay-per-token | Chat, Completions, Embeddings |
| Hugging Face | ✅ Active | Various open models | Pay-per-token | Chat, Completions, Embeddings |
OpenAI
Section titled “OpenAI”Overview
Section titled “Overview”OpenAI is one of the leading AI providers, offering state-of-the-art language models.
Supported Models
Section titled “Supported Models”Chat Models
Section titled “Chat Models”- gpt-4: Most capable model for complex tasks
- gpt-4-turbo: Faster version of GPT-4
- gpt-3.5-turbo: Cost-effective model for most tasks
- gpt-3.5-turbo-16k: Extended context version
Embedding Models
Section titled “Embedding Models”- text-embedding-ada-002: General-purpose embeddings
- text-embedding-3-small: Smaller, faster embeddings
- text-embedding-3-large: Larger, more accurate embeddings
Configuration
Section titled “Configuration”const openaiProvider = { name: "OpenAI Production", type: "openai", api_key: process.env.OPENAI_API_KEY, models: ["gpt-4", "gpt-3.5-turbo"], priority: 1, enabled: true,};Pricing (as of 2024)
Section titled “Pricing (as of 2024)”- GPT-4: $0.03/1K input tokens, $0.06/1K output tokens
- GPT-3.5-turbo: $0.001/1K input tokens, $0.002/1K output tokens
- Embeddings: $0.0001/1K tokens
Anthropic
Section titled “Anthropic”Overview
Section titled “Overview”Anthropic provides Claude models, known for their helpfulness and safety.
Supported Models
Section titled “Supported Models”Chat Models
Section titled “Chat Models”- claude-3-opus: Most capable model for complex tasks
- claude-3-sonnet: Balanced performance and cost
- claude-3-haiku: Fast and cost-effective
Configuration
Section titled “Configuration”const anthropicProvider = { name: "Anthropic Production", type: "anthropic", api_key: process.env.ANTHROPIC_API_KEY, models: ["claude-3-sonnet", "claude-3-haiku"], priority: 2, enabled: true,};Pricing (as of 2024)
Section titled “Pricing (as of 2024)”- Claude 3 Opus: $0.015/1K input tokens, $0.075/1K output tokens
- Claude 3 Sonnet: $0.003/1K input tokens, $0.015/1K output tokens
- Claude 3 Haiku: $0.00025/1K input tokens, $0.00125/1K output tokens
Overview
Section titled “Overview”Google provides Gemini and PaLM models through their AI Studio.
Supported Models
Section titled “Supported Models”Chat Models
Section titled “Chat Models”- gemini-pro: General-purpose model
- gemini-pro-vision: Multimodal model with vision capabilities
- palm-2: Previous generation model
Configuration
Section titled “Configuration”const googleProvider = { name: "Google Production", type: "google", api_key: process.env.GOOGLE_API_KEY, models: ["gemini-pro"], priority: 3, enabled: true,};Pricing (as of 2024)
Section titled “Pricing (as of 2024)”- Gemini Pro: $0.0005/1K input tokens, $0.0015/1K output tokens
- PaLM 2: $0.0005/1K input tokens, $0.0015/1K output tokens
Cohere
Section titled “Cohere”Overview
Section titled “Overview”Cohere provides Command and Embed models for various use cases.
Supported Models
Section titled “Supported Models”Chat Models
Section titled “Chat Models”- command: General-purpose chat model
- command-light: Lighter version for faster responses
Embedding Models
Section titled “Embedding Models”- embed-english-v2.0: English embeddings
- embed-multilingual-v2.0: Multilingual embeddings
Configuration
Section titled “Configuration”const cohereProvider = { name: "Cohere Production", type: "cohere", api_key: process.env.COHERE_API_KEY, models: ["command", "command-light"], priority: 4, enabled: true,};Pricing (as of 2024)
Section titled “Pricing (as of 2024)”- Command: $0.001/1K input tokens, $0.002/1K output tokens
- Embeddings: $0.0001/1K tokens
Hugging Face
Section titled “Hugging Face”Overview
Section titled “Overview”Hugging Face provides access to various open-source models.
Supported Models
Section titled “Supported Models”Chat Models
Section titled “Chat Models”- meta-llama/Llama-2-70b-chat-hf: Llama 2 70B
- mistralai/Mistral-7B-Instruct-v0.1: Mistral 7B
- microsoft/DialoGPT-medium: DialoGPT
Embedding Models
Section titled “Embedding Models”- sentence-transformers/all-MiniLM-L6-v2: General-purpose embeddings
- sentence-transformers/all-mpnet-base-v2: High-quality embeddings
Configuration
Section titled “Configuration”const huggingfaceProvider = { name: "Hugging Face Production", type: "huggingface", api_key: process.env.HUGGINGFACE_API_KEY, models: ["meta-llama/Llama-2-70b-chat-hf"], priority: 5, enabled: true,};Pricing (as of 2024)
Section titled “Pricing (as of 2024)”- Varies by model and usage
- Pay-per-token pricing
- Some models available for free
Custom Providers
Section titled “Custom Providers”Overview
Section titled “Overview”UniCraft supports custom providers for specialized use cases.
Configuration
Section titled “Configuration”const customProvider = { name: "Custom Provider", type: "custom", base_url: "https://your-api.com/v1", api_key: process.env.CUSTOM_API_KEY, models: ["custom-model"], priority: 6, enabled: true, headers: { Authorization: "Bearer your-token", "Custom-Header": "value", },};Provider Management
Section titled “Provider Management”Adding Providers
Section titled “Adding Providers”Via Dashboard
Section titled “Via Dashboard”- Navigate to Settings → Providers
- Click Add Provider
- Select provider type
- Enter API credentials
- Configure models and settings
Via API
Section titled “Via API”const provider = await fetch("https://api.unicraft.com/v1/providers", { method: "POST", headers: { Authorization: "Bearer your-unicraft-api-key", "Content-Type": "application/json", }, body: JSON.stringify({ name: "OpenAI Production", type: "openai", api_key: process.env.OPENAI_API_KEY, models: ["gpt-4", "gpt-3.5-turbo"], priority: 1, enabled: true, }),});Updating Providers
Section titled “Updating Providers”const updatedProvider = await fetch( "https://api.unicraft.com/v1/providers/provider_123", { method: "PUT", headers: { Authorization: "Bearer your-unicraft-api-key", "Content-Type": "application/json", }, body: JSON.stringify({ priority: 2, enabled: false, }), });Testing Providers
Section titled “Testing Providers”const testResult = await fetch( "https://api.unicraft.com/v1/providers/provider_123/test", { method: "POST", headers: { Authorization: "Bearer your-unicraft-api-key", }, });
const result = await testResult.json();console.log("Test result:", result);Provider Status
Section titled “Provider Status”Health Checks
Section titled “Health Checks”UniCraft automatically monitors provider health:
- Available: Provider is responding normally
- Degraded: Provider is responding but with issues
- Unavailable: Provider is not responding
- Rate Limited: Provider is rate limiting requests
Status Monitoring
Section titled “Status Monitoring”const status = await fetch("https://api.unicraft.com/v1/providers/status", { headers: { Authorization: "Bearer your-unicraft-api-key", },});
const providerStatus = await status.json();console.log("Provider status:", providerStatus);Failover and Redundancy
Section titled “Failover and Redundancy”Automatic Failover
Section titled “Automatic Failover”Configure automatic failover when providers are unavailable:
const failoverConfig = { enabled: true, primary_provider: "openai", fallback_providers: ["anthropic", "google"], retry_attempts: 3, retry_delay: 1000,};Load Balancing
Section titled “Load Balancing”Distribute requests across multiple providers:
const loadBalancer = { strategy: "round_robin", // or "weighted", "least_connections" weights: { openai: 0.5, anthropic: 0.3, google: 0.2, },};Best Practices
Section titled “Best Practices”1. Provider Selection
Section titled “1. Provider Selection”- Use multiple providers for redundancy
- Choose providers based on your use case
- Consider cost vs. quality trade-offs
2. Configuration
Section titled “2. Configuration”- Set appropriate priorities
- Configure rate limits
- Enable health monitoring
3. Monitoring
Section titled “3. Monitoring”- Monitor provider status regularly
- Set up alerts for provider issues
- Track usage and costs
4. Security
Section titled “4. Security”- Store API keys securely
- Use environment variables
- Implement proper access controls
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”-
Provider Not Available
- Check API key validity
- Verify provider status
- Test connection
-
Rate Limiting
- Implement rate limiting
- Use multiple providers
- Monitor usage
-
High Costs
- Optimize model selection
- Use cost-effective providers
- Monitor spending
-
Poor Performance
- Check provider health
- Optimize requests
- Use appropriate models
Debug Tips
Section titled “Debug Tips”- Test Connections: Test each provider individually
- Monitor Logs: Check provider logs for issues
- Use Health Checks: Regular health check monitoring
- Check Status: Monitor provider status dashboard
Support
Section titled “Support”For provider-related support:
- Documentation: UniCraft Docs
- Provider Status: UniCraft Status Page
- Community: UniCraft Community
- Support: support@unicraft.com
Next Steps
Section titled “Next Steps”After setting up providers:
- Test All Providers: Test each provider individually
- Configure Failover: Set up automatic failover
- Monitor Performance: Set up monitoring and alerts
- Optimize Costs: Monitor and optimize spending
- Scale as Needed: Add more providers as needed