Skip to main content
The Kubiya CLI uses a kubectl-style configuration file located at ~/.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

The configuration file is created automatically when you first authenticate with the CLI. You can also create it manually.

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

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):
  1. CLI Flags: --enable-local-proxy with --proxy-config-file or --proxy-config-json
  2. Environment Variables: KUBIYA_ENABLE_LOCAL_PROXY with KUBIYA_PROXY_CONFIG_FILE or KUBIYA_PROXY_CONFIG_JSON
  3. Context Configuration: litellm-proxy section in current context (this file)
  4. Control Plane Queue Settings: Configured via Composer UI or API
  5. 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.
Provider-Specific Documentation:

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 contexts
Use environment variables for secrets: Reference sensitive values via os.environ/VAR_NAME in LiteLLM configs
Set proper file permissions: chmod 600 ~/.kubiya/config to restrict access
Rotate 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):
After (Configuration File):
  1. Create ~/.kubiya/config:
  1. Start worker without environment variables:
Benefits:
  • 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