配置
lazyllm.Config
Config是LazyLLM提供的配置类,可以支持通过加载配置文件、设置环境变量、编码写入默认值等方式设置LazyLLM框架的相关配置,以及导出当前所有的配置项和对应的值。 Config模块自动生成一个config对象,其中包含所有的配置。
Parameters:
-
prefix(str, default:'LAZYLLM') –环境变量前缀。默认为 'LAZYLLM'
-
home(str, default:None) –配置文件目录路径。默认为 '~/.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 | |
done()
getenv(name, type, default=None)
用于检查config.json配置文件中是否还有没有通过add方法载入的配置项 Config.getenv(name, type, default): -> str
获取LazyLLM相关环境变量的值
Parameters:
-
name(str) –不包含前缀的环境变量名字,不区分大小写。函数将从拼接了前缀和此名字的全大写的环境变量中获取对应的值。
-
type(type) –指定该配置的类型,例如str。对于bool型,函数会将'TRUE', 'True', 1, 'ON', '1'这5种输入转换为True。
-
default(可选, default:None) –若无法获取到环境变量的值,将返回此变量。
Source code in lazyllm/configs.py
add(name, type, default=None, env=None, *, options=None, description=None)
将值加载至LazyLLM的配置项中。函数首先尝试从加载自config.json的字典中查找名字为name的值。若找到则从该字典中删去名为name的键。并将对应的值写入config。 若env是一个字符串,函数会调用getenv寻找env对应的LazyLLM环境变量,若找到则写入config。如果env为一个字典,函数将尝试调用getenv寻找字典中的key对于的环境变量并转换为bool型。 若转换完成的bool值是True,则将字典中当前的key对应的值写入config。
Parameters:
-
name(str) –配置项名称
-
type(type) –该配置的类型
-
default(可选, default:None) –若无法获取到任何值,该配置的默认值
-
env(可选, default:None) –不包含前缀的环境变量名称,或者一个字典,其中的key是不包含前缀的环境变量名称,value是要加入配置的值。
Source code in lazyllm/configs.py
get_all_configs()
获取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
\ 静态方法:从配置字典中获取配置。 这是一个简单的配置获取方法,主要用于从已加载的配置字典中提取配置信息。
Parameters:
-
cfg(dict) –从配置文件中读取的配置字典。
temp(name, value)
临时修改配置项的上下文管理器。在with语句块内临时修改指定配置项的值,退出语句块后自动恢复原值。注意,此函数并非线程安全,请勿在多线程或者多协程的环境下使用。
Parameters:
-
name(str) –要临时修改的配置项名称。
-
value(Any) –临时设置的值。
Source code in lazyllm/configs.py
refresh(targets=None)
根据环境变量的最新值刷新配置项。如果传入 targets 为字符串,则按单个配置项更新;如果为列表,则批量更新;如果为 None,则扫描所有已映射到环境变量的配置项并更新。
Parameters:
-
targets(str | list[str] | None, default:None) –要刷新的配置项名称或列表,传 None 表示刷新所有可从环境变量读取的项。