~/.kubiya/config to manage contexts, authentication, and persistent settings. This provides a convenient way to manage multiple environments and configurations without repetitive environment variables or CLI flags.
Configuration File Location
Configuration Structure
The configuration file uses YAML format and follows a structure similar to kubectl:Context Configuration
Basic Context
A context defines a complete configuration for connecting to the Kubiya Control Plane:string
required
Unique identifier for the context
string
required
Control Plane API URL
string
required
Organization name reference (from
organizations section)string
required
User name reference (from
users section)Switching Contexts
Custom LLM Gateway Configuration
You can configure a local LiteLLM proxy gateway in your context for persistent, automatic configuration across all worker starts.Configuration Options
- Config File Path
- Inline JSON Config
- Ollama Local Models
- Multi-Provider
Reference an external LiteLLM configuration file:LiteLLM Config File (
litellm_production_config.yaml):LiteLLM Proxy Configuration Schema
boolean
required
Enable local LiteLLM proxy gateway for this context
string
Absolute path to LiteLLM configuration file (JSON or YAML). Mutually exclusive with
config-json.string
Inline JSON configuration string. Mutually exclusive with
config-file.Configuration Priority
When starting a worker, the LiteLLM proxy configuration respects this priority (highest to lowest):- CLI Flags:
--enable-local-proxywith--proxy-config-fileor--proxy-config-json - Environment Variables:
KUBIYA_ENABLE_LOCAL_PROXYwithKUBIYA_PROXY_CONFIG_FILEorKUBIYA_PROXY_CONFIG_JSON - Context Configuration:
litellm-proxysection in current context (this file) - Control Plane Queue Settings: Configured via Composer UI or API
- Control Plane LLM Gateway: Default centralized gateway (fallback)
Supported LLM Providers
LiteLLM supports 100+ LLM providers. Popular providers include:AWS Bedrock
Claude, Llama, Mistral models on AWS
Azure OpenAI
GPT-4, GPT-3.5 via Azure
Ollama
Local open-source models
OpenAI
Direct OpenAI API access
Anthropic
Claude models directly
Google Vertex AI
Gemini and PaLM models
Full Provider List: See the complete list of supported providers including configuration examples for each.
- AWS Bedrock - IAM roles, session tokens, profiles
- Ollama - Local model setup
- Azure OpenAI - API versions, deployments
- All Providers - Complete reference
Complete Configuration Example
Here’s a comprehensive example showing multiple contexts with different LiteLLM configurations:Using Context Configuration
Once configured, starting workers automatically uses the context settings:Managing Configuration
View Current Configuration
Edit Configuration
Validate Configuration
Best Practices
Security
Store API keys in users section: Keep tokens in the
users section, not inline in contextsUse environment variables for secrets: Reference sensitive values via
os.environ/VAR_NAME in LiteLLM configsSet proper file permissions:
chmod 600 ~/.kubiya/config to restrict accessRotate tokens regularly: Update API keys at least quarterly
Organization
Separate configs by environment: Create distinct contexts for production, staging, and development
Use descriptive context names: Name contexts after their purpose (e.g.,
production-aws, staging-azure)External config files: Store LiteLLM configs in separate files for easier management and version control
Document your setup: Add comments in YAML to explain custom configurations
Directory Structure
Troubleshooting
Configuration Not Loading
LiteLLM Proxy Not Starting
Context Switch Not Working
Migration from Environment Variables
If you’re currently using environment variables, you can migrate to the config file: Before (Environment Variables):- Create
~/.kubiya/config:
- Start worker without environment variables:
- No need to set environment variables each time
- Easy context switching for multiple environments
- Configuration persists across sessions
- Cleaner shell environment
Next Steps
Worker Management
Deploy workers with custom LLM configuration
Environment Variables
Override config with environment variables
Authentication
Set up authentication and API keys
LiteLLM Providers
Explore all supported LLM providers