Skip to main content
By default, workers use the Control Plane’s centralized LLM gateway. You can override this to run your own local LiteLLM proxy for:
  • Custom providers: AWS Bedrock, Azure OpenAI, Ollama, or 100+ other providers
  • Cost control: Use your own API keys and budgets
  • Observability: Track usage with Langfuse
  • Network isolation: Keep LLM traffic in your infrastructure
  • Offline operation: Run local models (Ollama) with no internet

How It Works

The CLI starts a local LiteLLM proxy process that intercepts all LLM requests from the worker:
  1. CLI starts proxy on 127.0.0.1:<auto-port>
  2. Worker environment gets LITELLM_API_BASE pointing to local proxy
  3. All LLM requests go through your local proxy instead of Control Plane
  4. Proxy forwards to your configured provider (AWS/Azure/Ollama/etc.)
No code changes needed - the proxy is OpenAI-compatible.

Supported Providers

LiteLLM supports 100+ providers. Most commonly used: Cloud Providers:
  • AWS Bedrock (Claude, Llama, Mistral)
  • Azure OpenAI (GPT-4, GPT-3.5)
  • GCP Vertex AI (Gemini, PaLM)
  • OpenAI, Anthropic, Cohere, Mistral AI
Local/Self-Hosted:
  • Ollama (Llama, Mistral, CodeLlama)
  • vLLM, LocalAI, LM Studio
  • Hugging Face TGI
See full list: https://docs.litellm.ai/docs/providers

Configuration Methods

You can configure the custom LLM gateway in 4 ways (in priority order):

1. CLI Flags (Highest Priority)

Override everything with command-line flags:

2. Environment Variables

Set once, use everywhere:

3. Context Configuration

Persistent configuration in ~/.kubiya/config - just add litellm-proxy to your current context:
Once configured, starting any worker automatically uses this LiteLLM configuration. See Configuration File for complete details.

4. Control Plane Queue Settings

Configure via Composer UI for shared team configuration.

5. Control Plane Gateway (Default Fallback)

If nothing is configured, workers use the centralized Control Plane gateway.

Provider Configuration Examples

AWS Bedrock (Claude)

Create litellm_bedrock.yaml:
AWS Bedrock Authentication: Supports IAM roles, access keys, session tokens, profiles, and more. See AWS Bedrock Provider Docs for all auth methods.

Ollama (Local Models)

Run completely offline with open-source models:
Create litellm_ollama.json:
Ollama Benefits: Perfect for development, privacy-sensitive workloads, air-gapped environments, or cost-free experimentation. See Ollama Provider Docs.

Azure OpenAI

Create litellm_azure.yaml:

Multi-Provider (Fallback & Load Balancing)

Configure multiple providers for reliability and cost optimization:

LiteLLM Configuration Reference

Model List Structure

Each model in model_list requires:
string
required
User-facing model name used in requests (e.g., “gpt-4”, “claude-3-opus”)
object
required
Parameters passed to LiteLLM:
  • model: Provider-specific model identifier (e.g., “azure/gpt-4”, “bedrock/claude-3-opus”)
  • api_key: API key (use os.environ/VAR_NAME for environment variables)
  • api_base: API endpoint URL (for Azure, self-hosted, etc.)
  • Provider-specific params (region, version, etc.)

LiteLLM Settings

object
Global settings for the proxy:
  • success_callback: List of callbacks on success (e.g., ["langfuse"])
  • failure_callback: List of callbacks on failure
  • drop_params: Drop extra params not supported by provider
  • num_retries: Number of retry attempts on failure
  • timeout: Request timeout in seconds

Environment Variables

object
Environment variables for the proxy process (API keys, Langfuse config, etc.)

Complete Schema Example

Observability with Langfuse

Track LLM usage, costs, and performance by adding Langfuse to your config:
This gives you:
  • Token usage and cost per model
  • Request latency and success rates
  • Error tracking
  • Per-user analytics
View metrics at https://cloud.langfuse.com (sign up at langfuse.com)

Advanced Features

Rate Limiting

Caching

Load Balancing

Custom Metadata

Troubleshooting

Proxy Won’t Start

Worker Not Using Local Proxy

Authentication Errors

Model Not Found

Performance Issues

Best Practices

Security:
  • Use environment variables for API keys (never hardcode)
  • Restrict file permissions: chmod 600 ~/.kubiya/litellm_*.yaml
  • Rotate credentials regularly
  • Use IAM roles when possible (AWS Bedrock on EC2/ECS)
Cost Optimization:
  • Use cheaper models for simple tasks
  • Enable caching to avoid duplicate requests
  • Set rate limits to prevent runaway costs
  • Monitor usage with Langfuse
Reliability:
  • Configure fallback models across providers
  • Set appropriate timeouts
  • Enable retries for transient failures
  • Monitor proxy logs
Development Workflow:
  1. Start with Ollama for local dev (free, fast)
  2. Test with staging before production
  3. Enable Langfuse early
  4. Use context configuration for environment switching

Examples by Use Case

Development Environment (Local Ollama)

Quick setup for local development:

Staging Environment (Azure OpenAI)

Create separate config file for staging:

Production Environment (AWS Bedrock)

Production setup with Langfuse observability: