123 lines
4 KiB
Text
123 lines
4 KiB
Text
# Rerank Configuration
|
|
# Copy this file to .env and fill in ALL required values
|
|
# The application will fail to start if required variables are missing
|
|
|
|
# =============================================================================
|
|
# REQUIRED: Backend Selection (no defaults - must be set explicitly)
|
|
# =============================================================================
|
|
|
|
# Default backend: vllm or llamacpp
|
|
RERANK_DEFAULT_BACKEND=vllm
|
|
|
|
# Enable backends (true/false)
|
|
RERANK_ENABLE_VLLM=true
|
|
RERANK_ENABLE_LLAMACPP=false
|
|
|
|
# External URL for OpenAPI spec (REQUIRED)
|
|
RERANK_EXTERNAL_URL=http://localhost:14200
|
|
|
|
# =============================================================================
|
|
# OPTIONAL: API Server Settings
|
|
# =============================================================================
|
|
|
|
# Server binding
|
|
# RERANK_HOST=0.0.0.0
|
|
# RERANK_PORT=14200 # Prod: 14200, Dev: 54200
|
|
|
|
# =============================================================================
|
|
# OPTIONAL: API Authentication
|
|
# =============================================================================
|
|
|
|
# API tokens for Bearer authentication (comma-separated)
|
|
# If not set, authentication is disabled and all endpoints are public
|
|
# If set, requests to protected endpoints require: Authorization: Bearer <token>
|
|
# Health endpoints (/health, /ready) are always public
|
|
# RERANK_API_TOKENS=token1,token2,token3
|
|
|
|
# =============================================================================
|
|
# OPTIONAL: vLLM Backend Configuration
|
|
# =============================================================================
|
|
|
|
# vLLM server URL (internal Docker network)
|
|
# RERANK_VLLM_BASE_URL=http://localhost:54201
|
|
|
|
# vLLM model to load (Hugging Face model ID for cross-encoder)
|
|
RERANK_VLLM_MODEL=BAAI/bge-reranker-v2-m3
|
|
|
|
# vLLM server port
|
|
# RERANK_VLLM_PORT=14201
|
|
|
|
# GPU assignment for vLLM
|
|
# RERANK_VLLM_GPU=0
|
|
|
|
# GPU memory utilization
|
|
# RERANK_VLLM_GPU_UTIL=0.50
|
|
|
|
# Maximum model sequence length
|
|
# RERANK_VLLM_MAX_LEN=8192
|
|
|
|
# =============================================================================
|
|
# OPTIONAL: llama.cpp Backend Configuration
|
|
# =============================================================================
|
|
|
|
# llama.cpp server URL (internal Docker network)
|
|
# RERANK_LLAMACPP_BASE_URL=http://localhost:54210
|
|
|
|
# Directory containing model files (absolute path recommended)
|
|
MODELS_DIR=/path/to/models
|
|
|
|
# llama.cpp model file (GGUF format, filename only - must be in MODELS_DIR)
|
|
RERANK_LLAMACPP_MODEL=bge-reranker-v2-m3-q4_k_m.gguf
|
|
|
|
# llama.cpp server port
|
|
# RERANK_LLAMACPP_PORT=14210
|
|
|
|
# llama.cpp context size
|
|
# RERANK_LLAMACPP_CTX=8192
|
|
|
|
# llama.cpp performance settings
|
|
# RERANK_LLAMACPP_THREADS=4
|
|
# RERANK_LLAMACPP_PARALLEL=4
|
|
|
|
# =============================================================================
|
|
# OPTIONAL: Timeout Settings
|
|
# =============================================================================
|
|
|
|
# Request timeout for rerank calls (seconds)
|
|
# RERANK_REQUEST_TIMEOUT=120.0
|
|
|
|
# Connection timeout (seconds)
|
|
# RERANK_CONNECT_TIMEOUT=10.0
|
|
|
|
# =============================================================================
|
|
# OPTIONAL: Rate Limiting and Concurrency
|
|
# =============================================================================
|
|
|
|
# Requests per second limit
|
|
# RERANK_RATE_LIMIT_RPS=20.0
|
|
|
|
# Maximum burst size for rate limiting
|
|
# RERANK_RATE_LIMIT_BURST=50
|
|
|
|
# Maximum concurrent rerank requests
|
|
# RERANK_MAX_CONCURRENT_RERANKS=20
|
|
|
|
# =============================================================================
|
|
# OPTIONAL: Logging
|
|
# =============================================================================
|
|
|
|
# Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL
|
|
# RERANK_LOG_LEVEL=INFO
|
|
|
|
# Enable JSON logging format (true/false)
|
|
# RERANK_LOG_JSON=false
|
|
|
|
# =============================================================================
|
|
# OPTIONAL: Shared Settings (for Docker)
|
|
# =============================================================================
|
|
|
|
# HuggingFace cache directory
|
|
# HF_CACHE_DIR=/cai2_ds_storage/hf_cache
|
|
|
|
# HuggingFace token
|
|
# HF_TOKEN=
|