Add new LiteLLM template to the repository. (#303)

* working

* Refactor LiteLLM template to centralize environment variables and improve configuration structure

* Refactor LiteLLM docker-compose and template to use volumes and simplify port configuration

* Refactor LiteLLM blueprint to simplify environment configuration and improve service definitions

* Refactor LiteLLM blueprint to centralize environment variables, enhance security with stronger defaults, and improve provider API key configuration

* Format tags as arrays in meta.json for improved readability
This commit is contained in:
Jainil Prajapati 🪐
2025-08-25 11:15:02 +05:30
committed by GitHub
parent 9af4698ea9
commit ee6d34f22d
4 changed files with 139 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
version: "3.8"
services:
litellm:
image: ghcr.io/berriai/litellm:main-latest
restart: unless-stopped
depends_on:
litellm-db:
condition: service_healthy
environment:
DATABASE_URL: ${DATABASE_URL}
LITELLM_MASTER_KEY: ${LITELLM_MASTER_KEY}
UI_USERNAME: ${UI_USERNAME}
UI_PASSWORD: ${UI_PASSWORD}
STORE_MODEL_IN_DB: "True"
# Provider Keys
OPENAI_API_KEY: ${OPENAI_API_KEY}
OPENAI_BASE_URL: ${OPENAI_BASE_URL}
COHERE_API_KEY: ${COHERE_API_KEY}
OR_SITE_URL: ${OR_SITE_URL}
OR_APP_NAME: ${OR_APP_NAME}
OR_API_KEY: ${OR_API_KEY}
AZURE_API_BASE: ${AZURE_API_BASE}
AZURE_API_VERSION: ${AZURE_API_VERSION}
AZURE_API_KEY: ${AZURE_API_KEY}
REPLICATE_API_KEY: ${REPLICATE_API_KEY}
REPLICATE_API_TOKEN: ${REPLICATE_API_TOKEN}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
INFISICAL_TOKEN: ${INFISICAL_TOKEN}
NOVITA_API_KEY: ${NOVITA_API_KEY}
INFINITY_API_KEY: ${INFINITY_API_KEY}
expose:
- 4000
litellm-db:
image: postgres:16-alpine
restart: on-failure:5
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- litellm-db:/var/lib/postgresql/data
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
litellm-db: {}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1,67 @@
[variables]
main_domain = "${domain}"
# Database
postgres_db = "litellm"
postgres_user = "litellm"
postgres_password = "${password:32}"
# LiteLLM UI + Master Key
ui_username = "${username}"
ui_password = "${password:32}"
litellm_master_key = "${password:64}"
# Provider API Keys (empty by default)
openai_api_key = ""
openai_base_url = ""
cohere_api_key = ""
or_site_url = ""
or_app_name = "LiteLLM Example app"
or_api_key = ""
azure_api_base = ""
azure_api_version = ""
azure_api_key = ""
replicate_api_key = ""
replicate_api_token = ""
anthropic_api_key = ""
infisical_token = ""
novita_api_key = ""
infinity_api_key = ""
[config]
[[config.domains]]
serviceName = "litellm"
port = 4000
host = "${main_domain}"
[config.env]
# Database
DATABASE_URL = "postgresql://${postgres_user}:${postgres_password}@litellm-db:5432/${postgres_db}"
POSTGRES_DB = "${postgres_db}"
POSTGRES_USER = "${postgres_user}"
POSTGRES_PASSWORD = "${postgres_password}"
# LiteLLM
UI_USERNAME = "${ui_username}"
UI_PASSWORD = "${ui_password}"
LITELLM_MASTER_KEY = "${litellm_master_key}"
STORE_MODEL_IN_DB = "True"
# Providers
OPENAI_API_KEY = "${openai_api_key}"
OPENAI_BASE_URL = "${openai_base_url}"
COHERE_API_KEY = "${cohere_api_key}"
OR_SITE_URL = "${or_site_url}"
OR_APP_NAME = "${or_app_name}"
OR_API_KEY = "${or_api_key}"
AZURE_API_BASE = "${azure_api_base}"
AZURE_API_VERSION = "${azure_api_version}"
AZURE_API_KEY = "${azure_api_key}"
REPLICATE_API_KEY = "${replicate_api_key}"
REPLICATE_API_TOKEN = "${replicate_api_token}"
ANTHROPIC_API_KEY = "${anthropic_api_key}"
INFISICAL_TOKEN = "${infisical_token}"
NOVITA_API_KEY = "${novita_api_key}"
INFINITY_API_KEY = "${infinity_api_key}"
[[config.mounts]]

View File

@@ -2548,6 +2548,25 @@
"mailing-list"
]
},
{
"id": "litellm",
"name": "LiteLLM",
"version": "main-stable",
"description": "LiteLLM is a lightweight OpenAI API-compatible proxy for managing multiple LLM providers with a single endpoint.",
"logo": "image.png",
"links": {
"github": "https://github.com/BerriAI/litellm",
"website": "https://docs.litellm.ai",
"docs": "https://docs.litellm.ai/docs/proxy/quick_start"
},
"tags": [
"ai",
"proxy",
"llm",
"openai-compatible",
"monitoring"
]
},
{
"id": "livekit",
"name": "Livekit",