From 4e5f37990063b6197a9327c9f44dc6eaf569258b Mon Sep 17 00:00:00 2001 From: livdebus Date: Wed, 23 Sep 2026 22:16:18 +0200 Subject: [PATCH] feat: migrate LiteLLM config to env vars and expand file handlers Description: This commit introduces two main improvements to the SMB connector and LiteLLM configuration: Configuration Security & Flexibility: Refactored litellm-config.yaml to replace hardcoded API base URLs with the INFOMANIAK_BASE environment variable. Updated .env.example to include the new INFOMANIAK_BASE variable, ensuring a consistent and secure configuration management strategy. Added a new embedding model configuration (LivQwenEmbed) to the LiteLLM setup. Enhanced File Type Support: Extended the extract.py script to support a wider range of text-based IT file formats, including yaml, yml, json, xml, ini, conf, cfg, sh, bash, ps1, py, sql, log, dockerfile, properties, toml, rst, mjs, patch, and tsx. --- .env.example | 1 + litellm-config.yaml | 42 ++++++++++++++++++++++++++++++------ setup.sh | 1 + smb-connector/app/extract.py | 21 ++++++++++++++++++ 4 files changed, 59 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 45b30e3..dc6e14d 100644 --- a/.env.example +++ b/.env.example @@ -338,6 +338,7 @@ LITELLM_MASTER_KEY=sk-$(openssl rand -hex 32) LITELLM_SALT_KEY=$(openssl rand -hex 32) DATABASE_URL=postgresql://llmproxy:${POSTGRES_PASSWORD}@litellm-db:5432/litellm POSTGRES_PASSWORD=$(openssl rand -hex 16) +INFOMANIAK_BASE=https://api.infomaniak.com/2/ai/XYZ/openai/v1 INFOMANIAK_API_KEY= # ============================================================================= diff --git a/litellm-config.yaml b/litellm-config.yaml index 98ac79b..01a6fb6 100644 --- a/litellm-config.yaml +++ b/litellm-config.yaml @@ -33,7 +33,7 @@ model_list: litellm_params: model: Qwen/Qwen3.5-397B-A17B-FP8 custom_llm_provider: openai - api_base: https://api.infomaniak.com/2/ai/105341/openai/v1 + api_base: os.environ/INFOMANIAK_BASE api_key: os.environ/INFOMANIAK_API_KEY rpm: 50 tpm: 500000 @@ -67,7 +67,7 @@ model_list: litellm_params: model: Qwen/Qwen3.5-122B-A10B-FP8 custom_llm_provider: openai - api_base: https://api.infomaniak.com/2/ai/105341/openai/v1 + api_base: os.environ/INFOMANIAK_BASE api_key: os.environ/INFOMANIAK_API_KEY rpm: 50 tpm: 500000 @@ -101,7 +101,7 @@ model_list: litellm_params: model: moonshotai/Kimi-K2.6 custom_llm_provider: openai - api_base: https://api.infomaniak.com/2/ai/105341/openai/v1 + api_base: os.environ/INFOMANIAK_BASE api_key: os.environ/INFOMANIAK_API_KEY rpm: 50 tpm: 500000 @@ -135,7 +135,7 @@ model_list: litellm_params: model: mistralai/Ministral-3-14B-Instruct-2512 custom_llm_provider: openai - api_base: https://api.infomaniak.com/2/ai/105341/openai/v1 + api_base: os.environ/INFOMANIAK_BASE api_key: os.environ/INFOMANIAK_API_KEY rpm: 50 tpm: 500000 @@ -167,7 +167,7 @@ model_list: litellm_params: model: nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-FP8 custom_llm_provider: openai - api_base: https://api.infomaniak.com/2/ai/105341/openai/v1 + api_base: os.environ/INFOMANIAK_BASE api_key: os.environ/INFOMANIAK_API_KEY rpm: 50 tpm: 500000 @@ -196,7 +196,37 @@ model_list: model_group: "nemotron-family" region: "ch-gva" - + - model_name: LivQwenEmbed + litellm_params: + model: Qwen/Qwen3-Embedding-8B + custom_llm_provider: openai + api_base: os.environ/INFOMANIAK_BASE + api_key: os.environ/INFOMANIAK_API_KEY + rpm: 50 + tpm: 500000 + model_info: + id: "infomaniak-qwen-embed-1" + base_model: "Qwen/Qwen3-Embedding-8B" + input_cost_per_token: 0.00000007 + # Capabilities + supports_vision: false + supports_reasoning: false + supports_function_calling: false + supports_parallel_function_calling: false + supports_response_schema: false + supports_system_messages: false + supports_tool_choice: false + supports_web_search: false + supports_prompt_caching: false + supports_embedding: true + supports_audio_input: false + supports_audio_output: false + supports_computer_use: false + # Model family info + mode: "embedding" + model_group: "qwen-family" + region: "ch-gva" + router_settings: redis_host: litellm-redis redis_port: 6379 diff --git a/setup.sh b/setup.sh index 9e5bf39..a0c2ca5 100644 --- a/setup.sh +++ b/setup.sh @@ -2,6 +2,7 @@ cd ~ curl -sL https://deb.nodesource.com/setup_25.x -o nodesource_setup.sh sudo bash nodesource_setup.sh +apt update apt install nodejs make -y mkdir /opt/stacks/onyx cd /opt/stacks/onyx diff --git a/smb-connector/app/extract.py b/smb-connector/app/extract.py index 952222d..1acf021 100644 --- a/smb-connector/app/extract.py +++ b/smb-connector/app/extract.py @@ -78,6 +78,27 @@ _HANDLERS = { "xlsx": _xlsx, "html": _html, "htm": _html, + # Text-based IT formats + "yaml": _txt, + "yml": _txt, + "json": _txt, + "xml": _txt, + "ini": _txt, + "conf": _txt, + "cfg": _txt, + "sh": _txt, + "bash": _txt, + "ps1": _txt, + "py": _txt, + "sql": _txt, + "log": _txt, + "dockerfile": _txt, + "properties": _txt, + "toml": _txt, + "rst": _txt, + "mjs": _txt, + "patch": _txt, + "tsx": _txt, }