Skip to content

Fix: Enable STORE_MODEL_IN_DB for LiteLLM proxy #59

@rowan-stein

Description

@rowan-stein

User Report

Calling /api/settings/llm/models returns a 500 error:

{
    "error": "litellm_admin_request_failed",
    "status": 500,
    "details": {
        "error": {
            "message": "{'error': \"Set `'STORE_MODEL_IN_DB='True'` in your env to enable this feature.\"}",
            "type": "auth_error",
            "param": "None",
            "code": "500"
        }
    }
}

Root Cause

The LiteLLM proxy config in stacks/platform/main.tf is missing store_model_in_db: true in general_settings. Without this, LiteLLM refuses admin API calls for model management (/model/new, /model/delete, /model/update, etc.), which is what the platform's /api/settings/llm/models endpoint relies on.

Specification

Current Config (line ~449 of stacks/platform/main.tf)

general_settings = {
  master_key = "os.environ/LITELLM_MASTER_KEY"
}

Required Change

Add store_model_in_db = true to the general_settings block:

general_settings = {
  master_key         = "os.environ/LITELLM_MASTER_KEY"
  store_model_in_db  = true
}

Details

  • LiteLLM resolves store_model_in_db from config YAML general_settings (lowest priority), then env var STORE_MODEL_IN_DB (medium), then DB override (highest).
  • Setting it in the proxy config (general_settings) is the cleanest approach for our Helm-based deployment since it keeps configuration declarative.
  • All prerequisites are already in place: DATABASE_URL is set, Prisma auto-initializes, LITELLM_MASTER_KEY is configured, and LITELLM_SALT_KEY is present.
  • No other general_settings changes are required.

File to Change

  • stacks/platform/main.tf — the litellm_values local, inside proxy_config.general_settings

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions