Repository: ai-shifu/ChatALL (language: javascript)

Issue:
[FEAT] Add GPT-4.1 model family via OpenAI API
Reference:
- https://openai.com/index/gpt-4-1/
- https://platform.openai.com/docs/models/gpt-4.1



Discussion / hints:
@sunner looking forward to having your pics. We need these three:

- "gpt-4.1"
- "gpt-4.1-mini"
- "gpt-4.1-nano"

Thanks!
![Image](https://github.com/user-attachments/assets/876eeb39-f121-46c2-acbb-433353f22ea5)
![Image](https://github.com/user-attachments/assets/c454b5ba-9c4f-4a98-a93e-f5cc652be59e)
![Image](https://github.com/user-attachments/assets/cfaa7856-b24e-4c7e-a830-f0e7829a50c1)
@PeterDaveHello Here they are.

Fix patch:
diff --git a/public/bots/openai-41-logo.png b/public/bots/openai-41-logo.png
new file mode 100644
index 000000000..7feb53c31
Binary files /dev/null and b/public/bots/openai-41-logo.png differ
diff --git a/public/bots/openai-41-mini-logo.png b/public/bots/openai-41-mini-logo.png
new file mode 100644
index 000000000..f7a46c921
Binary files /dev/null and b/public/bots/openai-41-mini-logo.png differ
diff --git a/public/bots/openai-41-nano-logo.png b/public/bots/openai-41-nano-logo.png
new file mode 100644
index 000000000..e4789533b
Binary files /dev/null and b/public/bots/openai-41-nano-logo.png differ
diff --git a/src/bots/index.js b/src/bots/index.js
index 1ce6ea8f3..694995b9b 100644
--- a/src/bots/index.js
+++ b/src/bots/index.js
@@ -20,6 +20,9 @@ import OpenAIAPI4Bot from "@/bots/openai/OpenAIAPI4Bot";
 import OpenAIAPI4128KBot from "@/bots/openai/OpenAIAPI4128KBot";
 import OpenAIAPI4oBot from "@/bots/openai/OpenAIAPI4oBot";
 import OpenAIAPI4oMiniBot from "./openai/OpenAIAPI4oMiniBot";
+import OpenAIAPI41Bot from "./openai/OpenAIAPI41Bot";
+import OpenAIAPI41MiniBot from "./openai/OpenAIAPI41MiniBot";
+import OpenAIAPI41NanoBot from "./openai/OpenAIAPI41NanoBot";
 import OpenAIAPIo1Bot from "./openai/OpenAIAPIo1Bot";
 import OpenAIAPIo1MiniBot from "./openai/OpenAIAPIo1MiniBot";
 import OpenAIAPIo3MiniBot from "./openai/OpenAIAPIo3MiniBot";
@@ -101,6 +104,9 @@ const all = [
   OpenAIAPI4128KBot.getInstance(),
   OpenAIAPI4oBot.getInstance(),
   OpenAIAPI4oMiniBot.getInstance(),
+  OpenAIAPI41Bot.getInstance(),
+  OpenAIAPI41MiniBot.getInstance(),
+  OpenAIAPI41NanoBot.getInstance(),
   OpenAIAPIo1Bot.getInstance(),
   OpenAIAPIo1MiniBot.getInstance(),
   OpenAIAPIo3MiniBot.getInstance(),
@@ -192,6 +198,9 @@ export const botTags = {
     bots.getBotByClassName("OpenAIAPI4128KBot"),
     bots.getBotByClassName("OpenAIAPI4oBot"),
     bots.getBotByClassName("OpenAIAPI4oMiniBot"),
+    bots.getBotByClassName("OpenAIAPI41Bot"),
+    bots.getBotByClassName("OpenAIAPI41MiniBot"),
+    bots.getBotByClassName("OpenAIAPI41NanoBot"),
     bots.getBotByClassName("OpenAIAPIo1Bot"),
     bots.getBotByClassName("OpenAIAPIo1MiniBot"),
     bots.getBotByClassName("OpenAIAPIo3MiniBot"),
diff --git a/src/bots/openai/OpenAIAPI41Bot.js b/src/bots/openai/OpenAIAPI41Bot.js
new file mode 100644
index 000000000..987071f52
--- /dev/null
+++ b/src/bots/openai/OpenAIAPI41Bot.js
@@ -0,0 +1,12 @@
+import OpenAIAPIBot from "./OpenAIAPIBot";
+
+export default class OpenAIAPI41Bot extends OpenAIAPIBot {
+  static _className = "OpenAIAPI41Bot"; // Class name of the bot
+  static _logoFilename = "openai-41-logo.png"; // Place it in public/bots/
+  static _isDarkLogo = true; // The main color of logo is dark
+  static _model = "gpt-4.1";
+
+  constructor() {
+    super();
+  }
+}
diff --git a/src/bots/openai/OpenAIAPI41MiniBot.js b/src/bots/openai/OpenAIAPI41MiniBot.js
new file mode 100644
index 000000000..d99a0190f
--- /dev/null
+++ b/src/bots/openai/OpenAIAPI41MiniBot.js
@@ -0,0 +1,12 @@
+import OpenAIAPIBot from "./OpenAIAPIBot";
+
+export default class OpenAIAPI41MiniBot extends OpenAIAPIBot {
+  static _className = "OpenAIAPI41MiniBot"; // Class name of the bot
+  static _logoFilename = "openai-41-mini-logo.png"; // Place it in public/bots/
+  static _isDarkLogo = true; // The main color of logo is dark
+  static _model = "gpt-4.1-mini";
+
+  constructor() {
+    super();
+  }
+}
diff --git a/src/bots/openai/OpenAIAPI41NanoBot.js b/src/bots/openai/OpenAIAPI41NanoBot.js
new file mode 100644
index 000000000..7a6873e0c
--- /dev/null
+++ b/src/bots/openai/OpenAIAPI41NanoBot.js
@@ -0,0 +1,12 @@
+import OpenAIAPIBot from "./OpenAIAPIBot";
+
+export default class OpenAIAPI41NanoBot extends OpenAIAPIBot {
+  static _className = "OpenAIAPI41NanoBot"; // Class name of the bot
+  static _logoFilename = "openai-41-nano-logo.png"; // Place it in public/bots/
+  static _isDarkLogo = true; // The main color of logo is dark
+  static _model = "gpt-4.1-nano";
+
+  constructor() {
+    super();
+  }
+}
diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json
index 1a563c5ba..fbeb135b4 100644
--- a/src/i18n/locales/de.json
+++ b/src/i18n/locales/de.json
@@ -240,6 +240,9 @@
     "o1": "o1",
     "o1-mini": "o1-mini",
     "o3-mini": "o3-mini",
+    "gpt-41": "gpt-4.1",
+    "gpt-41-mini": "gpt-4.1-mini",
+    "gpt-41-nano": "gpt-4.1-nano",
     "temperature": "Temperatur",
     "temperaturePrompt": "Je höher die Temperatur, desto kreativer der Text, aber desto wahrscheinlicher ist es, dass er inkohärent ist",
     "temperature0": "Stärker deterministisch",
diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json
index a5e7be57b..b0f6ae14a 100644
--- a/src/i18n/locales/en.json
+++ b/src/i18n/locales/en.json
@@ -240,6 +240,9 @@
     "o1": "o1",
     "o1-mini": "o1-mini",
     "o3-mini": "o3-mini",
+    "gpt-41": "gpt-4.1",
+    "gpt-41-mini": "gpt-4.1-mini",
+    "gpt-41-nano": "gpt-4.1-nano",
     "temperature": "Temperature",
     "temperaturePrompt": "The higher the temperature, the more creative the text, but the more likely it is to be incoherent",
     "temperature0": "More deterministic",
diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json
index c612f8fde..eb8b6ce81 100644
--- a/src/i18n/locales/es.json
+++ b/src/i18n/locales/es.json
@@ -240,6 +240,9 @@
     "o1": "o1",
     "o1-mini": "o1-mini",
     "o3-mini": "o3-mini",
+    "gpt-41": "gpt-4.1",
+    "gpt-41-mini": "gpt-4.1-mini",
+    "gpt-41-nano": "gpt-4.1-nano",
     "temperature": "Temperatura",
     "temperaturePrompt": "Cuanto mayor sea la temperatura, más creativo será el texto, pero más probable es que sea incoherente.",
     "temperature0": "Más determinístico",
diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json
index 73feb6e56..09994d194 100644
--- a/src/i18n/locales/fr.json
+++ b/src/i18n/locales/fr.json
@@ -240,6 +240,9 @@
     "o1": "o1",
     "o1-mini": "o1-mini",
     "o3-mini": "o3-mini",
+    "gpt-41": "gpt-4.1",
+    "gpt-41-mini": "gpt-4.1-mini",
+    "gpt-41-nano": "gpt-4.1-nano",
     "temperature": "Température",
     "temperaturePrompt": "Une température plus élevée favorise la créativité du texte généré, mais le risque d'incohérence augmente également.",
     "temperature0": "Plus déterministe",
diff --git a/src/i18n/locales/it.json b/src/i18n/locales/it.json
index b19d9b48e..ccb5a2b91 100644
--- a/src/i18n/locales/it.json
+++ b/src/i18n/locales/it.json
@@ -241,6 +241,9 @@
     "o1": "o1",
     "o1-mini": "o1-mini",
     "o3-mini": "o3-mini",
+    "gpt-41": "gpt-4.1",
+    "gpt-41-mini": "gpt-4.1-mini",
+    "gpt-41-nano": "gpt-4.1-nano",
     "temperature": "Temperatura",
     "temperaturePrompt": "Più alta è la temperatura, più creativo è il testo, ma maggiore è la probabilità che sia incoerente",
     "temperature0": "Più deterministico",
diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json
index 84a37b04d..266c8d3d4 100644
--- a/src/i18n/locales/ja.json
+++ b/src/i18n/locales/ja.json
@@ -240,6 +240,9 @@
     "o1": "o1",
     "o1-mini": "o1-mini",
     "o3-mini": "o3-mini",
+    "gpt-41": "gpt-4.1",
+    "gpt-41-mini": "gpt-4.1-mini",
+    "gpt-41-nano": "gpt-4.1-nano",
     "temperature": "温度",
     "temperaturePrompt": "温度が高いほど、テキストは創造的ですが、一貫性がない可能性が高いです。",
     "temperature0": "より決定論的な",
diff --git a/src/i18n/locales/ko.json b/src/i18n/locales/ko.json
index 212ed6f9b..bf3c6e3ee 100644
--- a/src/i18n/locales/ko.json
+++ b/src/i18n/locales/ko.json
@@ -240,6 +240,9 @@
     "o1": "o1",
     "o1-mini": "o1-mini",
     "o3-mini": "o3-mini",
+    "gpt-41": "gpt-4.1",
+    "gpt-41-mini": "gpt-4.1-mini",
+    "gpt-41-nano": "gpt-4.1-nano",
     "temperature": "온도",
     "temperaturePrompt": "온도가 높을수록 텍스트는 창의적이지만 일관성이 없을 가능성이 높습니다",
     "temperature0": "더 결정론적인",
diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json
index 205103c8f..948965359 100644
--- a/src/i18n/locales/ru.json
+++ b/src/i18n/locales/ru.json
@@ -240,6 +240,9 @@
     "o1": "o1",
     "o1-mini": "o1-mini",
     "o3-mini": "o3-mini",
+    "gpt-41": "gpt-4.1",
+    "gpt-41-mini": "gpt-4.1-mini",
+    "gpt-41-nano": "gpt-4.1-nano",
     "temperature": "Температура",
     "temperaturePrompt": "Чем выше температура, тем креативнее текст, но тем больше вероятность того, что он будет бессвязным",
     "temperature0": "Более определенный",
diff --git a/src/i18n/locales/vi.json b/src/i18n/locales/vi.json
index a789fc311..4f82c33e4 100644
--- a/src/i18n/locales/vi.json
+++ b/src/i18n/locales/vi.json
@@ -221,6 +221,9 @@
     "o1": "o1",
     "o1-mini": "o1-mini",
     "o3-mini": "o3-mini",
+    "gpt-41": "gpt-4.1",
+    "gpt-41-mini": "gpt-4.1-mini",
+    "gpt-41-nano": "gpt-4.1-nano",
     "temperature": "Temperature",
     "temperaturePrompt": "Temperature càng cao, văn bản càng sáng tạo nhưng càng có khả năng trở nên rời rạc",
     "temperature0": "Cụ thể hơn",
diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json
index a2a5b237d..0c1ec08a4 100644
--- a/src/i18n/locales/zh.json
+++ b/src/i18n/locales/zh.json
@@ -240,6 +240,9 @@
     "o1": "o1",
     "o1-mini": "o1-mini",
     "o3-mini": "o3-mini",
+    "gpt-41": "gpt-4.1",
+    "gpt-41-mini": "gpt-4.1-mini",
+    "gpt-41-nano": "gpt-4.1-nano",
     "temperature": "Temperature",
     "temperaturePrompt": "Temperature 越高，生成的文本越有创造性，但也越没条理",
     "temperature0": "更具确定性",
diff --git a/src/i18n/locales/zhtw.json b/src/i18n/locales/zhtw.json
index fa5aebb17..e21156711 100644
--- a/src/i18n/locales/zhtw.json
+++ b/src/i18n/locales/zhtw.json
@@ -240,6 +240,9 @@
     "o1": "o1",
     "o1-mini": "o1-mini",
     "o3-mini": "o3-mini",
+    "gpt-41": "gpt-4.1",
+    "gpt-41-mini": "gpt-4.1-mini",
+    "gpt-41-nano": "gpt-4.1-nano",
     "temperature": "Temperature",
     "temperaturePrompt": "Temperature 越高，生成的文字越有創造性，但也越可能無法理解",
     "temperature0": "更具確定性",


Test patch: