Breach-OS / server /config.py
subhdotsol's picture
feat(config): add get_settings() with lru_cache for singleton pattern
d44c135
raw
history blame
572 Bytes
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
app_name: str = "RedTeamOS"
debug: bool = False
max_turns: int = 10
# LLM
hf_token: str = ""
api_base_url: str = "https://api-inference.huggingface.co/models"
model_name: str = "mistralai/Mistral-7B-Instruct-v0.3"
provider: str = "huggingface"
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
@lru_cache
def get_settings() -> Settings:
return Settings()