22
33import json
44from collections .abc import Sequence
5- from enum import Enum
65from typing import Literal
76
8- from pydantic import BaseModel , Field , model_validator
7+ from pydantic import BaseModel , Field
98from pydantic_settings import BaseSettings , SettingsConfigDict
109
1110__all__ = [
1211 "DatasetSettings" ,
13- "Environment" ,
1412 "LoggingSettings" ,
1513 "Settings" ,
1614 "print_config" ,
1917]
2018
2119
22- class Environment (str , Enum ):
23- """
24- Enum for the supported environments
25- """
26-
27- LOCAL = "local"
28- DEV = "dev"
29- STAGING = "staging"
30- PROD = "prod"
31-
32-
33- ENV_REPORT_MAPPING = {
34- Environment .PROD : "https://raw.githubusercontent.com/vllm-project/guidellm/refs/heads/gh-pages/ui/v0.5.4/index.html" ,
35- Environment .STAGING : "https://raw.githubusercontent.com/vllm-project/guidellm/refs/heads/gh-pages/ui/release/v0.4.0/index.html" ,
36- Environment .DEV : "https://raw.githubusercontent.com/vllm-project/guidellm/refs/heads/gh-pages/ui/dev/index.html" ,
37- Environment .LOCAL : "http://localhost:3000/index.html" ,
38- }
39-
40-
4120class LoggingSettings (BaseModel ):
4221 """
4322 Logging settings for the application
@@ -79,7 +58,7 @@ class ReportGenerationSettings(BaseModel):
7958 Report generation settings for the application
8059 """
8160
82- source : str = ""
61+ source : str = "https://raw.githubusercontent.com/vllm-project/guidellm/refs/heads/gh-pages/ui/v0.5.4/index.html "
8362
8463
8564class Settings (BaseSettings ):
@@ -103,7 +82,6 @@ class Settings(BaseSettings):
10382 )
10483
10584 # general settings
106- env : Environment = Environment .PROD
10785 default_async_loop_sleep : float = 10e-5
10886 logging : LoggingSettings = LoggingSettings ()
10987 default_sweep_number : int = 10
@@ -138,13 +116,6 @@ class Settings(BaseSettings):
138116 table_headers_border_char : str = "-"
139117 table_column_separator_char : str = "|"
140118
141- @model_validator (mode = "after" )
142- @classmethod
143- def set_default_source (cls , values ):
144- if not values .report_generation .source :
145- values .report_generation .source = ENV_REPORT_MAPPING .get (values .env )
146- return values
147-
148119 def generate_env_file (self ) -> str :
149120 """
150121 Generate the .env file from the current settings
0 commit comments