From 2d333bb63f090c922157826d375c2d3867c2132c Mon Sep 17 00:00:00 2001 From: Aimery Assire Date: Tue, 17 Mar 2026 17:38:49 +0000 Subject: [PATCH 1/4] fix: add setuptools packages config for editable install The flat-layout Django project caused setuptools to fail on `pip install -e .` because it discovered multiple top-level packages. Explicitly list them in `[tool.setuptools.packages.find]`. --- pyproject.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index dfb7680..2c0577d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,6 +75,21 @@ python_files = ["tests/*.py", "tests/**/*.py"] python_classes = ["Test*"] python_functions = ["test_*"] +[tool.setuptools.packages.find] +include = [ + "score*", + "analysis*", + "chat*", + "connectors*", + "dashboard*", + "ingestion*", + "llm*", + "nsg*", + "reports*", + "tenants*", + "vectorstore*", +] + [tool.ruff] target-version = "py312" line-length = 100 From 2db6068d08aad345ce3c7aea54f6ce085b59a5ea Mon Sep 17 00:00:00 2001 From: Aimery Assire Date: Tue, 17 Mar 2026 17:39:00 +0000 Subject: [PATCH 2/4] feat: add OPENAI_BASE_URL support for OpenAI-compatible endpoints Allow configuring a custom base URL for the OpenAI client via the OPENAI_BASE_URL environment variable. This enables use with LiteLLM, vLLM, or any OpenAI-compatible API proxy. --- llm/client.py | 5 ++++- score/settings.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/llm/client.py b/llm/client.py index 73eccb2..0d824ea 100644 --- a/llm/client.py +++ b/llm/client.py @@ -99,7 +99,10 @@ def __init__(self): ) else: openai_cfg = config["openai"] - self._client = OpenAI(api_key=openai_cfg["api_key"]) + client_kwargs: dict[str, str] = {"api_key": openai_cfg["api_key"]} + if openai_cfg.get("base_url"): + client_kwargs["base_url"] = openai_cfg["base_url"] + self._client = OpenAI(**client_kwargs) self._embed_client = self._client self._chat_model = openai_cfg["chat_model"] self._embed_model = openai_cfg["embedding_model"] diff --git a/score/settings.py b/score/settings.py index c5dd0c0..7ca59d6 100644 --- a/score/settings.py +++ b/score/settings.py @@ -226,6 +226,7 @@ "provider": LLM_PROVIDER, "openai": { "api_key": env("OPENAI_API_KEY", default=""), + "base_url": env("OPENAI_BASE_URL", default=""), "chat_model": _llm_yaml.get("chat_model", "gpt-4o"), "embedding_model": _llm_yaml.get("embedding_model", "text-embedding-3-small"), "embedding_dimensions": _llm_yaml.get("embedding_dimensions", 1536), From 031cab1a0349837cde7f9d3767009bac850b703b Mon Sep 17 00:00:00 2001 From: Aimery Assire Date: Mon, 16 Mar 2026 20:30:06 +0000 Subject: [PATCH 3/4] fix: only send dimensions param for text-embedding-* models LiteLLM rejects the dimensions parameter for non-OpenAI embedding models like bge-m3. Only send it for text-embedding-* models. --- llm/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llm/client.py b/llm/client.py index 0d824ea..3810732 100644 --- a/llm/client.py +++ b/llm/client.py @@ -334,8 +334,8 @@ def embed(self, texts: list[str], on_progress=None) -> list[list[float]]: batch = texts[i : i + self._batch_size] kwargs = {"model": self._embed_model, "input": batch} - # OpenAI and Azure OpenAI support dimensions param for text-embedding-3-* models - if self._embed_dimensions: + # Only send dimensions for models that support it (text-embedding-3-*) + if self._embed_dimensions and self._embed_model.startswith("text-embedding-"): kwargs["dimensions"] = self._embed_dimensions response = self._call_with_retry(self._embed_client.embeddings.create, **kwargs) From d18dd38f5748337dc2093fc6b4f991841fc92eaf Mon Sep 17 00:00:00 2001 From: Aimery Assire Date: Tue, 17 Mar 2026 09:34:48 +0000 Subject: [PATCH 4/4] fix(chat): replace hardcoded Mistral branding with actual LLM model name - Replace Mistral SVG icons with generic AI icon in model toolbar button - Display actual configured model name from config.yaml instead of "Medium" - Remove non-functional Mistral model selector dropdown (Medium/Large/Codestral/Magistral) - Pass chat_model_name from LLM_CONFIG to template context - Clean up orphaned JS references to model dropdown handlers --- chat/templates/chat/home.html | 133 ++++------------------------------ chat/views.py | 13 ++++ 2 files changed, 27 insertions(+), 119 deletions(-) diff --git a/chat/templates/chat/home.html b/chat/templates/chat/home.html index 28545c2..fcba262 100644 --- a/chat/templates/chat/home.html +++ b/chat/templates/chat/home.html @@ -332,9 +332,9 @@ line-height: 1; margin-left: -1px; } - .toolbar-btn .mistral-logo { - width: 18px; - height: 14px; + .toolbar-btn .model-icon { + width: 16px; + height: 16px; flex-shrink: 0; } @@ -888,7 +888,7 @@ } .model-option:hover { background: var(--chat-toolbar-hover); } .model-option.active { border-color: var(--chat-chatbox-text); } - .model-option .mistral-logo { width: 18px; height: 14px; } + .model-option .model-icon { width: 16px; height: 16px; } .toolbar-btn--model { gap: 5px; } .toolbar-btn--model .model-label { pointer-events: none; } @@ -1364,11 +1364,10 @@

{% trans "Assistant documentaire" %}
- -
-