mirror of
https://github.com/arch3rPro/1Panel-Appstore.git
synced 2026-05-11 12:11:38 +08:00
feat:add LiteLLM version
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
additionalProperties:
|
||||||
|
formFields:
|
||||||
|
- default: "4000"
|
||||||
|
envKey: PANEL_APP_PORT_HTTP
|
||||||
|
label:
|
||||||
|
en: Port
|
||||||
|
zh: 端口
|
||||||
|
required: true
|
||||||
|
type: number
|
||||||
|
edit: true
|
||||||
|
rule: paramPort
|
||||||
|
- default: sk-1234
|
||||||
|
envKey: LITELLM_MASTER_KEY
|
||||||
|
label:
|
||||||
|
en: LITELLM_MASTER_KEY
|
||||||
|
zh: LITELLM密钥
|
||||||
|
required: true
|
||||||
|
type: text
|
||||||
|
edit: true
|
||||||
|
rule: paramCommon
|
||||||
|
values: []
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
services:
|
||||||
|
litellm:
|
||||||
|
args:
|
||||||
|
target: runtime
|
||||||
|
image: ghcr.io/berriai/litellm:v1.77.7-stable
|
||||||
|
container_name: ${CONTAINER_NAME}
|
||||||
|
#########################################
|
||||||
|
## Uncomment these lines to start proxy with a config.yaml file ##
|
||||||
|
# volumes:
|
||||||
|
# - ./config.yaml:/app/config.yaml
|
||||||
|
# command:
|
||||||
|
# - "--config=/app/config.yaml"
|
||||||
|
##############################################
|
||||||
|
ports:
|
||||||
|
- ${PANEL_APP_PORT_HTTP}:4000 # Map the container port to the host, change the host port if necessary
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: "postgresql://llmproxy:dbpassword9090@db:5432/litellm"
|
||||||
|
STORE_MODEL_IN_DB: "True" # allows adding models to proxy via UI
|
||||||
|
LITELLM_MASTER_KEY: ${LITELLM_MASTER_KEY}
|
||||||
|
depends_on:
|
||||||
|
- db # Indicates that this service depends on the 'db' service, ensuring 'db' starts first
|
||||||
|
healthcheck: # Defines the health check configuration for the container
|
||||||
|
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 http://localhost:4000/health/liveliness || exit 1" ] # Command to execute for health check
|
||||||
|
interval: 30s # Perform health check every 30 seconds
|
||||||
|
timeout: 10s # Health check command times out after 10 seconds
|
||||||
|
retries: 3 # Retry up to 3 times if health check fails
|
||||||
|
start_period: 40s # Wait 40 seconds after container start before beginning health checks
|
||||||
|
|
||||||
|
networks:
|
||||||
|
- 1panel-network
|
||||||
|
labels:
|
||||||
|
createdBy: "Apps"
|
||||||
|
db:
|
||||||
|
image: postgres:16
|
||||||
|
restart: always
|
||||||
|
container_name: ${CONTAINER_NAME}-db
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: litellm
|
||||||
|
POSTGRES_USER: llmproxy
|
||||||
|
POSTGRES_PASSWORD: dbpassword9090
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
volumes:
|
||||||
|
- postgres_data:/var/lib/postgresql/data # Persists Postgres data across container restarts
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -d litellm -U llmproxy"]
|
||||||
|
interval: 1s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
|
||||||
|
networks:
|
||||||
|
- 1panel-network
|
||||||
|
labels:
|
||||||
|
createdBy: "Apps"
|
||||||
|
prometheus:
|
||||||
|
image: prom/prometheus
|
||||||
|
container_name: ${CONTAINER_NAME}-prometheus
|
||||||
|
volumes:
|
||||||
|
- prometheus_data:/prometheus
|
||||||
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
||||||
|
ports:
|
||||||
|
- "9090:9090"
|
||||||
|
command:
|
||||||
|
- "--config.file=/etc/prometheus/prometheus.yml"
|
||||||
|
- "--storage.tsdb.path=/prometheus"
|
||||||
|
- "--storage.tsdb.retention.time=15d"
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
networks:
|
||||||
|
- 1panel-network
|
||||||
|
labels:
|
||||||
|
createdBy: "Apps"
|
||||||
|
volumes:
|
||||||
|
prometheus_data:
|
||||||
|
driver: local
|
||||||
|
postgres_data:
|
||||||
|
name: litellm_postgres_data # Named volume for Postgres data persistence
|
||||||
|
|
||||||
|
networks:
|
||||||
|
1panel-network:
|
||||||
|
external: true
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
global:
|
||||||
|
scrape_interval: 15s
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: 'litellm'
|
||||||
|
static_configs:
|
||||||
|
- targets: ['litellm:4000'] # Assuming Litellm exposes metrics at port 4000
|
||||||
Reference in New Issue
Block a user