Files
llm-monitor/app/config.py
T
Luca Sacchi Ricciardi 32b1130632 feat: add favicon.ico and gate model write APIs by env flag
- Generate and serve real /favicon.ico from static assets
- Update HTML to use /favicon.ico
- Add ENABLE_MODEL_RW_API setting (default: false)
- Disable POST/DELETE model endpoints by default
- Hide write endpoints from OpenAPI when disabled
- Return 404 for write endpoints when disabled
- Update env.example with ENABLE_MODEL_RW_API documentation
- Update README and PRD with R/W API policy and remote compose notes
- Add tests to verify write endpoints are disabled by default
2026-04-24 19:35:24 +02:00

36 lines
803 B
Python

"""
Configurazione dell'applicazione tramite variabili di ambiente
"""
from pydantic_settings import BaseSettings
from typing import List
class Settings(BaseSettings):
"""Configurazione dell'applicazione"""
# Ollama
OLLAMA_HOST: str = "http://localhost:11434"
OLLAMA_TIMEOUT: int = 30
# API
API_HOST: str = "0.0.0.0"
API_PORT: int = 8000
API_WORKERS: int = 4
ENABLE_MODEL_RW_API: bool = False
# CORS
CORS_ORIGINS: str = "http://localhost:3000,http://localhost:5173,http://localhost:8000"
# Logging
LOG_LEVEL: str = "INFO"
# Environment
ENVIRONMENT: str = "development"
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
# Istanza globale della configurazione
settings = Settings()