Skip to content

Deploying LiteLLM

This page provides instructions for deploying LiteLLM as a prerequisite service for HCL Digital Experience (DX) IQ. LiteLLM acts as a unified proxy and gateway to manage access to LLM providers such as AWS Bedrock, OpenAI, and Anthropic while abstracting provider differences into a unified API. It handles API key rotation and authentication, supports multiple concurrent model configurations, and tracks usage for observability.

Before you can install the DX IQ backend services, you must configure the following LiteLLM proxy models:

Alias Description
iq-general-purpose A premium model (such as Claude Sonnet or Opus) for general inquiries and tool execution.
iq-summary A cost-efficient model (such as Claude Haiku) for conversation summarization.

Tested models

DX IQ is tested and validated with the following models:

  • Claude Sonnet 4.6 and Claude Sonnet 5.5 for iq-general-purpose
  • Claude Haiku 4.5 for iq-summary

The examples in this topic use Claude Sonnet 4.6, which performed better in testing.

While alternative LLM models may work, compatibility is not guaranteed. Due to the rapidly evolving nature of AI model releases, newer models may introduce parameter changes or tool calling behavior incompatibilities. Thoroughly test any alternative configuration before production use. Update the proxy_config.model_list in your litellm-values.yaml file with the appropriate model identifier and api_key environment variable for your provider. Refer to LiteLLM Proxy - Model Management for syntax details for each provider.

Prerequisites

Before deploying LiteLLM, ensure:

  • Your DX Kubernetes cluster is running and accessible.
  • A valid DX namespace (<DX_NAMESPACE>) exists. Replace <DX_NAMESPACE> in the commands and values in this topic with the name of your DX namespace (for example, dxns).
  • Valid credentials or API keys are available for your LLM provider (such as AWS Bedrock or OpenAI).
  • kubectl is configured to access your cluster.
  • Helm 3.8 or later is installed. The LiteLLM chart is published to an OCI registry (ghcr.io), so you do not need to run helm repo add.

If your DX IQ deployment requires persistence, ensure:

  • An external PostgreSQL database (such as an AWS RDS instance) is available.
  • Database connection details are available, including username, password, endpoint, port, and database name.

Deploying LiteLLM in-cluster

LiteLLM deploys as a container in the DX Kubernetes namespace to manage traffic for DX IQ. This standard architecture routes requests through an internal gateway, maintaining prompt data within the cluster perimeter and securing API credentials through Kubernetes secrets.

Note

