File size: 1,157 Bytes
1e23279
 
 
 
16c2a22
6851411
 
 
1e23279
 
 
 
 
 
 
9db586c
1e23279
 
 
 
 
 
 
 
 
 
 
 
 
 
6851411
16c2a22
 
 
 
 
6851411
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""Application configuration using Pydantic settings."""

from typing import Literal
from pydantic import Field
from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    """Application settings loaded from environment variables.
    
    Supports loading from .env file with UTF-8 encoding.
    All settings can be overridden via environment variables.
    """
    
    model: str = Field(
        default="DragonLLM/Qwen-Open-Finance-R-8B",
        description="Hugging Face model identifier"
    )
    service_api_key: str | None = Field(
        default=None,
        description="Optional API key for authentication (SERVICE_API_KEY env var)"
    )
    log_level: Literal["debug", "info", "warning", "error"] = Field(
        default="info",
        description="Logging level"
    )
    force_model_reload: bool = Field(
        default=False,
        description="Force model reload from Hugging Face, bypassing cache (FORCE_MODEL_RELOAD env var)"
    )

    model_config = SettingsConfigDict(
        env_file=".env",
        env_file_encoding="utf-8",
        extra="ignore",
    )


settings = Settings()