Configs
lazyllm.Config
Config is a configuration class provided by LazyLLM, which loads configurations of LazyLLM framework from config files, environment variables, or specify them explicitly. it can export all configuration items as well. The Config module automatically generates an object named 'config' containing all configurations.
Parameters:
-
prefix(str, default:'LAZYLLM') –Environment variable prefix. Defaults to 'LAZYLLM'
-
home(str, default:None) –Configuration file directory path. Defaults to '~/.lazyllm'
LazyLLM Configurations:
- home:
- Description: The default home directory for LazyLLM., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_HOME
- mode:
- Description: The default mode for LazyLLM., type:
Mode, default:{desc["default"]} - Environment Variable:
- LAZYLLM_DISPLAY: Mode.Display
- LAZYLLM_DEBUG: Mode.Debug
- LAZYLLM_DISPLAY: Mode.Display
- repr_ml:
- Description: Whether to use Markup Language for repr., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_REPR_USE_ML
- repr_show_child:
- Description: Whether to show child modules in repr., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_REPR_SHOW_CHILD
- rag_store:
- Description: The default store for RAG., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_RAG_STORE
- gpu_type:
- Description: The default GPU type for LazyLLM., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_GPU_TYPE
- train_target_root:
- Description: The default target root for training., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_TRAIN_TARGET_ROOT
- infer_log_root:
- Description: The default log root for inference., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_INFER_LOG_ROOT
- temp_dir:
- Description: The default temp directory for LazyLLM., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_TEMP_DIR
- thread_pool_worker_num:
- Description: The default number of workers for thread pool., type:
int, default:{desc["default"]} - Environment Variable: LAZYLLM_THREAD_POOL_WORKER_NUM
- deploy_skip_check_kw:
- Description: Whether to skip check keywords for deployment., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_DEPLOY_SKIP_CHECK_KW
- allow_internal_network:
- Description: Whether to allow loading images from internal network addresses. Set to False for security in production environments., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_ALLOW_INTERNAL_NETWORK
- redis_url:
- Description: The URL of the Redis server., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_REDIS_URL
- redis_recheck_delay:
- Description: The delay of the Redis server check., type:
int, default:{desc["default"]} - Environment Variable: LAZYLLM_REDIS_RECHECK_DELAY
- use_builtin:
- Description: Whether to use registry modules in python builtin., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_USE_BUILTIN
- default_fsqueue:
- Description: The default file system queue to use., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_DEFAULT_FSQUEUE
- fsqredis_url:
- Description: The URL of the Redis server for the file system queue., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_FSQREDIS_URL
- default_recent_k:
- Description: The number of recent inputs that RecentQueue keeps track of., type:
int, default:{desc["default"]} - Environment Variable: LAZYLLM_DEFAULT_RECENT_K
- save_flow_result:
- Description: Whether to save the intermediate result of the pipeline., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_SAVE_FLOW_RESULT
- parallel_multiprocessing:
- Description: Whether to use multiprocessing for parallel execution, if not, default to use threading., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_PARALLEL_MULTIPROCESSING
- launcher:
- Description: The default remote launcher to use if no launcher is specified., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_DEFAULT_LAUNCHER
- cuda_visible:
- Description: Whether to set the CUDA_VISIBLE_DEVICES environment variable., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_CUDA_VISIBLE
- partition:
- Description: The default slurm partition to use if no partition is specified., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SLURM_PART
- sco.workspace:
- Description: The default SCO workspace to use if no workspace is specified., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SCO_WORKSPACE
- sco_env_name:
- Description: The default SCO environment name to use if no environment name is specified., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SCO_ENV_NAME
- sco_keep_record:
- Description: Whether to keep the record of the Sensecore job., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_SCO_KEEP_RECORD
- sco_resource_type:
- Description: The default SCO resource type to use if no resource type is specified., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SCO_RESOURCE_TYPE
- k8s_env_name:
- Description: The default k8s environment name to use if no environment name is specified., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_K8S_ENV_NAME
- k8s_config_path:
- Description: The default k8s configuration path to use if no configuration path is specified., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_K8S_CONFIG_PATH
- k8s_device_type:
- Description: The default k8s device type to use if no device type is specified., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_K8S_DEVICE_TYPE
- disable_system_prompt:
- Description: Whether to disable default system prompt., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_DISABLE_SYSTEM_PROMPT
- model_source:
- Description: The default model source to use., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_MODEL_SOURCE
- model_cache_dir:
- Description: The default model cache directory to use(Read and Write)., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_MODEL_CACHE_DIR
- model_path:
- Description: The default model path to use(ReadOnly)., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_MODEL_PATH
- model_source_token:
- Description: The default token for configed model source(hf or ms) to use., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_MODEL_SOURCE_TOKEN
- data_path:
- Description: The default data path to use., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_DATA_PATH
- openai_api:
- Description: Whether to use OpenAI API for vllm deployer., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_OPENAI_API
- use_ray:
- Description: Whether to use Ray for ServerModule(relay server)., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_USE_RAY
- num_gpus_per_node:
- Description: The number of GPUs per node for Ray launcher when deploy models., type:
int, default:{desc["default"]} - Environment Variable: LAZYLLM_NUM_GPUS_PER_NODE
- lmdeploy_eager_mode:
- Description: Whether to use eager mode for lmdeploy., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_LMDEPLOY_EAGER_MODE
- default_embedding_engine:
- Description: The default embedding engine to use., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_DEFAULT_EMBEDDING_ENGINE
- mindie_home:
- Description: The home directory of MindIE., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_MINDIE_HOME
- gpu_memory:
- Description: The memory of the GPU., type:
int, default:{desc["default"]} - Environment Variable: LAZYLLM_GPU_MEMORY
- cache_dir:
- Description: The default result cache directory for module to use(Read and Write)., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_CACHE_DIR
- cache_strategy:
- Description: The default cache strategy to use(memory, file, sqlite, redis)., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_CACHE_STRATEGY
- cache_mode:
- Description: The default cache mode to use(Read and Write, Read Only, Write Only, None)., type:
str, default:{desc["default"]} - Options: RW, RO, WO, NONE
- Environment Variable: LAZYLLM_CACHE_MODE
- cache_online_module:
- Description: Whether to cache the online module result. Use for unit test., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_CACHE_ONLINE_MODULE
- default_source:
- Description: The default model source for online modules., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_DEFAULT_SOURCE
- default_key:
- Description: The default API key for online modules., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_DEFAULT_KEY
- dynamic_model_configs:
- Description: Per-module dynamic params: chat, embed, multimodal; each with source, model, url, skip_auth. Use lazyllm.globals.config.ConfigsDict for {module_id: {chat:..., embed:..., multimodal:...}}., type:
dict, default:{desc["default"]} - Environment Variable: LAZYLLM_DYNAMIC_MODEL_CONFIGS
- aiping_api_key:
- Description: The API key for aiping, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_AIPING_API_KEY
- aiping_model_name:
- Description: The default model name for aiping, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_AIPING_MODEL_NAME
- aiping_text2image_model_name:
- Description: The default text2image model name for aiping, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_AIPING_TEXT2IMAGE_MODEL_NAME
- claude_api_key:
- Description: The API key for claude, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_CLAUDE_API_KEY
- claude_model_name:
- Description: The default model name for claude, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_CLAUDE_MODEL_NAME
- deepseek_api_key:
- Description: The API key for deepseek, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_DEEPSEEK_API_KEY
- deepseek_model_name:
- Description: The default model name for deepseek, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_DEEPSEEK_MODEL_NAME
- doubao_api_key:
- Description: The API key for doubao, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_DOUBAO_API_KEY
- doubao_model_name:
- Description: The default model name for doubao, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_DOUBAO_MODEL_NAME
- doubao_multimodal_embed_model_name:
- Description: The default multimodal embed model name for doubao, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_DOUBAO_MULTIMODAL_EMBED_MODEL_NAME
- doubao_text2image_model_name:
- Description: The default text2image model name for doubao, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_DOUBAO_TEXT2IMAGE_MODEL_NAME
- glm_api_key:
- Description: The API key for glm, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_GLM_API_KEY
- glm_model_name:
- Description: The default model name for glm, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_GLM_MODEL_NAME
- glm_stt_model_name:
- Description: The default stt model name for glm, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_GLM_STT_MODEL_NAME
- glm_text2image_model_name:
- Description: The default text2image model name for glm, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_GLM_TEXT2IMAGE_MODEL_NAME
- kimi_api_key:
- Description: The API key for kimi, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_KIMI_API_KEY
- kimi_model_name:
- Description: The default model name for kimi, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_KIMI_MODEL_NAME
- minimax_api_key:
- Description: The API key for minimax, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_MINIMAX_API_KEY
- minimax_model_name:
- Description: The default model name for minimax, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_MINIMAX_MODEL_NAME
- minimax_text2image_model_name:
- Description: The default text2image model name for minimax, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_MINIMAX_TEXT2IMAGE_MODEL_NAME
- minimax_tts_model_name:
- Description: The default tts model name for minimax, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_MINIMAX_TTS_MODEL_NAME
- openai_api_key:
- Description: The API key for openai, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_OPENAI_API_KEY
- openai_model_name:
- Description: The default model name for openai, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_OPENAI_MODEL_NAME
- ppio_api_key:
- Description: The API key for ppio, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_PPIO_API_KEY
- ppio_model_name:
- Description: The default model name for ppio, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_PPIO_MODEL_NAME
- qwen_api_key:
- Description: The API key for qwen, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_QWEN_API_KEY
- qwen_model_name:
- Description: The default model name for qwen, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_QWEN_MODEL_NAME
- qwen_multimodal_embed_model_name:
- Description: The default multimodal embed model name for qwen, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_QWEN_MULTIMODAL_EMBED_MODEL_NAME
- qwen_stt_model_name:
- Description: The default stt model name for qwen, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_QWEN_STT_MODEL_NAME
- qwen_text2image_model_name:
- Description: The default text2image model name for qwen, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_QWEN_TEXT2IMAGE_MODEL_NAME
- qwen_tts_model_name:
- Description: The default tts model name for qwen, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_QWEN_TTS_MODEL_NAME
- sensenova_secret_key:
- Description: The secret key for SenseNova., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SENSENOVA_SECRET_KEY
- sensenova_api_key:
- Description: The API key for sensenova, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SENSENOVA_API_KEY
- sensenova_model_name:
- Description: The default model name for sensenova, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SENSENOVA_MODEL_NAME
- siliconflow_api_key:
- Description: The API key for siliconflow, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SILICONFLOW_API_KEY
- siliconflow_model_name:
- Description: The default model name for siliconflow, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SILICONFLOW_MODEL_NAME
- siliconflow_multimodal_embed_model_name:
- Description: The default multimodal embed model name for siliconflow, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SILICONFLOW_MULTIMODAL_EMBED_MODEL_NAME
- siliconflow_text2image_model_name:
- Description: The default text2image model name for siliconflow, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SILICONFLOW_TEXT2IMAGE_MODEL_NAME
- siliconflow_tts_model_name:
- Description: The default tts model name for siliconflow, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SILICONFLOW_TTS_MODEL_NAME
- trainable_module_config_map_path:
- Description: The default path for trainable module config map., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_TRAINABLE_MODULE_CONFIG_MAP_PATH
- auto_model_config_map_path:
- Description: The default path for automodel config map., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_AUTO_MODEL_CONFIG_MAP_PATH
- trainable_magic_mock:
- Description: Whether to use magic mock for trainable module(used for unit test)., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_TRAINABLE_MAGIC_MOCK
- cache_local_module:
- Description: Whether to cache the local module result. Use for unit test., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_CACHE_LOCAL_MODULE
- cpp_switch:
- Description: None, type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_ENABLE_CPP_OVERRIDE
- raise_on_add_doc_error:
- Description: Whether to raise an error when adding doc failed., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_RAISE_ON_ADD_DOC_ERROR
- language:
- Description: The language of the documentation., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_LANGUAGE
- init_doc:
- Description: whether to init docs, type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_INIT_DOC
- trace_enabled:
- Description: Whether LazyLLM tracing is enabled by default., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_TRACE_ENABLED
- trace_backend:
- Description: The tracing backend used by LazyLLM., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_TRACE_BACKEND
- trace_content_enabled:
- Description: Whether tracing records basic input and output payloads by default., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_TRACE_CONTENT_ENABLED
- trace_local_storage_dir:
- Description: Directory used by the local tracing backend to store JSONL trace files., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_TRACE_LOCAL_STORAGE_DIR
- git_backend:
- Description: Default git backend: github, gitlab, gitee, gitcode. None for auto-detect., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_GIT_BACKEND
- github_app_private_key_path:
- Description: Path to GitHub App private key PEM file for App authentication., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_GITHUB_APP_PRIVATE_KEY_PATH
- sandbox_type:
- Description: None, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SANDBOX_TYPE
- sandbox_fusion_base_url:
- Description: None, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SANDBOX_FUSION_BASE_URL
- skills_dir:
- Description: The directory of skills, supports multiple directories separated by commas, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_SKILLS_DIR
- max_skill_md_bytes:
- Description: The maximum size of SKILL.md that can be loaded by default, type:
int, default:{desc["default"]} - Environment Variable: LAZYLLM_MAX_SKILL_MD_BYTES
- eval_result_dir:
- Description: The default result directory for eval., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_EVAL_RESULT_DIR
- max_embedding_workers:
- Description: The default number of workers for embedding in RAG., type:
int, default:{desc["default"]} - Environment Variable: LAZYLLM_MAX_EMBEDDING_WORKERS
- auto_detect_encoding:
- Description: Whether auto detecting txt encoding, type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_AUTO_DETECT_ENCODING
- enable_chardet:
- Description: Whether to use chardet when detect txt encoding, type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_ENABLE_CHARDET
- use_encoding_cache:
- Description: Whether use cahce to accelerate txt encoding, type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_USE_ENCODING_CACHE
- mineru_api_key:
- Description: The API key for Mineru, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_MINERU_API_KEY
- paddle_api_key:
- Description: The API key for PaddleOCR, type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_PADDLE_API_KEY
- rag_filename_as_id:
- Description: Whether to use filename as id for RAG., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_RAG_FILENAME_AS_ID
- use_fallback_reader:
- Description: Whether to use fallback reader for RAG., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_USE_FALLBACK_READER
- algo_register_policy:
- Description: Algorithm registration policy when re-registering an existing algo. force=overwrite reader and node groups unconditionally; update=overwrite reader if signature matches, error otherwise; empty/other=skip if reader already registered., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_ALGO_REGISTER_POLICY
- dynamic_fs_auth:
- Description: Per-source dynamic FS auth: {source: token}., type:
dict, default:{desc["default"]} - Environment Variable: LAZYLLM_DYNAMIC_FS_AUTH
- dynamic_tool_auth:
- Description: Per-tool dynamic auth: {tool_name: token}. Used by search engines and other API-key-based tools., type:
dict, default:{desc["default"]} - Environment Variable: LAZYLLM_DYNAMIC_TOOL_AUTH
- feishu_app_id:
- Description: Feishu App ID for tenant_access_token., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_FEISHU_APP_ID
- feishu_app_secret:
- Description: Feishu App Secret for tenant_access_token., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_FEISHU_APP_SECRET
- feishu_wiki_space_id:
- Description: Default Feishu wiki space_id for tree ops (ls/mkdir) when not set in URI., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_FEISHU_WIKI_SPACE_ID
- confluence_token:
- Description: Confluence API token., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_CONFLUENCE_TOKEN
- confluence_email:
- Description: Confluence cloud login email for Basic auth., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_CONFLUENCE_EMAIL
- confluence_cloud_id:
- Description: Confluence cloud instance ID., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_CONFLUENCE_CLOUD_ID
- notion_token:
- Description: Notion API token (notion-client official env)., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_NOTION_TOKEN
- googledrive_credentials:
- Description: Path to Google service account JSON (ADC)., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_GOOGLE_APPLICATION_CREDENTIALS
- onedrive_client_id:
- Description: OneDrive/Microsoft Graph client ID., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_AZURE_CLIENT_ID
- onedrive_client_secret:
- Description: OneDrive/Microsoft Graph client secret., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_AZURE_CLIENT_SECRET
- onedrive_tenant_id:
- Description: OneDrive/Microsoft Graph tenant ID., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_AZURE_TENANT_ID
- yuque_token:
- Description: Yuque API token (yuque-sdk official env)., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_YUQUE_TOKEN
- ones_token:
- Description: Ones API token., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_ONES_TOKEN
- obsidian_vault_path:
- Description: Obsidian vault directory path., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_OBSIDIAN_VAULT_PATH
- s3_access_key:
- Description: S3 access key (boto3 official)., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_AWS_ACCESS_KEY_ID
- s3_secret_key:
- Description: S3 secret key (boto3 official)., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_AWS_SECRET_ACCESS_KEY
- s3_endpoint_url:
- Description: S3-compatible endpoint URL (optional)., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_CLOUDFS_S3_ENDPOINT_URL
- s3_region_name:
- Description: S3 region (boto3 official)., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_AWS_DEFAULT_REGION
- trace_consume_backend:
- Description: The tracing consume backend used by LazyLLM., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_TRACE_CONSUME_BACKEND
- trace_consume_timeout:
- Description: Timeout in seconds for tracing consume backend requests., type:
float, default:{desc["default"]} - Environment Variable: LAZYLLM_TRACE_CONSUME_TIMEOUT
- debug:
- Description: Whether to enable debug mode., type:
bool, default:{desc["default"]} - Environment Variable: LAZYLLM_DEBUG
- log_name:
- Description: The name of the log file., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_LOG_NAME
- expected_log_modules:
- Description: The expected log modules, separated by comma., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_EXPECTED_LOG_MODULES
- log_level:
- Description: The level of the log., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_LOG_LEVEL
- log_format:
- Description: The format of the log., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_LOG_FORMAT
- log_dir:
- Description: The directory of the log file., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_LOG_DIR
- log_file_level:
- Description: The level of the log file., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_LOG_FILE_LEVEL
- log_file_size:
- Description: The size of the log file., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_LOG_FILE_SIZE
- log_file_retention:
- Description: The retention of the log file., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_LOG_FILE_RETENTION
- log_file_mode:
- Description: The mode of the log file., type:
str, default:{desc["default"]} - Environment Variable: LAZYLLM_LOG_FILE_MODE
Source code in lazyllm/configs.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 | |
done()
Check if any configuration items in the config.json file that is not loaded by the add method.
Source code in lazyllm/configs.py
getenv(name, type, default=None)
Get value of LazyLLM-related environment variables.
Parameters:
-
name(str) –The name of the environment variable (without the prefix), case-insensitive. The function obtains value
-
type(type) –Specifies the type of the configuration, for example, str. For boolean types, the function will
-
default(optional, default:None) –If the value of the environment variable cannot be obtained, this value is returned.
Source code in lazyllm/configs.py
add(name, type, default=None, env=None, *, options=None, description=None)
Loads value into LazyLLM configuration item. The function first attempts to find the value with the given name from the dict loaded from config.json. If found, it removes the key from the dict and saves the value to the config. If 'env' is a string, the function calls getenv to look for the corresponding LazyLLM environment variable, and if it's found, writes it to the config. If 'env' is a dictionary, the function attempts to call getenv to find the environment variables corresponding to the keys in the dict and convert them to boolean type. If the converted boolean value is True, the value corresponding to the current key in the dict is written to the config.
Parameters:
-
name(str) –The name of the configuration item
-
type(type) –The type of the configuration
-
default(optional, default:None) –The default value of the configuration if no value can be obtained
-
env(optional, default:None) –The name of the environment variable without the prefix, or a dictionary where the keys are the
Source code in lazyllm/configs.py
get_all_configs()
Get all configurations from the config.
Examples:
>>> import lazyllm
>>> from lazyllm.configs import config
>>> config['launcher']
'empty'
>>> config.get_all_configs()
{'home': '~/.lazyllm/', 'mode': <Mode.Normal: (1,)>, 'repr_ml': False, 'rag_store': 'None', 'redis_url': 'None', ...}
Source code in lazyllm/configs.py
get_config(cfg)
staticmethod
Static method: Get configuration from config dictionary. This is a simple configuration retrieval method mainly used to extract configuration information from already loaded configuration dictionaries.
Parameters:
-
cfg(dict) –The configuration dictionary read from the config file.
Source code in lazyllm/configs.py
temp(name, value)
Context manager for temporary configuration modification. Temporarily modifies the value of the specified configuration item within the with statement block, and automatically restores the original value when exiting the block. Attention: this function is not thread-safe, you should not use it in multi-thread or multi-coroutine environment.
Parameters:
-
name(str) –The name of the configuration item to temporarily change.
-
value(Any) –The temporary value to set.
Source code in lazyllm/configs.py
refresh(targets=None)
Refresh configuration items based on the latest environment variable values.
If targets is a string, updates the single corresponding configuration item;
if it's a list, updates multiple;
if None, scans all environment-variable-mapped configuration items and updates them.
Parameters:
-
targets(str | list[str] | None, default:None) –Name of the config key or list of keys to refresh, or None to refresh all environment-backed keys.