DX IQ transmits conversation history to LiteLLM to enable proper context and functionality. User authentication credentials (cookies) remain within your Kubernetes cluster and are never transmitted to external LLM services. You control the LiteLLM proxy server and determine where conversation data is routed.

  1. Select the deployment mode and corresponding Docker image variant for your environment:

    Deployment mode Image variant Repository Description
    Quick start Standard ghcr.io/berriai/litellm LiteLLM runs in stateless mode without a database. Recommended for development and testing. Model lists are stored in memory and reset on pod restart.
    Production Database ghcr.io/berriai/litellm-database LiteLLM integrates with an external PostgreSQL database to persist model configurations, virtual keys, and usage data across pod restarts.

    Capacity planning

    Before deploying LiteLLM, ensure that your Kubernetes nodes have sufficient unallocated resources to schedule the pod. By default, LiteLLM requests 100m CPU and 512Mi Memory. You can check your available node capacity by running kubectl describe nodes and reviewing the Allocated resources section. If nodes are near capacity, provision additional nodes or use a larger instance type.

  2. Create the Kubernetes secrets in your DX namespace:

    1. Generate a random master key:

      openssl rand -base64 32
      
    2. Create the LiteLLM master key secret:

      kubectl create secret generic litellm-masterkey \
        --from-literal=PROXY_MASTER_KEY=<GENERATED_RANDOM_KEY> \
        -n <DX_NAMESPACE>
      
      • <GENERATED_RANDOM_KEY>: The random key that you generated in the previous step.
      • <DX_NAMESPACE>: The Kubernetes namespace where DX is deployed (for example, dxns).
    3. Create the LLM provider credentials secret. To reduce the number of secrets to manage, combine the provider credentials and master key into a single litellm-env secret. For example:

      • AWS Bedrock:

        kubectl create secret generic litellm-env \
          --from-literal=AWS_BEARER_TOKEN_BEDROCK=<YOUR_AWS_BEARER_TOKEN> \
          --from-literal=PROXY_MASTER_KEY=<GENERATED_RANDOM_KEY> \
          -n <DX_NAMESPACE>
        

        <YOUR_AWS_BEARER_TOKEN>: Your AWS Bedrock bearer token.

      • OpenAI:

        kubectl create secret generic litellm-env \
          --from-literal=OPENAI_API_KEY=<YOUR_OPENAI_KEY> \
          --from-literal=PROXY_MASTER_KEY=<GENERATED_RANDOM_KEY> \
          -n <DX_NAMESPACE>
        

        <YOUR_OPENAI_KEY>: Your OpenAI API key.

      • Anthropic:

        kubectl create secret generic litellm-env \
          --from-literal=ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_KEY> \
          --from-literal=PROXY_MASTER_KEY=<GENERATED_RANDOM_KEY> \
          -n <DX_NAMESPACE>
        

        <YOUR_ANTHROPIC_KEY>: Your Anthropic API key.

    1. Generate a random master key:

      openssl rand -base64 32
      
    2. Create the LiteLLM master key secret:

      kubectl create secret generic litellm-masterkey \
        --from-literal=PROXY_MASTER_KEY=<GENERATED_RANDOM_KEY> \
        -n <DX_NAMESPACE>
      

      <GENERATED_RANDOM_KEY>: The random key that you generated in the previous step.

    3. Create the LLM provider credentials secret. To reduce the number of secrets to manage, combine the provider credentials and master key into a single litellm-env secret. For example:

      • AWS Bedrock:

        kubectl create secret generic litellm-env \
          --from-literal=AWS_BEARER_TOKEN_BEDROCK=<YOUR_AWS_BEARER_TOKEN> \
          --from-literal=PROXY_MASTER_KEY=<GENERATED_RANDOM_KEY> \
          -n <DX_NAMESPACE>
        

        <YOUR_AWS_BEARER_TOKEN>: Your AWS Bedrock bearer token.

      • OpenAI:

        kubectl create secret generic litellm-env \
          --from-literal=OPENAI_API_KEY=<YOUR_OPENAI_KEY> \
          --from-literal=PROXY_MASTER_KEY=<GENERATED_RANDOM_KEY> \
          -n <DX_NAMESPACE>
        

        <YOUR_OPENAI_KEY>: Your OpenAI API key.

      • Anthropic:

        kubectl create secret generic litellm-env \
          --from-literal=ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_KEY> \
          --from-literal=PROXY_MASTER_KEY=<GENERATED_RANDOM_KEY> \
          -n <DX_NAMESPACE>
        

        <YOUR_ANTHROPIC_KEY>: Your Anthropic API key.

    4. Create the database credentials secret:

      kubectl create secret generic litellm-db-credentials \
        --from-literal=username=<DB_USERNAME> \
        --from-literal=password=<DB_PASSWORD> \
        -n <DX_NAMESPACE>
      
    5. Verify that your database is accessible from the Kubernetes cluster to prevent CrashLoopBackOff errors due to misconfigured credentials.

      kubectl run db-validator --rm -i --restart=Never \
        --image=postgres:alpine \
        --env="PGPASSWORD=<DB_PASSWORD>" \
        -n <DX_NAMESPACE> \
        --command -- psql -h <RDS_ENDPOINT> -p 5432 -U <DB_USERNAME> -d litellm -c "SELECT 1;"
      
      • <DB_PASSWORD>: The database password.
      • <RDS_ENDPOINT>: The database endpoint (for example, litellm-db.xxxx.us-east-1.rds.amazonaws.com).
      • <DB_USERNAME>: The database username.

      Expected response: 1.

  3. Create the Helm values file:

    Save the following configuration to the litellm-values.yaml file:

    Model compatibility

    Do not use OpenAI reasoning model variants (for example, GPT-5.x decimal-versioned models such as gpt-5.4, gpt-5.5, or gpt-5.6-sol) with DX IQ. These models automatically inject a reasoning_effort parameter to every request, which conflicts with DX IQ's function tools, and returns the following error: Function tools with reasoning_effort are not supported. The base models (gpt-5 and gpt-5-mini) do not inject reasoning_effort, but are not validated for production use. AWS Bedrock Claude models, such as Sonnet or Haiku, are recommended for production deployments.

    replicaCount: 1
    
    image:
      repository: ghcr.io/berriai/litellm
      pullPolicy: IfNotPresent
      tag: "main-latest"
    
    masterkeySecretName: litellm-masterkey
    masterkeySecretKey: PROXY_MASTER_KEY
    
    environmentSecrets:
      - litellm-env
    
    db:
      deployStandalone: false
      useExisting: false
    
    migrationJob:
      enabled: false
    
    proxy_config:
      model_list:
        - model_name: iq-general-purpose
          litellm_params:
            model: "bedrock/us.anthropic.claude-sonnet-4-6-20250514-v1:0"
            api_key: os.environ/AWS_BEARER_TOKEN_BEDROCK
    
        - model_name: iq-summary
          litellm_params:
            model: "bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0"
            api_key: os.environ/AWS_BEARER_TOKEN_BEDROCK
    
      litellm_settings:
        json_logs: true  # Structured JSON logging for easier log parsing
        drop_params: true  # Critical: Prevents unsupported parameters from being forwarded to the LLM provider
    
      general_settings:
        master_key: os.environ/PROXY_MASTER_KEY
    
    logLevel: INFO
    

    For OpenAI or other providers

    Replace the model and api_key values in proxy_config.model_list with your provider's configuration. For more information on the syntax, refer to LiteLLM Proxy - Model Management.

    1. Save the following configuration to the litellm-values.yaml file:

      Model compatibility

      Do not use OpenAI reasoning model variants (for example, GPT-5.x decimal-versioned models such as gpt-5.4, gpt-5.5, or gpt-5.6-sol) with DX IQ. These models automatically inject a reasoning_effort parameter to every request, which conflicts with DX IQ's function tools, and returns the following error: Function tools with reasoning_effort are not supported. The base models (gpt-5 and gpt-5-mini) do not inject reasoning_effort, but are not validated for production use. AWS Bedrock Claude models, such as Sonnet or Haiku, are recommended for production deployments.

      replicaCount: 1
      
      image:
        repository: ghcr.io/berriai/litellm-database
        pullPolicy: IfNotPresent
        tag: "1.45.0"  # Use specific version in production
      
      # Security context - LiteLLM requires root for Prisma binary download
      securityContext:
        runAsUser: 0
        runAsGroup: 0
      
      # External PostgreSQL database configuration
      db:
        useExisting: true
        endpoint: "<RDS_ENDPOINT>"        # for example, litellm-db.xxxx.us-east-1.rds.amazonaws.com
        port: 5432                         # Adjust if using non-standard port
        database: "litellm"                # Your database name
        deployStandalone: false
        secret:
          name: litellm-db-credentials
          usernameKey: username
          passwordKey: password
      
      migrationJob:
        enabled: true  # Enable for database migrations on first deployment
      
      # Master key for API authentication
      masterkeySecretName: litellm-masterkey
      masterkeySecretKey: PROXY_MASTER_KEY
      
      # Inject secrets as environment variables for model access
      environmentSecrets:
        - litellm-env
      
      # Pod annotations for Prometheus monitoring (if using Prometheus)
      podAnnotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "4000"
        prometheus.io/path: "/metrics/"
      
      # LiteLLM Proxy configuration - Define the models that DX IQ requires
      proxy_config:
        model_list:
          # DX IQ General Purpose Model (Premium - for inquiries and tool execution)
          - model_name: iq-general-purpose
            litellm_params:
              model: "bedrock/us.anthropic.claude-sonnet-4-6-20250514-v1:0"
              api_key: os.environ/AWS_BEARER_TOKEN_BEDROCK
      
          # DX IQ Summary Model (Cost-efficient - for context summarization)
          - model_name: iq-summary
            litellm_params:
              model: "bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0"
              api_key: os.environ/AWS_BEARER_TOKEN_BEDROCK
      
        litellm_settings:
          callbacks:
            - prometheus  # Enable Prometheus metrics
          json_logs: true  # Structured JSON logging for easier log parsing
          drop_params: true  # Critical: Prevents unsupported parameters from being forwarded to the LLM provider
      
        general_settings:
          master_key: os.environ/PROXY_MASTER_KEY
      
      logLevel: INFO
      
      # Ingress configuration - Expose LiteLLM within cluster
      ingress:
        enabled: true
        className: "nginx"
        annotations:
          nginx.ingress.kubernetes.io/proxy-body-size: "50m"
          nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
          nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
        hosts:
          - host: "litellm.<DX_NAMESPACE>.svc.cluster.local"  # Internal DNS name
            paths:
              - path: /
                pathType: Prefix
      
      # Resource allocation
      resources:
        requests:
          cpu: "100m"
          memory: "512Mi"
        limits:
          cpu: "1000m"
          memory: "2Gi"
      
      # Health probe configuration
      livenessProbe:
        enabled: true
        httpGet:
          path: /health/liveliness
          port: http
        initialDelaySeconds: 15
        periodSeconds: 10
        timeoutSeconds: 5
        failureThreshold: 3
      
      readinessProbe:
        enabled: true
        httpGet:
          path: /health/readiness
          port: http
        initialDelaySeconds: 10
        periodSeconds: 10
        timeoutSeconds: 5
        failureThreshold: 3
      
      startupProbe:
        enabled: true
        httpGet:
          path: /health/readiness
          port: http
        failureThreshold: 60  # Allow up to 10 minutes for startup
        periodSeconds: 10
        timeoutSeconds: 5
      
      # Store models in database for persistence across restarts
      envVars:
        STORE_MODEL_IN_DB: true
      

      Discard unsupported parameters

      Set drop_params to true for DX IQ deployments to automatically discard parameters unsupported by an LLM provider and ensure cross-provider compatibility. Disabling this setting causes API errors when DX IQ forwards parameters that are not supported by providers such as AWS Bedrock, OpenAI, or Anthropic.

    2. (Optional) Validate your Helm configuration:

      helm upgrade --install litellm oci://ghcr.io/berriai/litellm-helm \
        -f litellm-values.yaml \
        -n <DX_NAMESPACE> \
        --dry-run \
        --debug
      

      Review the output for any syntax errors or misconfigurations. If successful, the command displays the rendered Kubernetes manifests without creating resources.

  4. Deploy LiteLLM using Helm:

    1. Deploy LiteLLM to the <DX_NAMESPACE> namespace:

      helm upgrade --install litellm oci://ghcr.io/berriai/litellm-helm \
        -f litellm-values.yaml \
        -n <DX_NAMESPACE>
      
    2. Monitor the deployment:

      kubectl get pods -n <DX_NAMESPACE> -l app=litellm
      kubectl logs -n <DX_NAMESPACE> -l app=litellm -f
      
    3. Verify pod readiness:

      kubectl wait --for=condition=ready pod \
        -l app=litellm \
        -n <DX_NAMESPACE> \
        --timeout=300s
      
  5. Verify the LiteLLM deployment:

    1. Forward local port 8000 to port 4000 on the LiteLLM service:

      # Port-forward to access LiteLLM locally
      kubectl port-forward -n <DX_NAMESPACE> svc/litellm 8000:4000
      
    2. In a separate terminal session, test the readiness endpoint:

      # Test health endpoint (in another terminal)
      curl http://localhost:8000/health/readiness
      

      Expected response:

      {
        "status": "healthy"
      }
      
    3. Test model availability:

      curl -H "Authorization: Bearer <LITELLM_MASTER_KEY>" \
        http://localhost:8000/v1/models
      

      <LITELLM_MASTER_KEY>: The master key that you stored in the litellm-masterkey secret.

    4. Test end-to-end chat completion:

      curl -X POST http://localhost:8000/v1/chat/completions \
        -H "Authorization: Bearer <LITELLM_MASTER_KEY>" \
        -H "Content-Type: application/json" \
        -d '{
          "model": "iq-general-purpose",
          "messages": [{"role": "user", "content": "Hello, are you ready?"}],
          "max_tokens": 100
        }'
      

      Expected response: A JSON object with a choices array containing the model's response.

