Model Selection

Choose the right AI model for your agent

Choose the right AI model for your agent based on capabilities, speed, and cost.

Supported Providers

ArcanFlows supports multiple AI providers, giving you flexibility to choose the best model for your use case.

OpenAI

ModelContextBest ForSpeedCost
GPT-4 Turbo128KComplex reasoning, nuanced responsesMedium$$$$
GPT-48KHigh-quality responses, function callingMedium$$$$
GPT-3.5 Turbo16KGeneral purpose, fast responsesFast$$

Anthropic

ModelContextBest ForSpeedCost
Claude 3 Opus200KComplex analysis, long documentsSlow$$$$$
Claude 3 Sonnet200KBalanced performanceMedium$$$
Claude 3 Haiku200KFast responses, simple tasksFast$

Google

ModelContextBest ForSpeedCost
Gemini Ultra32KMultimodal, complex tasksMedium$$$$
Gemini Pro32KGeneral purposeFast$$

Ollama (Local)

ModelContextBest ForSpeedCost
Llama 3 70B8KHigh quality, privacyVariesFree
Llama 3 8B8KFast, resource efficientFastFree
Mistral 7B8KLightweight, efficientFastFree
Mixtral 8x7B32KGood balanceMediumFree

Choosing the Right Model

Decision Framework

                    ┌─────────────────┐
                    │ What's your     │
                    │ priority?       │
                    └────────┬────────┘
           ┌─────────────────┼─────────────────┐
           ▼                 ▼                 ▼
     ┌──────────┐      ┌──────────┐      ┌──────────┐
     │  Speed   │      │ Quality  │      │ Privacy  │
     └────┬─────┘      └────┬─────┘      └────┬─────┘
          ▼                 ▼                 ▼
    GPT-3.5 Turbo     GPT-4 Turbo        Ollama
    Claude Haiku      Claude Opus       (Local)
    Gemini Pro

By Use Case

Use CaseRecommended ModelWhy
Customer SupportGPT-3.5 TurboFast, cost-effective, good quality
Legal/MedicalGPT-4 TurboAccuracy is critical
Document AnalysisClaude 3 Opus200K context for long docs
ChatbotClaude 3 HaikuFast, conversational
Internal ToolsOllamaPrivacy, no API costs
Code AssistanceGPT-4 TurboBest code understanding

By Budget

Budget LevelRecommended Models
MinimalGPT-3.5 Turbo, Claude Haiku, Ollama
ModerateGPT-4, Claude Sonnet, Gemini Pro
EnterpriseGPT-4 Turbo, Claude Opus

Model Parameters

Temperature

Controls randomness in responses:

ValueBehaviorUse When
0.0Deterministic, consistentFacts, data retrieval
0.3Mostly consistentCustomer support
0.7Balanced (default)General conversation
1.0Creative, variedBrainstorming, content

Max Tokens

Limits response length:

javascript
// Short responses (quick answers)
max_tokens: 256

// Medium responses (explanations)
max_tokens: 1024

// Long responses (detailed analysis)
max_tokens: 4096

Top P (Nucleus Sampling)

Controls diversity:

ValueEffect
0.1Very focused, predictable
0.5Moderate diversity
0.9High diversity
1.0Consider all options (default)

Provider Configuration

OpenAI Setup

  1. Get your API key from platform.openai.com
  2. Go to Settings > AI Providers
  3. Click Add Provider > OpenAI
  4. Enter your API key
json
{
  "provider": "openai",
  "api_key": "sk-...",
  "organization_id": "org-..." // optional
}

Anthropic Setup

  1. Get your API key from console.anthropic.com
  2. Go to Settings > AI Providers
  3. Click Add Provider > Anthropic
  4. Enter your API key

Ollama Setup

For local models:

  1. Install Ollama on your server
  2. Pull models: ollama pull llama3
  3. Configure base URL in ArcanFlows
json
{
  "provider": "ollama",
  "base_url": "http://your-server:11434",
  "model": "llama3:70b"
}

Cost Optimization

Tips to Reduce Costs

  1. Start with cheaper models

    • Use GPT-3.5 for simple tasks
    • Upgrade only when needed
  2. Optimize prompts

    • Shorter prompts = lower costs
    • Remove unnecessary instructions
  3. Limit response length

    • Set appropriate max_tokens
    • Ask for concise responses in prompt
  4. Cache responses

    • Enable caching for repeated queries
    • Reduces API calls
  5. Use local models

    • Ollama for development
    • Ollama for privacy-sensitive data

Cost Comparison (approximate per 1M tokens)

ModelInputOutput
GPT-3.5 Turbo$0.50$1.50
GPT-4 Turbo$10$30
Claude 3 Haiku$0.25$1.25
Claude 3 Sonnet$3$15
Claude 3 Opus$15$75
OllamaFreeFree

Switching Models

You can switch models at any time:

  1. Go to your agent's settings
  2. Select Model tab
  3. Choose new provider and model
  4. Test the agent
  5. Publish changes

Note: Different models may respond differently to the same prompt. Always test after switching.

Next Steps