@lobehub/chat 1.119.1 → 1.120.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/.vscode/settings.json +2 -3
  2. package/CHANGELOG.md +58 -0
  3. package/changelog/v1.json +17 -0
  4. package/package.json +5 -6
  5. package/packages/const/src/auth.ts +0 -36
  6. package/packages/const/src/index.ts +3 -1
  7. package/packages/database/src/models/__tests__/aiModel.test.ts +1 -2
  8. package/packages/database/src/models/__tests__/generationBatch.test.ts +47 -1
  9. package/packages/database/src/models/aiModel.ts +2 -3
  10. package/packages/database/src/models/generationBatch.ts +8 -1
  11. package/packages/database/src/repositories/aiInfra/index.test.ts +1 -1
  12. package/packages/database/src/repositories/aiInfra/index.ts +4 -4
  13. package/packages/model-bank/src/aiModels/ai21.ts +1 -1
  14. package/packages/model-bank/src/aiModels/ai302.ts +1 -1
  15. package/packages/model-bank/src/aiModels/ai360.ts +1 -1
  16. package/packages/model-bank/src/aiModels/aihubmix.ts +3 -3
  17. package/packages/model-bank/src/aiModels/akashchat.ts +1 -1
  18. package/packages/model-bank/src/aiModels/anthropic.ts +1 -1
  19. package/packages/model-bank/src/aiModels/azure.ts +1 -1
  20. package/packages/model-bank/src/aiModels/azureai.ts +1 -1
  21. package/packages/model-bank/src/aiModels/baichuan.ts +1 -1
  22. package/packages/model-bank/src/aiModels/bedrock.ts +1 -1
  23. package/packages/model-bank/src/aiModels/bfl.ts +2 -3
  24. package/packages/model-bank/src/aiModels/cloudflare.ts +1 -1
  25. package/packages/model-bank/src/aiModels/cohere.ts +1 -1
  26. package/packages/model-bank/src/aiModels/deepseek.ts +1 -1
  27. package/packages/model-bank/src/aiModels/fal.ts +1 -1
  28. package/packages/model-bank/src/aiModels/fireworksai.ts +1 -1
  29. package/packages/model-bank/src/aiModels/giteeai.ts +1 -1
  30. package/packages/model-bank/src/aiModels/github.ts +1 -1
  31. package/packages/model-bank/src/aiModels/google.ts +6 -7
  32. package/packages/model-bank/src/aiModels/groq.ts +1 -1
  33. package/packages/model-bank/src/aiModels/higress.ts +1 -1
  34. package/packages/model-bank/src/aiModels/huggingface.ts +1 -1
  35. package/packages/model-bank/src/aiModels/hunyuan.ts +1 -1
  36. package/packages/model-bank/src/aiModels/index.ts +1 -1
  37. package/packages/model-bank/src/aiModels/infiniai.ts +1 -1
  38. package/packages/model-bank/src/aiModels/internlm.ts +1 -1
  39. package/packages/model-bank/src/aiModels/jina.ts +1 -1
  40. package/packages/model-bank/src/aiModels/lmstudio.ts +1 -1
  41. package/packages/model-bank/src/aiModels/lobehub.ts +1 -1
  42. package/packages/model-bank/src/aiModels/minimax.ts +1 -1
  43. package/packages/model-bank/src/aiModels/mistral.ts +1 -1
  44. package/packages/model-bank/src/aiModels/modelscope.ts +1 -1
  45. package/packages/model-bank/src/aiModels/moonshot.ts +1 -1
  46. package/packages/model-bank/src/aiModels/novita.ts +1 -1
  47. package/packages/model-bank/src/aiModels/nvidia.ts +1 -1
  48. package/packages/model-bank/src/aiModels/ollama.ts +1 -1
  49. package/packages/model-bank/src/aiModels/openai.ts +1 -1
  50. package/packages/model-bank/src/aiModels/openrouter.ts +3 -3
  51. package/packages/model-bank/src/aiModels/perplexity.ts +1 -1
  52. package/packages/model-bank/src/aiModels/ppio.ts +1 -1
  53. package/packages/model-bank/src/aiModels/qiniu.ts +1 -1
  54. package/packages/model-bank/src/aiModels/qwen.ts +4 -2
  55. package/packages/model-bank/src/aiModels/sambanova.ts +1 -1
  56. package/packages/model-bank/src/aiModels/search1api.ts +1 -1
  57. package/packages/model-bank/src/aiModels/sensenova.ts +1 -1
  58. package/packages/model-bank/src/aiModels/siliconcloud.ts +7 -1
  59. package/packages/model-bank/src/aiModels/spark.ts +1 -1
  60. package/packages/model-bank/src/aiModels/stepfun.ts +1 -1
  61. package/packages/model-bank/src/aiModels/taichu.ts +1 -1
  62. package/packages/model-bank/src/aiModels/tencentcloud.ts +1 -1
  63. package/packages/model-bank/src/aiModels/togetherai.ts +1 -1
  64. package/packages/model-bank/src/aiModels/upstage.ts +1 -1
  65. package/packages/model-bank/src/aiModels/v0.ts +1 -1
  66. package/packages/model-bank/src/aiModels/vertexai.ts +3 -3
  67. package/packages/model-bank/src/aiModels/vllm.ts +1 -1
  68. package/packages/model-bank/src/aiModels/volcengine.ts +1 -1
  69. package/packages/model-bank/src/aiModels/wenxin.ts +1 -1
  70. package/packages/model-bank/src/aiModels/xai.ts +1 -1
  71. package/packages/model-bank/src/aiModels/xinference.ts +1 -1
  72. package/packages/model-bank/src/aiModels/zeroone.ts +1 -1
  73. package/packages/model-bank/src/aiModels/zhipu.ts +1 -1
  74. package/packages/model-bank/src/index.ts +1 -0
  75. package/packages/model-bank/src/standard-parameters/index.ts +48 -0
  76. package/packages/{types/src → model-bank/src/types}/aiModel.ts +12 -1
  77. package/packages/model-bank/src/types/index.ts +1 -0
  78. package/packages/model-runtime/package.json +4 -1
  79. package/packages/model-runtime/src/BaseAI.ts +2 -2
  80. package/packages/model-runtime/src/ModelRuntime.test.ts +4 -4
  81. package/packages/model-runtime/src/RouterRuntime/createRuntime.ts +3 -7
  82. package/packages/model-runtime/src/ai302/index.ts +1 -1
  83. package/packages/model-runtime/src/aihubmix/index.ts +1 -2
  84. package/packages/model-runtime/src/anthropic/index.ts +1 -1
  85. package/packages/model-runtime/src/azureOpenai/index.ts +2 -3
  86. package/packages/model-runtime/src/azureai/index.ts +2 -3
  87. package/packages/model-runtime/src/bedrock/index.ts +1 -1
  88. package/packages/model-runtime/src/bfl/createImage.test.ts +4 -4
  89. package/packages/model-runtime/src/bfl/createImage.ts +2 -2
  90. package/packages/model-runtime/src/bfl/index.ts +1 -1
  91. package/packages/model-runtime/src/cloudflare/index.ts +1 -1
  92. package/packages/model-runtime/src/const/models.ts +64 -0
  93. package/packages/model-runtime/src/fal/index.test.ts +2 -3
  94. package/packages/model-runtime/src/fal/index.ts +1 -1
  95. package/packages/model-runtime/src/github/index.ts +1 -1
  96. package/packages/model-runtime/src/google/createImage.test.ts +1 -1
  97. package/packages/model-runtime/src/google/createImage.ts +53 -25
  98. package/packages/model-runtime/src/google/index.test.ts +1 -1
  99. package/packages/model-runtime/src/google/index.ts +4 -3
  100. package/packages/model-runtime/src/groq/index.ts +1 -1
  101. package/packages/model-runtime/src/helpers/parseToolCalls.ts +1 -2
  102. package/packages/model-runtime/src/huggingface/index.ts +1 -1
  103. package/packages/model-runtime/src/index.ts +3 -1
  104. package/packages/model-runtime/src/infiniai/index.ts +1 -1
  105. package/packages/model-runtime/src/ollama/index.test.ts +1 -1
  106. package/packages/model-runtime/src/ollama/index.ts +2 -3
  107. package/packages/model-runtime/src/openai/index.ts +16 -8
  108. package/packages/model-runtime/src/providerTestUtils.ts +1 -2
  109. package/packages/model-runtime/src/qiniu/index.test.ts +2 -3
  110. package/packages/model-runtime/src/qwen/index.ts +1 -1
  111. package/packages/model-runtime/src/siliconcloud/index.ts +2 -2
  112. package/packages/model-runtime/src/types/chat.ts +2 -22
  113. package/packages/model-runtime/src/{error.ts → types/error.ts} +29 -0
  114. package/packages/model-runtime/src/types/index.ts +4 -0
  115. package/packages/model-runtime/src/types/toolsCalling.ts +48 -0
  116. package/packages/model-runtime/src/types/type.ts +1 -1
  117. package/packages/model-runtime/src/types/usage.ts +27 -0
  118. package/packages/model-runtime/src/utils/anthropicHelpers.test.ts +2 -2
  119. package/packages/model-runtime/src/utils/anthropicHelpers.ts +1 -1
  120. package/packages/model-runtime/src/utils/createError.ts +1 -1
  121. package/packages/model-runtime/src/utils/errorResponse.test.ts +110 -0
  122. package/packages/model-runtime/src/utils/errorResponse.ts +64 -0
  123. package/packages/{utils/src → model-runtime/src/utils}/getFallbackModelProperty.ts +1 -1
  124. package/packages/model-runtime/src/utils/googleErrorParser.test.ts +1 -1
  125. package/packages/model-runtime/src/utils/googleErrorParser.ts +1 -1
  126. package/packages/model-runtime/src/utils/handleOpenAIError.ts +1 -1
  127. package/packages/model-runtime/src/utils/imageToBase64.test.ts +91 -0
  128. package/packages/model-runtime/src/utils/imageToBase64.ts +62 -0
  129. package/packages/model-runtime/src/utils/modelParse.test.ts +2 -2
  130. package/packages/model-runtime/src/utils/modelParse.ts +16 -10
  131. package/packages/model-runtime/src/utils/openaiCompatibleFactory/createImage.ts +1 -1
  132. package/packages/model-runtime/src/utils/openaiCompatibleFactory/index.ts +3 -3
  133. package/packages/model-runtime/src/utils/openaiHelpers.test.ts +2 -2
  134. package/packages/model-runtime/src/utils/openaiHelpers.ts +3 -4
  135. package/packages/model-runtime/src/utils/postProcessModelList.ts +2 -2
  136. package/packages/model-runtime/src/utils/safeParseJSON.test.ts +71 -0
  137. package/packages/model-runtime/src/utils/safeParseJSON.ts +12 -0
  138. package/packages/model-runtime/src/utils/streams/bedrock/claude.ts +1 -1
  139. package/packages/model-runtime/src/utils/streams/bedrock/llama.test.ts +1 -2
  140. package/packages/model-runtime/src/utils/streams/bedrock/llama.ts +1 -1
  141. package/packages/model-runtime/src/utils/streams/google-ai.test.ts +1 -1
  142. package/packages/model-runtime/src/utils/streams/google-ai.ts +1 -1
  143. package/packages/model-runtime/src/utils/streams/ollama.test.ts +1 -1
  144. package/packages/model-runtime/src/utils/streams/ollama.ts +2 -3
  145. package/packages/model-runtime/src/utils/streams/openai/openai.test.ts +1 -2
  146. package/packages/model-runtime/src/utils/streams/openai/openai.ts +1 -1
  147. package/packages/model-runtime/src/utils/streams/openai/responsesStream.ts +1 -1
  148. package/packages/model-runtime/src/utils/streams/protocol.ts +3 -3
  149. package/packages/model-runtime/src/utils/streams/vertex-ai.test.ts +1 -1
  150. package/packages/model-runtime/src/utils/streams/vertex-ai.ts +2 -2
  151. package/packages/model-runtime/src/utils/uuid.ts +7 -0
  152. package/packages/model-runtime/src/vertexai/index.ts +1 -1
  153. package/packages/types/src/agent/index.ts +2 -1
  154. package/packages/types/src/aiProvider.ts +10 -2
  155. package/packages/types/src/auth.ts +35 -0
  156. package/packages/types/src/discover/models.ts +1 -1
  157. package/packages/types/src/discover/providers.ts +1 -1
  158. package/packages/types/src/index.ts +4 -0
  159. package/packages/types/src/llm.ts +2 -47
  160. package/packages/types/src/session/agentSession.ts +3 -3
  161. package/packages/types/src/session/index.ts +2 -2
  162. package/packages/types/src/session/sessionGroup.ts +0 -2
  163. package/packages/types/src/user/settings/general.ts +1 -1
  164. package/packages/types/src/user/settings/modelProvider.ts +1 -1
  165. package/packages/utils/src/fetch/fetchSSE.ts +1 -1
  166. package/packages/utils/src/format.ts +2 -3
  167. package/packages/utils/src/index.ts +3 -1
  168. package/packages/utils/src/number.test.ts +1 -2
  169. package/packages/utils/src/number.ts +1 -2
  170. package/packages/utils/src/parseModels.test.ts +1 -2
  171. package/packages/utils/src/parseModels.ts +2 -3
  172. package/packages/utils/src/pricing.test.ts +1 -2
  173. package/packages/utils/src/pricing.ts +1 -1
  174. package/packages/utils/src/server/xor.ts +3 -1
  175. package/src/app/(backend)/middleware/auth/index.ts +1 -2
  176. package/src/app/(backend)/webapi/chat/vertexai/route.ts +1 -1
  177. package/src/app/(backend)/webapi/text-to-image/[provider]/route.ts +1 -2
  178. package/src/app/[variants]/(main)/(mobile)/me/settings/features/useCategory.tsx +2 -16
  179. package/src/app/[variants]/(main)/chat/@session/_layout/Desktop/SessionHeader.tsx +1 -3
  180. package/src/app/[variants]/(main)/chat/@session/_layout/Mobile/SessionHeader.tsx +1 -3
  181. package/src/app/[variants]/(main)/discover/(list)/model/features/List/ModelTypeIcon.tsx +1 -2
  182. package/src/app/[variants]/(main)/image/@menu/components/SeedNumberInput/index.tsx +1 -1
  183. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/hooks/useAutoDimensions.ts +4 -3
  184. package/src/app/[variants]/(main)/settings/hooks/useCategory.tsx +3 -21
  185. package/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/Form.tsx +1 -1
  186. package/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelItem.tsx +1 -1
  187. package/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/ListItem.tsx +1 -1
  188. package/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/index.tsx +1 -1
  189. package/src/components/ModelSelect/index.tsx +1 -1
  190. package/src/config/featureFlags/schema.test.ts +1 -2
  191. package/src/config/featureFlags/schema.ts +0 -6
  192. package/src/config/featureFlags/utils/parser.test.ts +7 -7
  193. package/src/database/_deprecated/core/index.ts +0 -1
  194. package/src/database/_deprecated/core/migrations/migrateSettingsToUser/type.ts +2 -5
  195. package/src/database/_deprecated/core/model.ts +4 -38
  196. package/src/database/_deprecated/models/message.ts +1 -1
  197. package/src/features/Conversation/Extras/Usage/UsageDetail/ModelCard.tsx +1 -1
  198. package/src/features/Conversation/Extras/Usage/UsageDetail/pricing.ts +3 -4
  199. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.test.ts +1 -1
  200. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.ts +3 -2
  201. package/src/layout/GlobalProvider/StoreInitialization.tsx +0 -3
  202. package/src/libs/trpc/async/context.ts +2 -1
  203. package/src/libs/trpc/edge/context.ts +2 -6
  204. package/src/libs/trpc/lambda/context.ts +1 -1
  205. package/src/migrations/FromV5ToV6/types/v5.ts +2 -2
  206. package/src/migrations/FromV5ToV6/types/v6.ts +2 -1
  207. package/src/server/globalConfig/genServerAiProviderConfig.ts +3 -3
  208. package/src/server/modules/ModelRuntime/index.test.ts +1 -1
  209. package/src/server/modules/ModelRuntime/index.ts +1 -1
  210. package/src/server/routers/async/caller.ts +2 -1
  211. package/src/server/routers/async/image.ts +2 -2
  212. package/src/server/routers/lambda/aiModel.ts +1 -1
  213. package/src/server/services/chunk/index.ts +2 -1
  214. package/src/server/services/generation/index.ts +2 -2
  215. package/src/services/_auth.ts +2 -1
  216. package/src/services/aiModel/server.test.ts +1 -1
  217. package/src/services/aiModel/type.ts +1 -1
  218. package/src/services/chat.ts +1 -1
  219. package/src/services/upload.ts +3 -3
  220. package/src/store/agent/slices/chat/action.ts +1 -1
  221. package/src/store/aiInfra/slices/aiModel/action.ts +6 -6
  222. package/src/store/aiInfra/slices/aiModel/initialState.ts +1 -1
  223. package/src/store/aiInfra/slices/aiModel/selectors.test.ts +1 -1
  224. package/src/store/aiInfra/slices/aiModel/selectors.ts +2 -1
  225. package/src/store/aiInfra/slices/aiProvider/__tests__/action.test.ts +7 -7
  226. package/src/store/aiInfra/slices/aiProvider/action.ts +8 -8
  227. package/src/store/aiInfra/slices/aiProvider/initialState.ts +2 -1
  228. package/src/store/electron/actions/app.ts +1 -1
  229. package/src/store/image/slices/generationConfig/action.test.ts +1 -1
  230. package/src/store/image/slices/generationConfig/action.ts +1 -1
  231. package/src/store/image/slices/generationConfig/hooks.test.ts +1 -1
  232. package/src/store/image/slices/generationConfig/hooks.ts +6 -3
  233. package/src/store/image/slices/generationConfig/selectors.test.ts +1 -1
  234. package/src/store/serverConfig/selectors.test.ts +0 -1
  235. package/src/store/user/initialState.ts +1 -4
  236. package/src/store/user/selectors.ts +0 -1
  237. package/src/store/user/slices/auth/action.ts +1 -1
  238. package/src/store/user/slices/auth/selectors.ts +3 -4
  239. package/src/store/user/slices/modelList/action.ts +8 -7
  240. package/src/store/user/slices/modelList/selectors/modelProvider.ts +8 -5
  241. package/src/store/user/slices/preference/selectors.ts +3 -2
  242. package/src/store/user/slices/settings/selectors/settings.ts +1 -2
  243. package/src/store/user/store.ts +1 -4
  244. package/docs/self-hosting/advanced/webrtc.mdx +0 -86
  245. package/docs/self-hosting/advanced/webrtc.zh-CN.mdx +0 -80
  246. package/packages/const/src/image.ts +0 -51
  247. package/src/app/[variants]/(main)/settings/sync/features/Alert.tsx +0 -53
  248. package/src/app/[variants]/(main)/settings/sync/features/DeviceInfo/Card.tsx +0 -42
  249. package/src/app/[variants]/(main)/settings/sync/features/DeviceInfo/DeviceName.tsx +0 -62
  250. package/src/app/[variants]/(main)/settings/sync/features/DeviceInfo/SystemIcon.tsx +0 -31
  251. package/src/app/[variants]/(main)/settings/sync/features/DeviceInfo/index.tsx +0 -103
  252. package/src/app/[variants]/(main)/settings/sync/features/WebRTC/ChannelNameInput.tsx +0 -45
  253. package/src/app/[variants]/(main)/settings/sync/features/WebRTC/SyncSwitch/index.css +0 -238
  254. package/src/app/[variants]/(main)/settings/sync/features/WebRTC/SyncSwitch/index.tsx +0 -79
  255. package/src/app/[variants]/(main)/settings/sync/features/WebRTC/generateRandomRoomName.ts +0 -4
  256. package/src/app/[variants]/(main)/settings/sync/features/WebRTC/index.tsx +0 -103
  257. package/src/app/[variants]/(main)/settings/sync/index.tsx +0 -17
  258. package/src/app/[variants]/(main)/settings/sync/page.tsx +0 -29
  259. package/src/database/_deprecated/core/sync.ts +0 -321
  260. package/src/features/SyncStatusInspector/DisableSync.tsx +0 -79
  261. package/src/features/SyncStatusInspector/EnableSync.tsx +0 -132
  262. package/src/features/SyncStatusInspector/EnableTag.tsx +0 -66
  263. package/src/features/SyncStatusInspector/index.tsx +0 -27
  264. package/src/hooks/useSyncData.ts +0 -50
  265. package/src/services/__tests__/sync.test.ts +0 -56
  266. package/src/services/sync.ts +0 -19
  267. package/src/store/user/slices/sync/action.test.ts +0 -164
  268. package/src/store/user/slices/sync/action.ts +0 -101
  269. package/src/store/user/slices/sync/initialState.ts +0 -13
  270. package/src/store/user/slices/sync/selectors.ts +0 -20
  271. /package/packages/{utils/src → model-runtime/src/utils}/getFallbackModelProperty.test.ts +0 -0