Registering embedding models for cross-session memory

To use cross-session memory, you must register embedding model aliases in addition to your chat models. DX IQ uses these fixed aliases to generate and store vector embeddings for past conversations.

Alias Description
iq-multilingual-embed The default embedding model. Used when USE_MULTILINGUAL_EMBEDDINGS is set to true.
iq-embed The alternative embedding model. Used when USE_MULTILINGUAL_EMBEDDINGS is set to false.

The alias determines which registered model DX IQ calls. DX IQ does not verify whether the model bound to each alias is actually multilingual, so you can bind either alias to any embedding model available from your provider.

  1. Register both aliases by adding them to the proxy_config.model_list in your litellm-values.yaml file. The following example uses AWS Bedrock Cohere embeddings:

    proxy_config:
      model_list:
        # ... existing iq-general-purpose and iq-summary entries ...
    
        # Multilingual embedding model (default path for RAG)
        - model_name: iq-multilingual-embed
          litellm_params:
            model: "bedrock/us.cohere.embed-v4:0"
            api_key: os.environ/AWS_BEARER_TOKEN_BEDROCK
            dimensions: 1024
    
        # Fallback embedding model (used when USE_MULTILINGUAL_EMBEDDINGS=false)
        - model_name: iq-embed
          litellm_params:
            model: "bedrock/cohere.embed-multilingual-v3"
            api_key: os.environ/AWS_BEARER_TOKEN_BEDROCK
            embedding_types: ["float"]
            additional_drop_params: ["output_dimension", "dimensions"]
    

    The dimensions value must match the EMBEDDING_DIMENSIONS environment variable in your DX IQ configuration. If these values diverge after initial startup, DX IQ enters graceful degradation mode and disables cross-session memory while continuing to serve requests. The default EMBEDDING_DIMENSIONS value is 1024.

  2. Redeploy LiteLLM to apply the updated configuration:

    helm upgrade --install litellm oci://ghcr.io/berriai/litellm-helm \
      -f litellm-values.yaml \
      -n <DX_NAMESPACE>
    

    <DX_NAMESPACE>: The Kubernetes namespace where DX is deployed (for example, dxns).

