Skip to main content
Koog supports multiple LLM providers, each with unique strengths and capabilities. This guide helps you choose the right provider for your use case.

Supported Providers

ProviderStrengthsUse CasesPricing
OpenAIMost capable models, cutting-edge featuresProduction apps, complex reasoning$$ - $$$$
AnthropicStrong reasoning, long contextDocument analysis, research$$ - $$$$
GoogleMultimodal, large context windowsVision tasks, audio processing$$ - $$$
OllamaFree, local deployment, privacyDevelopment, offline appsFree
OpenRouterAccess to 100+ models, fallbacksMulti-model routing, cost optimization$ - $$$
DeepSeekCost-effective, good performanceBudget-conscious production$ - $$
BedrockEnterprise features, AWS integrationEnterprise deployments$$ - $$$

Quick Comparison

Best for Production

  • OpenAI: Industry-leading models with extensive tooling
  • Anthropic: Strong safety guarantees and reliability
  • Bedrock: Enterprise compliance and AWS ecosystem

Best for Development

  • Ollama: Free local testing with popular open-source models
  • OpenRouter: Test multiple providers without managing API keys

Best for Cost

  • DeepSeek: Competitive pricing with good quality
  • OpenRouter: Route to cheapest provider for each request
  • Ollama: Completely free for local deployment

Best for Specific Features

  • Vision: Google (Gemini), OpenAI (GPT-4o)
  • Long Context: Google (1M tokens), Anthropic (200K tokens)
  • Reasoning: OpenAI (o-series), Anthropic (Claude Opus)
  • Code Generation: OpenAI (GPT-5 Codex), DeepSeek

Common Usage Patterns

Multi-Provider Strategy

val productionExecutor = simpleOpenAIExecutor(
    apiKey = System.getenv("OPENAI_API_KEY"),
    model = OpenAIModels.Chat.GPT4o
)

val devExecutor = simpleOllamaExecutor(
    baseUrl = "http://localhost:11434",
    model = OllamaModels.Meta.LLAMA_3_2
)

val executor = if (inProduction) productionExecutor else devExecutor

Fallback Chain with OpenRouter

val executor = simpleOpenRouterExecutor(
    apiKey = System.getenv("OPENROUTER_API_KEY"),
    model = LLModel(
        provider = LLMProvider.OpenRouter,
        id = "anthropic/claude-3.5-sonnet"
    ),
    params = OpenRouterParams(
        // Fallback to cheaper model on failure
        models = listOf(
            "anthropic/claude-3.5-sonnet",
            "anthropic/claude-3-haiku"
        )
    )
)

Provider Selection Guide

Choose OpenAI if:

  • You need the most capable models available
  • You require advanced features (function calling, structured outputs)
  • You’re building a production application with budget for API costs
  • You need extensive documentation and community support

Choose Anthropic if:

  • Long context windows are critical (200K tokens)
  • You need strong reasoning and analysis capabilities
  • Safety and refusal behavior are important
  • Document processing is a primary use case

Choose Google if:

  • You need multimodal capabilities (vision, audio)
  • Very long context is required (1M tokens)
  • You want to process videos or images
  • You’re already in the Google Cloud ecosystem

Choose Ollama if:

  • You’re developing locally without API costs
  • Privacy and data sovereignty are critical
  • You need offline capability
  • You want to experiment with open-source models

Choose OpenRouter if:

  • You want access to many providers through one API
  • You need automatic failover between providers
  • Cost optimization across providers is important
  • You want to experiment without multiple API keys

Choose DeepSeek if:

  • Budget is a primary constraint
  • You need good performance at lower cost
  • Code generation is a primary use case
  • You want an alternative to major providers

Choose Bedrock if:

  • You need enterprise compliance (HIPAA, SOC2)
  • You’re already using AWS services
  • You require AWS Guardrails for content filtering
  • Multiple model families with consistent API appeal to you

Feature Support Matrix

FeatureOpenAIAnthropicGoogleOllamaOpenRouterDeepSeekBedrock
Function Calling
Structured Output
Vision
Streaming
Embeddings
Moderation
Audio
Max Context400K200K1MVariesVaries32KVaries

Next Steps

OpenAI

Industry-leading models with extensive capabilities

Anthropic

Strong reasoning and long context windows

Google

Multimodal models with massive context

Ollama

Free local deployment for development

OpenRouter

Access 100+ models through one API

DeepSeek

Cost-effective AI with good performance

Bedrock

Enterprise AI on AWS infrastructure

Build docs developers (and LLMs) love