@@ -34,7 +34,7 @@
34
34
  // make stylelint work with tsx antd-style css template string
35
35
  "typescriptreact"
36
36
  ],
37
- "vitest.maximumConfigs": 10,
37
+ "vitest.maximumConfigs": 20,
38
38
  "workbench.editor.customLabels.patterns": {
39
39
  "**/app/**/[[]*[]]/[[]*[]]/page.tsx": "${dirname(2)}/${dirname(1)}/${dirname} • page component",
40
40
  "**/app/**/[[]*[]]/page.tsx": "${dirname(1)}/${dirname} • page component",
@@ -81,8 +81,7 @@
81
81
  "**/src/store/*/slices/*/reducer.ts": "${dirname(2)}/${dirname} • reducer",
82
82
 
83
83
  "**/src/config/modelProviders/*.ts": "${filename} • provider",
84
- "**/src/config/aiModels/*.ts": "${filename} • model",
85
- "**/src/config/paramsSchemas/*/*.json": "${dirname(1)}/${filename} • params",
84
+ "**/packages/model-bank/src/aiModels/aiModels/*.ts": "${filename} • model",
86
85
  "**/packages/model-runtime/src/*/index.ts": "${dirname} • runtime",
87
86
 
88
87
  "**/src/server/services/*/index.ts": "${dirname} • server/service",
package/CHANGELOG.md CHANGED
@@ -2,6 +2,64 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 1.120.0](https://github.com/lobehub/lobe-chat/compare/v1.119.2...v1.120.0)
6
+
7
+ <sup>Released on **2025-08-30**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Remove webrtc sync feature flag.
12
+
13
+ #### ✨ Features
14
+
15
+ - **misc**: Rename Gemini 2.5 flash image to Nano Banana.
16
+
17
+ <br/>
18
+
19
+ <details>
20
+ <summary><kbd>Improvements and Fixes</kbd></summary>
21
+
22
+ #### Code refactoring
23
+
24
+ - **misc**: Remove webrtc sync feature flag, closes [#9002](https://github.com/lobehub/lobe-chat/issues/9002) ([0924d98](https://github.com/lobehub/lobe-chat/commit/0924d98))
25
+
26
+ #### What's improved
27
+
28
+ - **misc**: Rename Gemini 2.5 flash image to Nano Banana, closes [#9004](https://github.com/lobehub/lobe-chat/issues/9004) ([dac5a6f](https://github.com/lobehub/lobe-chat/commit/dac5a6f))
29
+
30
+ </details>
31
+
32
+ <div align="right">
33
+
34
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
35
+
36
+ </div>
37
+
38
+ ### [Version 1.119.2](https://github.com/lobehub/lobe-chat/compare/v1.119.1...v1.119.2)
39
+
40
+ <sup>Released on **2025-08-30**</sup>
41
+
42
+ #### ♻ Code Refactoring
43
+
44
+ - **model-runtime**: Refactor model-runtime dependencies and clean code.
45
+
46
+ <br/>
47
+
48
+ <details>
49
+ <summary><kbd>Improvements and Fixes</kbd></summary>
50
+
51
+ #### Code refactoring
52
+
53
+ - **model-runtime**: Refactor model-runtime dependencies and clean code, closes [#8997](https://github.com/lobehub/lobe-chat/issues/8997) ([9f7677d](https://github.com/lobehub/lobe-chat/commit/9f7677d))
54
+
55
+ </details>
56
+
57
+ <div align="right">
58
+
59
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
60
+
61
+ </div>
62
+
5
63
  ### [Version 1.119.1](https://github.com/lobehub/lobe-chat/compare/v1.119.0...v1.119.1)
6
64
 
7
65
  <sup>Released on **2025-08-30**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,21 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Remove webrtc sync feature flag."
6
+ ],
7
+ "features": [
8
+ "Rename Gemini 2.5 flash image to Nano Banana."
9
+ ]
10
+ },
11
+ "date": "2025-08-30",
12
+ "version": "1.120.0"
13
+ },
14
+ {
15
+ "children": {},
16
+ "date": "2025-08-30",
17
+ "version": "1.119.2"
18
+ },
2
19
  {
3
20
  "children": {
4
21
  "fixes": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.119.1",
3
+ "version": "1.120.0",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -54,7 +54,9 @@
54
54
  "docs:seo": "lobe-seo && npm run lint:mdx",
55
55
  "i18n": "npm run workflow:i18n && lobe-i18n && prettier -c --write \"locales/**\"",
56
56
  "lint": "npm run lint:ts && npm run lint:style && npm run type-check && npm run lint:circular",
57
- "lint:circular": "dpdm src/**/*.ts --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular",
57
+ "lint:circular": "npm run lint:circular:main && npm run lint:circular:packages",
58
+ "lint:circular:main": "dpdm src/**/*.ts --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular",
59
+ "lint:circular:packages": "dpdm packages/**/src/**/*.ts --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular",
58
60
  "lint:md": "remark . --silent --output",
59
61
  "lint:mdx": "npm run workflow:mdx && remark \"docs/**/*.mdx\" -r ./.remarkrc.mdx.js --silent --output && eslint \"docs/**/*.mdx\" --quiet --fix",
60
62
  "lint:style": "stylelint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
@@ -273,10 +275,7 @@
273
275
  "use-merge-value": "^1.2.0",
274
276
  "uuid": "^11.1.0",
275
277
  "ws": "^8.18.3",
276
- "y-protocols": "^1.0.6",
277
- "y-webrtc": "^10.3.0",
278
278
  "yaml": "^2.8.1",
279
- "yjs": "^13.6.27",
280
279
  "zod": "^3.25.76",
281
280
  "zustand": "5.0.4",
282
281
  "zustand-utils": "^2.1.0"
@@ -328,7 +327,7 @@
328
327
  "crypto-js": "^4.2.0",
329
328
  "dbdocs": "^0.16.0",
330
329
  "dotenv": "^17.0.0",
331
- "dpdm-fast": "1.0.7",
330
+ "dpdm-fast": "^1.0.13",
332
331
  "drizzle-dbml-generator": "^0.10.0",
333
332
  "drizzle-kit": "^0.31.4",
334
333
  "eslint": "^8.57.1",
@@ -10,39 +10,3 @@ export const LOBE_CHAT_OIDC_AUTH_HEADER = 'Oidc-Auth';
10
10
  export const OAUTH_AUTHORIZED = 'X-oauth-authorized';
11
11
 
12
12
  export const SECRET_XOR_KEY = 'LobeHub · LobeHub';
13
-
14
- /* eslint-disable typescript-sort-keys/interface */
15
- export interface ClientSecretPayload {
16
- /**
17
- * password
18
- */
19
- accessCode?: string;
20
- /**
21
- * Represents the user's API key
22
- *
23
- * If provider need multi keys like bedrock,
24
- * this will be used as the checker whether to use frontend key
25
- */
26
- apiKey?: string;
27
- /**
28
- * Represents the endpoint of provider
29
- */
30
- baseURL?: string;
31
-
32
- azureApiVersion?: string;
33
-
34
- awsAccessKeyId?: string;
35
- awsRegion?: string;
36
- awsSecretAccessKey?: string;
37
- awsSessionToken?: string;
38
-
39
- cloudflareBaseURLOrAccountID?: string;
40
-
41
- /**
42
- * user id
43
- * in client db mode it's a uuid
44
- * in server db mode it's a user id
45
- */
46
- userId?: string;
47
- }
48
- /* eslint-enable */
@@ -1,6 +1,8 @@
1
+ export * from './auth';
1
2
  export * from './branding';
2
- export * from './image';
3
+ export * from './currency';
3
4
  export * from './layoutTokens';
4
5
  export * from './message';
5
6
  export * from './settings';
7
+ export * from './user';
6
8
  export * from './version';
@@ -1,9 +1,8 @@
1
1
  // @vitest-environment node
2
2
  import { eq } from 'drizzle-orm';
3
+ import { AiProviderModelListItem } from 'model-bank';
3
4
  import { afterEach, beforeEach, describe, expect, it } from 'vitest';
4
5
 
5
- import { AiProviderModelListItem } from '@/types/aiModel';
6
-
7
6
  import { AiModelSelectItem, NewAiModelItem, aiModels, users } from '../../schemas';
8
7
  import { LobeChatDatabase } from '../../type';
9
8
  import { AiModelModel } from '../aiModel';
@@ -2,7 +2,7 @@
2
2
  import { eq } from 'drizzle-orm';
3
3
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
4
4
 
5
- import { LobeChatDatabase } from '../../type';import { AsyncTaskStatus } from '@/types/asyncTask';
5
+ import { AsyncTaskStatus } from '@/types/asyncTask';
6
6
  import { GenerationConfig } from '@/types/generation';
7
7
 
8
8
  import {
@@ -12,6 +12,7 @@ import {
12
12
  generations,
13
13
  users,
14
14
  } from '../../schemas';
15
+ import { LobeChatDatabase } from '../../type';
15
16
  import { GenerationBatchModel } from '../generationBatch';
16
17
  import { getTestDB } from './_util';
17
18
 
@@ -367,6 +368,51 @@ describe('GenerationBatchModel', () => {
367
368
  });
368
369
  });
369
370
 
371
+ it('should transform single config imageUrl through FileService', async () => {
372
+ const [createdBatch] = await serverDB
373
+ .insert(generationBatches)
374
+ .values({
375
+ ...testBatch,
376
+ userId,
377
+ config: { imageUrl: 'single-image.jpg', prompt: 'test prompt' },
378
+ })
379
+ .returning();
380
+
381
+ const results = await generationBatchModel.queryGenerationBatchesByTopicIdWithGenerations(
382
+ testTopic.id,
383
+ );
384
+
385
+ expect(results[0].config).toEqual({
386
+ imageUrl: 'https://example.com/single-image.jpg',
387
+ prompt: 'test prompt',
388
+ });
389
+ });
390
+
391
+ it('should transform both imageUrl and imageUrls when both are present', async () => {
392
+ const [createdBatch] = await serverDB
393
+ .insert(generationBatches)
394
+ .values({
395
+ ...testBatch,
396
+ userId,
397
+ config: {
398
+ imageUrl: 'single-image.jpg',
399
+ imageUrls: ['url1.jpg', 'url2.jpg'],
400
+ prompt: 'test prompt',
401
+ },
402
+ })
403
+ .returning();
404
+
405
+ const results = await generationBatchModel.queryGenerationBatchesByTopicIdWithGenerations(
406
+ testTopic.id,
407
+ );
408
+
409
+ expect(results[0].config).toEqual({
410
+ imageUrl: 'https://example.com/single-image.jpg',
411
+ imageUrls: ['https://example.com/url1.jpg', 'https://example.com/url2.jpg'],
412
+ prompt: 'test prompt',
413
+ });
414
+ });
415
+
370
416
  it('should handle config without imageUrls', async () => {
371
417
  const [createdBatch] = await serverDB
372
418
  .insert(generationBatches)
@@ -1,15 +1,14 @@
1
1
  import { and, asc, desc, eq, inArray } from 'drizzle-orm';
2
-
3
- import { LobeChatDatabase } from '../type';
4
2
  import {
5
3
  AiModelSortMap,
6
4
  AiModelSourceEnum,
7
5
  AiProviderModelListItem,
8
6
  EnabledAiModel,
9
7
  ToggleAiModelEnableParams,
10
- } from '@/types/aiModel';
8
+ } from 'model-bank';
11
9
 
12
10
  import { AiModelSelectItem, NewAiModelItem, aiModels } from '../schemas';
11
+ import { LobeChatDatabase } from '../type';
13
12
 
14
13
  export class AiModelModel {
15
14
  private userId: string;
@@ -1,7 +1,6 @@
1
1
  import debug from 'debug';
2
2
  import { and, eq } from 'drizzle-orm';
3
3
 
4
- import { LobeChatDatabase } from '../type';
5
4
  import { FileService } from '@/server/services/file';
6
5
  import { Generation, GenerationAsset, GenerationBatch, GenerationConfig } from '@/types/generation';
7
6
 
@@ -11,6 +10,7 @@ import {
11
10
  NewGenerationBatch,
12
11
  generationBatches,
13
12
  } from '../schemas/generation';
13
+ import { LobeChatDatabase } from '../type';
14
14
  import { GenerationModel } from './generation';
15
15
 
16
16
  const log = debug('lobe-image:generation-batch-model');
@@ -121,6 +121,13 @@ export class GenerationBatchModel {
121
121
  // Transform config
122
122
  (async () => {
123
123
  const config = batch.config as GenerationConfig;
124
+
125
+ // Handle single imageUrl
126
+ if (config.imageUrl) {
127
+ config.imageUrl = await this.fileService.getFullFileUrl(config.imageUrl);
128
+ }
129
+
130
+ // Handle imageUrls array
124
131
  if (Array.isArray(config.imageUrls)) {
125
132
  config.imageUrls = await Promise.all(
126
133
  config.imageUrls.map((url) => this.fileService.getFullFileUrl(url)),
@@ -1,8 +1,8 @@
1
+ import { AiProviderModelListItem, EnabledAiModel } from 'model-bank';
1
2
  import { beforeEach, describe, expect, it, vi } from 'vitest';
2
3
 
3
4
  import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
4
5
  import { clientDB, initializeDB } from '@/database/client/db';
5
- import { AiProviderModelListItem, EnabledAiModel } from '@/types/aiModel';
6
6
  import {
7
7
  AiProviderDetailItem,
8
8
  AiProviderListItem,
@@ -1,13 +1,13 @@
1
1
  import { isEmpty } from 'lodash-es';
2
- import pMap from 'p-map';
3
-
4
- import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
5
2
  import {
6
3
  AIChatModelCard,
7
4
  AiModelSourceEnum,
8
5
  AiProviderModelListItem,
9
6
  EnabledAiModel,
10
- } from '@/types/aiModel';
7
+ } from 'model-bank';
8
+ import pMap from 'p-map';
9
+
10
+ import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
11
11
  import {
12
12
  AiProviderDetailItem,
13
13
  AiProviderListItem,
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const ai21ChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const ai302ChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const ai360ChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const aihubmixModels: AIChatModelCard[] = [
4
4
  {
@@ -700,7 +700,7 @@ const aihubmixModels: AIChatModelCard[] = [
700
700
  },
701
701
  contextWindowTokens: 32_768 + 8192,
702
702
  description: 'Gemini 2.5 Flash 实验模型,支持图像生成',
703
- displayName: 'Gemini 2.5 Flash Image Preview',
703
+ displayName: 'Nano Banana',
704
704
  id: 'gemini-2.5-flash-image-preview',
705
705
  maxOutput: 8192,
706
706
  pricing: {
@@ -827,4 +827,4 @@ const aihubmixModels: AIChatModelCard[] = [
827
827
  },
828
828
  ];
829
829
 
830
- export default aihubmixModels;
830
+ export default aihubmixModels;
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const akashChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const anthropicChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard, AIImageModelCard } from '../types/aiModel';
2
2
 
3
3
  const azureChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const azureChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const baichuanChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const bedrockChatModels: AIChatModelCard[] = [
4
4
  /*
@@ -1,6 +1,5 @@
1
- import { PRESET_ASPECT_RATIOS } from '@/const/image';
2
- import { ModelParamsSchema } from '../standard-parameters';
3
- import { AIImageModelCard } from '@/types/aiModel';
1
+ import { ModelParamsSchema, PRESET_ASPECT_RATIOS } from '../standard-parameters';
2
+ import { AIImageModelCard } from '../types';
4
3
 
5
4
  // https://docs.bfl.ai/api-reference/tasks/edit-or-create-an-image-with-flux-kontext-pro
6
5
  // official support 21:9 ~ 9:21 (ratio 0.43 ~ 2.33)
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const cloudflareChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const cohereChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://api-docs.deepseek.com/zh-cn/quick_start/pricing
4
4
  const deepseekChatModels: AIChatModelCard[] = [
@@ -1,5 +1,5 @@
1
1
  import { ModelParamsSchema } from '../standard-parameters';
2
- import { AIImageModelCard } from '@/types/aiModel';
2
+ import { AIImageModelCard } from '../types/aiModel';
3
3
 
4
4
  export const fluxSchnellParamsSchema: ModelParamsSchema = {
5
5
  height: { default: 1024, max: 1536, min: 512, step: 1 },
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const fireworksaiChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard, AIImageModelCard } from '../types/aiModel';
2
2
 
3
3
  const giteeaiChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const githubChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,6 +1,5 @@
1
- import { CHAT_MODEL_IMAGE_GENERATION_PARAMS } from '@/const/image';
2
- import { ModelParamsSchema } from '../standard-parameters';
3
- import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
1
+ import { CHAT_MODEL_IMAGE_GENERATION_PARAMS, ModelParamsSchema } from '../standard-parameters';
2
+ import { AIChatModelCard, AIImageModelCard } from '../types';
4
3
 
5
4
  const googleChatModels: AIChatModelCard[] = [
6
5
  {
@@ -197,8 +196,8 @@ const googleChatModels: AIChatModelCard[] = [
197
196
  },
198
197
  contextWindowTokens: 32_768 + 8192,
199
198
  description:
200
- 'Gemini 2.5 Flash Image Preview 是 Google 最新、最快、最高效的原生多模态模型,它允许您通过对话生成和编辑图像。',
201
- displayName: 'Gemini 2.5 Flash Image Preview',
199
+ 'Nano Banana 是 Google 最新、最快、最高效的原生多模态模型,它允许您通过对话生成和编辑图像。',
200
+ displayName: 'Nano Banana',
202
201
  enabled: true,
203
202
  id: 'gemini-2.5-flash-image-preview',
204
203
  maxOutput: 8192,
@@ -611,12 +610,12 @@ const imagenBaseParameters: ModelParamsSchema = {
611
610
  /* eslint-disable sort-keys-fix/sort-keys-fix */
612
611
  const googleImageModels: AIImageModelCard[] = [
613
612
  {
614
- displayName: 'Gemini 2.5 Flash Image Preview',
613
+ displayName: 'Nano Banana',
615
614
  id: 'gemini-2.5-flash-image-preview:image',
616
615
  enabled: true,
617
616
  type: 'image',
618
617
  description:
619
- 'Gemini 2.5 Flash Image Preview 是 Google 最新、最快、最高效的原生多模态模型,它允许您通过对话生成和编辑图像。',
618
+ 'Nano Banana 是 Google 最新、最快、最高效的原生多模态模型,它允许您通过对话生成和编辑图像。',
620
619
  releasedAt: '2025-08-26',
621
620
  parameters: CHAT_MODEL_IMAGE_GENERATION_PARAMS,
622
621
  pricing: {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://groq.com/pricing/
4
4
  // https://console.groq.com/docs/models
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const higressChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const huggingfaceChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://cloud.tencent.com/document/product/1729/104753
4
4
  const hunyuanChatModels: AIChatModelCard[] = [
@@ -1,4 +1,4 @@
1
- import { AiFullModelCard, LobeDefaultAiModelListItem } from '@/types/aiModel';
1
+ import { AiFullModelCard, LobeDefaultAiModelListItem } from '../types/aiModel';
2
2
 
3
3
  import { default as ai21 } from './ai21';
4
4
  import { default as ai302 } from './ai302';
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://cloud.infini-ai.com/genstudio/model
4
4
  // All models are currently free
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://internlm.intern-ai.org.cn/api/document
4
4
 
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const jinaChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const lmStudioChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const lobehubChatModels: AIChatModelCard[] = [];
4
4
 
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard, AIImageModelCard } from '../types/aiModel';
2
2
 
3
3
  const minimaxChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://docs.mistral.ai/getting-started/models/models_overview/
4
4
  // https://mistral.ai/products/la-plateforme#pricing
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const modelscopeChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://platform.moonshot.cn/docs/pricing/chat
4
4
  const moonshotChatModels: AIChatModelCard[] = [