Configuring rate limits for embedding models

For production deployments at scale, you can configure rate limits per embedding model to prevent quota exhaustion or excessive costs from your embedding API provider. LiteLLM supports per-model rate limit configuration. Refer to LiteLLM Proxy - Set Rate Limits for detailed configuration instructions on limiting requests per user, model, or time window.

Customizing model aliases

By default, DX IQ uses four fixed model aliases configured in LiteLLM:

  • iq-general-purpose
  • iq-summary
  • iq-multilingual-embed
  • iq-embed

Override these defaults only if you want to experiment with different models under different aliases without deleting and recreating models under the same four alias names. To override, set these environment variables in your DX IQ server deployment:

LITELLM_GENERAL_PURPOSE_MODEL=my-custom-general-purpose
LITELLM_SUMMARY_MODEL=my-custom-summary
LITELLM_MULTILINGUAL_EMBED_MODEL=my-custom-multilingual-embed
LITELLM_TEXT_EMBED_MODEL=my-custom-embed

The model names you specify must already be registered in your LiteLLM proxy_config.model_list. For most deployments, the default aliases are sufficient and no customization is needed. For a list of all DX IQ environment variables and their defaults, refer to DX IQ environment variables.

LiteLLM service endpoint

After LiteLLM is deployed and verified, LiteLLM is accessible within your cluster at:

http://litellm.<DX_NAMESPACE>.svc.cluster.local:4000

<DX_NAMESPACE>: The Kubernetes namespace where DX is deployed (for example, dxns).

Next step

After deploying and verifying LiteLLM, deploy the DX IQ Integrator and MCP Server.

Related information