Spaces:
Running
Running
| from __future__ import annotations | |
| from pathlib import Path | |
| from pydantic_settings import BaseSettings, SettingsConfigDict | |
| _BACKEND_ROOT = Path(__file__).resolve().parent.parent | |
| _ENV_FILE = _BACKEND_ROOT / ".env" | |
| class Settings(BaseSettings): | |
| model_config = SettingsConfigDict(env_file=str(_ENV_FILE), env_file_encoding="utf-8", extra="ignore") | |
| vllm_base_url: str = "http://127.0.0.1:8000/v1" | |
| # Same credential family as HANA_KLATCHAT_PASSWORD for BrainForge/Security (4090 x1-3); sent as Bearer to vLLM. | |
| vllm_api_key: str = "" | |
| chat_model_id: str = "BrainForge/Security@2026.03.18" | |
| cors_origins: str = "http://localhost:3006,http://127.0.0.1:3006" | |
| temperature: float = 0.7 | |
| max_tokens: int = 8192 | |
| def cors_origin_list(self) -> list[str]: | |
| parts = [o.strip() for o in self.cors_origins.split(",") if o.strip()] | |
| if "*" in parts: | |
| return ["*"] | |
| return parts | |
| settings = Settings() | |