Skip to content

Supported Providers

UniCraft supports a wide range of AI providers, allowing you to access multiple models through a single, unified interface.

ProviderStatusModelsPricingFeatures
OpenAI✅ ActiveGPT-4, GPT-3.5, EmbeddingsPay-per-tokenChat, Completions, Embeddings
Anthropic✅ ActiveClaude 3 Haiku, Sonnet, OpusPay-per-tokenChat, Completions
Google✅ ActiveGemini Pro, PaLM 2Pay-per-tokenChat, Completions, Embeddings
Cohere✅ ActiveCommand, EmbedPay-per-tokenChat, Completions, Embeddings
Hugging Face✅ ActiveVarious open modelsPay-per-tokenChat, Completions, Embeddings

OpenAI is one of the leading AI providers, offering state-of-the-art language 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
  • text-embedding-ada-002: General-purpose embeddings
  • text-embedding-3-small: Smaller, faster embeddings
  • text-embedding-3-large: Larger, more accurate embeddings
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,
};
  • 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 provides Claude models, known for their helpfulness and safety.

  • claude-3-opus: Most capable model for complex tasks
  • claude-3-sonnet: Balanced performance and cost
  • claude-3-haiku: Fast and cost-effective
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,
};
  • 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

Google provides Gemini and PaLM models through their AI Studio.

  • gemini-pro: General-purpose model
  • gemini-pro-vision: Multimodal model with vision capabilities
  • palm-2: Previous generation model
const googleProvider = {
name: "Google Production",
type: "google",
api_key: process.env.GOOGLE_API_KEY,
models: ["gemini-pro"],
priority: 3,
enabled: true,
};
  • 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 provides Command and Embed models for various use cases.

  • command: General-purpose chat model
  • command-light: Lighter version for faster responses
  • embed-english-v2.0: English embeddings
  • embed-multilingual-v2.0: Multilingual embeddings
const cohereProvider = {
name: "Cohere Production",
type: "cohere",
api_key: process.env.COHERE_API_KEY,
models: ["command", "command-light"],
priority: 4,
enabled: true,
};
  • Command: $0.001/1K input tokens, $0.002/1K output tokens
  • Embeddings: $0.0001/1K tokens

Hugging Face provides access to various open-source models.

  • meta-llama/Llama-2-70b-chat-hf: Llama 2 70B
  • mistralai/Mistral-7B-Instruct-v0.1: Mistral 7B
  • microsoft/DialoGPT-medium: DialoGPT
  • sentence-transformers/all-MiniLM-L6-v2: General-purpose embeddings
  • sentence-transformers/all-mpnet-base-v2: High-quality embeddings
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,
};
  • Varies by model and usage
  • Pay-per-token pricing
  • Some models available for free

UniCraft supports custom providers for specialized use cases.

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",
},
};
  1. Navigate to SettingsProviders
  2. Click Add Provider
  3. Select provider type
  4. Enter API credentials
  5. Configure models and settings
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,
}),
});
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,
}),
}
);
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);

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
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);

Configure automatic failover when providers are unavailable:

const failoverConfig = {
enabled: true,
primary_provider: "openai",
fallback_providers: ["anthropic", "google"],
retry_attempts: 3,
retry_delay: 1000,
};

Distribute requests across multiple providers:

const loadBalancer = {
strategy: "round_robin", // or "weighted", "least_connections"
weights: {
openai: 0.5,
anthropic: 0.3,
google: 0.2,
},
};
  • Use multiple providers for redundancy
  • Choose providers based on your use case
  • Consider cost vs. quality trade-offs
  • Set appropriate priorities
  • Configure rate limits
  • Enable health monitoring
  • Monitor provider status regularly
  • Set up alerts for provider issues
  • Track usage and costs
  • Store API keys securely
  • Use environment variables
  • Implement proper access controls
  1. Provider Not Available

    • Check API key validity
    • Verify provider status
    • Test connection
  2. Rate Limiting

    • Implement rate limiting
    • Use multiple providers
    • Monitor usage
  3. High Costs

    • Optimize model selection
    • Use cost-effective providers
    • Monitor spending
  4. Poor Performance

    • Check provider health
    • Optimize requests
    • Use appropriate models
  1. Test Connections: Test each provider individually
  2. Monitor Logs: Check provider logs for issues
  3. Use Health Checks: Regular health check monitoring
  4. Check Status: Monitor provider status dashboard

For provider-related support:

After setting up providers:

  1. Test All Providers: Test each provider individually
  2. Configure Failover: Set up automatic failover
  3. Monitor Performance: Set up monitoring and alerts
  4. Optimize Costs: Monitor and optimize spending
  5. Scale as Needed: Add more providers as needed