@lobehub/chat 1.119.1 → 1.119.2

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 (227) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/changelog/v1.json +5 -0
  3. package/package.json +5 -3
  4. package/packages/const/src/auth.ts +0 -36
  5. package/packages/const/src/index.ts +3 -1
  6. package/packages/database/src/models/__tests__/aiModel.test.ts +1 -2
  7. package/packages/database/src/models/aiModel.ts +2 -3
  8. package/packages/database/src/repositories/aiInfra/index.test.ts +1 -1
  9. package/packages/database/src/repositories/aiInfra/index.ts +4 -4
  10. package/packages/model-bank/src/aiModels/ai21.ts +1 -1
  11. package/packages/model-bank/src/aiModels/ai302.ts +1 -1
  12. package/packages/model-bank/src/aiModels/ai360.ts +1 -1
  13. package/packages/model-bank/src/aiModels/aihubmix.ts +2 -2
  14. package/packages/model-bank/src/aiModels/akashchat.ts +1 -1
  15. package/packages/model-bank/src/aiModels/anthropic.ts +1 -1
  16. package/packages/model-bank/src/aiModels/azure.ts +1 -1
  17. package/packages/model-bank/src/aiModels/azureai.ts +1 -1
  18. package/packages/model-bank/src/aiModels/baichuan.ts +1 -1
  19. package/packages/model-bank/src/aiModels/bedrock.ts +1 -1
  20. package/packages/model-bank/src/aiModels/bfl.ts +2 -3
  21. package/packages/model-bank/src/aiModels/cloudflare.ts +1 -1
  22. package/packages/model-bank/src/aiModels/cohere.ts +1 -1
  23. package/packages/model-bank/src/aiModels/deepseek.ts +1 -1
  24. package/packages/model-bank/src/aiModels/fal.ts +1 -1
  25. package/packages/model-bank/src/aiModels/fireworksai.ts +1 -1
  26. package/packages/model-bank/src/aiModels/giteeai.ts +1 -1
  27. package/packages/model-bank/src/aiModels/github.ts +1 -1
  28. package/packages/model-bank/src/aiModels/google.ts +2 -3
  29. package/packages/model-bank/src/aiModels/groq.ts +1 -1
  30. package/packages/model-bank/src/aiModels/higress.ts +1 -1
  31. package/packages/model-bank/src/aiModels/huggingface.ts +1 -1
  32. package/packages/model-bank/src/aiModels/hunyuan.ts +1 -1
  33. package/packages/model-bank/src/aiModels/index.ts +1 -1
  34. package/packages/model-bank/src/aiModels/infiniai.ts +1 -1
  35. package/packages/model-bank/src/aiModels/internlm.ts +1 -1
  36. package/packages/model-bank/src/aiModels/jina.ts +1 -1
  37. package/packages/model-bank/src/aiModels/lmstudio.ts +1 -1
  38. package/packages/model-bank/src/aiModels/lobehub.ts +1 -1
  39. package/packages/model-bank/src/aiModels/minimax.ts +1 -1
  40. package/packages/model-bank/src/aiModels/mistral.ts +1 -1
  41. package/packages/model-bank/src/aiModels/modelscope.ts +1 -1
  42. package/packages/model-bank/src/aiModels/moonshot.ts +1 -1
  43. package/packages/model-bank/src/aiModels/novita.ts +1 -1
  44. package/packages/model-bank/src/aiModels/nvidia.ts +1 -1
  45. package/packages/model-bank/src/aiModels/ollama.ts +1 -1
  46. package/packages/model-bank/src/aiModels/openai.ts +1 -1
  47. package/packages/model-bank/src/aiModels/openrouter.ts +1 -1
  48. package/packages/model-bank/src/aiModels/perplexity.ts +1 -1
  49. package/packages/model-bank/src/aiModels/ppio.ts +1 -1
  50. package/packages/model-bank/src/aiModels/qiniu.ts +1 -1
  51. package/packages/model-bank/src/aiModels/qwen.ts +1 -1
  52. package/packages/model-bank/src/aiModels/sambanova.ts +1 -1
  53. package/packages/model-bank/src/aiModels/search1api.ts +1 -1
  54. package/packages/model-bank/src/aiModels/sensenova.ts +1 -1
  55. package/packages/model-bank/src/aiModels/siliconcloud.ts +1 -1
  56. package/packages/model-bank/src/aiModels/spark.ts +1 -1
  57. package/packages/model-bank/src/aiModels/stepfun.ts +1 -1
  58. package/packages/model-bank/src/aiModels/taichu.ts +1 -1
  59. package/packages/model-bank/src/aiModels/tencentcloud.ts +1 -1
  60. package/packages/model-bank/src/aiModels/togetherai.ts +1 -1
  61. package/packages/model-bank/src/aiModels/upstage.ts +1 -1
  62. package/packages/model-bank/src/aiModels/v0.ts +1 -1
  63. package/packages/model-bank/src/aiModels/vertexai.ts +1 -1
  64. package/packages/model-bank/src/aiModels/vllm.ts +1 -1
  65. package/packages/model-bank/src/aiModels/volcengine.ts +1 -1
  66. package/packages/model-bank/src/aiModels/wenxin.ts +1 -1
  67. package/packages/model-bank/src/aiModels/xai.ts +1 -1
  68. package/packages/model-bank/src/aiModels/xinference.ts +1 -1
  69. package/packages/model-bank/src/aiModels/zeroone.ts +1 -1
  70. package/packages/model-bank/src/aiModels/zhipu.ts +1 -1
  71. package/packages/model-bank/src/index.ts +1 -0
  72. package/packages/model-bank/src/standard-parameters/index.ts +48 -0
  73. package/packages/{types/src → model-bank/src/types}/aiModel.ts +12 -1
  74. package/packages/model-bank/src/types/index.ts +1 -0
  75. package/packages/model-runtime/package.json +4 -1
  76. package/packages/model-runtime/src/BaseAI.ts +2 -2
  77. package/packages/model-runtime/src/ModelRuntime.test.ts +4 -4
  78. package/packages/model-runtime/src/RouterRuntime/createRuntime.ts +3 -7
  79. package/packages/model-runtime/src/ai302/index.ts +1 -1
  80. package/packages/model-runtime/src/aihubmix/index.ts +1 -2
  81. package/packages/model-runtime/src/anthropic/index.ts +1 -1
  82. package/packages/model-runtime/src/azureOpenai/index.ts +2 -3
  83. package/packages/model-runtime/src/azureai/index.ts +2 -3
  84. package/packages/model-runtime/src/bedrock/index.ts +1 -1
  85. package/packages/model-runtime/src/bfl/createImage.test.ts +4 -4
  86. package/packages/model-runtime/src/bfl/createImage.ts +2 -2
  87. package/packages/model-runtime/src/bfl/index.ts +1 -1
  88. package/packages/model-runtime/src/cloudflare/index.ts +1 -1
  89. package/packages/model-runtime/src/const/models.ts +64 -0
  90. package/packages/model-runtime/src/fal/index.test.ts +2 -3
  91. package/packages/model-runtime/src/fal/index.ts +1 -1
  92. package/packages/model-runtime/src/github/index.ts +1 -1
  93. package/packages/model-runtime/src/google/createImage.test.ts +1 -1
  94. package/packages/model-runtime/src/google/createImage.ts +1 -1
  95. package/packages/model-runtime/src/google/index.test.ts +1 -1
  96. package/packages/model-runtime/src/google/index.ts +4 -3
  97. package/packages/model-runtime/src/groq/index.ts +1 -1
  98. package/packages/model-runtime/src/helpers/parseToolCalls.ts +1 -2
  99. package/packages/model-runtime/src/huggingface/index.ts +1 -1
  100. package/packages/model-runtime/src/index.ts +3 -1
  101. package/packages/model-runtime/src/infiniai/index.ts +1 -1
  102. package/packages/model-runtime/src/ollama/index.test.ts +1 -1
  103. package/packages/model-runtime/src/ollama/index.ts +2 -3
  104. package/packages/model-runtime/src/openai/index.ts +16 -8
  105. package/packages/model-runtime/src/providerTestUtils.ts +1 -2
  106. package/packages/model-runtime/src/qiniu/index.test.ts +2 -3
  107. package/packages/model-runtime/src/siliconcloud/index.ts +1 -1
  108. package/packages/model-runtime/src/types/chat.ts +2 -22
  109. package/packages/model-runtime/src/{error.ts → types/error.ts} +29 -0
  110. package/packages/model-runtime/src/types/index.ts +4 -0
  111. package/packages/model-runtime/src/types/toolsCalling.ts +48 -0
  112. package/packages/model-runtime/src/types/type.ts +1 -1
  113. package/packages/model-runtime/src/types/usage.ts +27 -0
  114. package/packages/model-runtime/src/utils/anthropicHelpers.test.ts +2 -2
  115. package/packages/model-runtime/src/utils/anthropicHelpers.ts +1 -1
  116. package/packages/model-runtime/src/utils/createError.ts +1 -1
  117. package/packages/model-runtime/src/utils/errorResponse.test.ts +110 -0
  118. package/packages/model-runtime/src/utils/errorResponse.ts +64 -0
  119. package/packages/{utils/src → model-runtime/src/utils}/getFallbackModelProperty.ts +1 -1
  120. package/packages/model-runtime/src/utils/googleErrorParser.test.ts +1 -1
  121. package/packages/model-runtime/src/utils/googleErrorParser.ts +1 -1
  122. package/packages/model-runtime/src/utils/handleOpenAIError.ts +1 -1
  123. package/packages/model-runtime/src/utils/imageToBase64.test.ts +91 -0
  124. package/packages/model-runtime/src/utils/imageToBase64.ts +62 -0
  125. package/packages/model-runtime/src/utils/modelParse.test.ts +2 -2
  126. package/packages/model-runtime/src/utils/modelParse.ts +16 -10
  127. package/packages/model-runtime/src/utils/openaiCompatibleFactory/createImage.ts +1 -1
  128. package/packages/model-runtime/src/utils/openaiCompatibleFactory/index.ts +3 -3
  129. package/packages/model-runtime/src/utils/openaiHelpers.test.ts +2 -2
  130. package/packages/model-runtime/src/utils/openaiHelpers.ts +3 -4
  131. package/packages/model-runtime/src/utils/postProcessModelList.ts +2 -2
  132. package/packages/model-runtime/src/utils/safeParseJSON.test.ts +71 -0
  133. package/packages/model-runtime/src/utils/safeParseJSON.ts +12 -0
  134. package/packages/model-runtime/src/utils/streams/bedrock/claude.ts +1 -1
  135. package/packages/model-runtime/src/utils/streams/bedrock/llama.test.ts +1 -2
  136. package/packages/model-runtime/src/utils/streams/bedrock/llama.ts +1 -1
  137. package/packages/model-runtime/src/utils/streams/google-ai.test.ts +1 -1
  138. package/packages/model-runtime/src/utils/streams/google-ai.ts +1 -1
  139. package/packages/model-runtime/src/utils/streams/ollama.test.ts +1 -1
  140. package/packages/model-runtime/src/utils/streams/ollama.ts +2 -3
  141. package/packages/model-runtime/src/utils/streams/openai/openai.test.ts +1 -2
  142. package/packages/model-runtime/src/utils/streams/openai/openai.ts +1 -1
  143. package/packages/model-runtime/src/utils/streams/openai/responsesStream.ts +1 -1
  144. package/packages/model-runtime/src/utils/streams/protocol.ts +3 -3
  145. package/packages/model-runtime/src/utils/streams/vertex-ai.test.ts +1 -1
  146. package/packages/model-runtime/src/utils/streams/vertex-ai.ts +2 -2
  147. package/packages/model-runtime/src/utils/uuid.ts +7 -0
  148. package/packages/model-runtime/src/vertexai/index.ts +1 -1
  149. package/packages/types/src/agent/index.ts +2 -1
  150. package/packages/types/src/aiProvider.ts +10 -2
  151. package/packages/types/src/auth.ts +35 -0
  152. package/packages/types/src/discover/models.ts +1 -1
  153. package/packages/types/src/discover/providers.ts +1 -1
  154. package/packages/types/src/index.ts +4 -0
  155. package/packages/types/src/llm.ts +2 -47
  156. package/packages/types/src/session/agentSession.ts +3 -3
  157. package/packages/types/src/session/index.ts +2 -2
  158. package/packages/types/src/session/sessionGroup.ts +0 -2
  159. package/packages/types/src/user/settings/general.ts +1 -1
  160. package/packages/types/src/user/settings/modelProvider.ts +1 -1
  161. package/packages/utils/src/fetch/fetchSSE.ts +1 -1
  162. package/packages/utils/src/format.ts +2 -3
  163. package/packages/utils/src/index.ts +3 -1
  164. package/packages/utils/src/number.test.ts +1 -2
  165. package/packages/utils/src/number.ts +1 -2
  166. package/packages/utils/src/parseModels.test.ts +1 -2
  167. package/packages/utils/src/parseModels.ts +2 -3
  168. package/packages/utils/src/pricing.test.ts +1 -2
  169. package/packages/utils/src/pricing.ts +1 -1
  170. package/packages/utils/src/server/xor.ts +3 -1
  171. package/src/app/(backend)/middleware/auth/index.ts +1 -2
  172. package/src/app/(backend)/webapi/chat/vertexai/route.ts +1 -1
  173. package/src/app/(backend)/webapi/text-to-image/[provider]/route.ts +1 -2
  174. package/src/app/[variants]/(main)/discover/(list)/model/features/List/ModelTypeIcon.tsx +1 -2
  175. package/src/app/[variants]/(main)/image/@menu/components/SeedNumberInput/index.tsx +1 -1
  176. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/hooks/useAutoDimensions.ts +4 -3
  177. package/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/Form.tsx +1 -1
  178. package/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelItem.tsx +1 -1
  179. package/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/ListItem.tsx +1 -1
  180. package/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/index.tsx +1 -1
  181. package/src/components/ModelSelect/index.tsx +1 -1
  182. package/src/database/_deprecated/core/migrations/migrateSettingsToUser/type.ts +2 -5
  183. package/src/features/Conversation/Extras/Usage/UsageDetail/ModelCard.tsx +1 -1
  184. package/src/features/Conversation/Extras/Usage/UsageDetail/pricing.ts +3 -4
  185. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.test.ts +1 -1
  186. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.ts +3 -2
  187. package/src/libs/trpc/async/context.ts +2 -1
  188. package/src/libs/trpc/edge/context.ts +2 -6
  189. package/src/libs/trpc/lambda/context.ts +1 -1
  190. package/src/migrations/FromV5ToV6/types/v5.ts +2 -2
  191. package/src/migrations/FromV5ToV6/types/v6.ts +2 -1
  192. package/src/server/globalConfig/genServerAiProviderConfig.ts +3 -3
  193. package/src/server/modules/ModelRuntime/index.test.ts +1 -1
  194. package/src/server/modules/ModelRuntime/index.ts +1 -1
  195. package/src/server/routers/async/caller.ts +2 -1
  196. package/src/server/routers/async/image.ts +2 -2
  197. package/src/server/routers/lambda/aiModel.ts +1 -1
  198. package/src/server/services/chunk/index.ts +2 -1
  199. package/src/server/services/generation/index.ts +2 -2
  200. package/src/services/_auth.ts +2 -1
  201. package/src/services/aiModel/server.test.ts +1 -1
  202. package/src/services/aiModel/type.ts +1 -1
  203. package/src/services/chat.ts +1 -1
  204. package/src/services/upload.ts +3 -3
  205. package/src/store/agent/slices/chat/action.ts +1 -1
  206. package/src/store/aiInfra/slices/aiModel/action.ts +6 -6
  207. package/src/store/aiInfra/slices/aiModel/initialState.ts +1 -1
  208. package/src/store/aiInfra/slices/aiModel/selectors.test.ts +1 -1
  209. package/src/store/aiInfra/slices/aiModel/selectors.ts +2 -1
  210. package/src/store/aiInfra/slices/aiProvider/__tests__/action.test.ts +7 -7
  211. package/src/store/aiInfra/slices/aiProvider/action.ts +8 -8
  212. package/src/store/aiInfra/slices/aiProvider/initialState.ts +2 -1
  213. package/src/store/electron/actions/app.ts +1 -1
  214. package/src/store/image/slices/generationConfig/action.test.ts +1 -1
  215. package/src/store/image/slices/generationConfig/action.ts +1 -1
  216. package/src/store/image/slices/generationConfig/hooks.test.ts +1 -1
  217. package/src/store/image/slices/generationConfig/hooks.ts +6 -3
  218. package/src/store/image/slices/generationConfig/selectors.test.ts +1 -1
  219. package/src/store/user/slices/auth/action.ts +1 -1
  220. package/src/store/user/slices/auth/selectors.ts +3 -4
  221. package/src/store/user/slices/modelList/action.ts +8 -7
  222. package/src/store/user/slices/modelList/selectors/modelProvider.ts +8 -5
  223. package/src/store/user/slices/preference/selectors.ts +3 -2
  224. package/src/store/user/slices/settings/selectors/settings.ts +1 -2
  225. package/src/store/user/slices/sync/selectors.ts +1 -1
  226. package/packages/const/src/image.ts +0 -51
  227. /package/packages/{utils/src → model-runtime/src/utils}/getFallbackModelProperty.test.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.119.2](https://github.com/lobehub/lobe-chat/compare/v1.119.1...v1.119.2)
6
+
7
+ <sup>Released on **2025-08-30**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **model-runtime**: Refactor model-runtime dependencies and clean code.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Code refactoring
19
+
20
+ - **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))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 1.119.1](https://github.com/lobehub/lobe-chat/compare/v1.119.0...v1.119.1)
6
31
 
7
32
  <sup>Released on **2025-08-30**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,9 @@
1
1
  [
2
+ {
3
+ "children": {},
4
+ "date": "2025-08-30",
5
+ "version": "1.119.2"
6
+ },
2
7
  {
3
8
  "children": {
4
9
  "fixes": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.119.1",
3
+ "version": "1.119.2",
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",
@@ -328,7 +330,7 @@
328
330
  "crypto-js": "^4.2.0",
329
331
  "dbdocs": "^0.16.0",
330
332
  "dotenv": "^17.0.0",
331
- "dpdm-fast": "1.0.7",
333
+ "dpdm-fast": "^1.0.13",
332
334
  "drizzle-dbml-generator": "^0.10.0",
333
335
  "drizzle-kit": "^0.31.4",
334
336
  "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';
@@ -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,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
  {
@@ -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
  {
@@ -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[] = [
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://novita.ai/pricing
4
4
  const novitaChatModels: AIChatModelCard[] = [
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const nvidiaChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const ollamaChatModels: AIChatModelCard[] = [
4
4
  {
@@ -6,7 +6,7 @@ import {
6
6
  AIRealtimeModelCard,
7
7
  AISTTModelCard,
8
8
  AITTSModelCard,
9
- } from '@/types/aiModel';
9
+ } from '../types/aiModel';
10
10
 
11
11
  export const gptImage1ParamsSchema: ModelParamsSchema = {
12
12
  imageUrls: { default: [] },
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://openrouter.ai/docs/api-reference/list-available-models
4
4
  const openrouterChatModels: AIChatModelCard[] = [
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const perplexityChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const ppioChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://developer.qiniu.com/aitokenapi
4
4
 
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard, AIImageModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://help.aliyun.com/zh/model-studio/models?spm=a2c4g.11186623
4
4
 
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const sambanovaChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const search1apiChatModels: 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.sensenova.cn/pricing
4
4
  // https://www.sensecore.cn/help/docs/model-as-a-service/nova/release
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard, AIImageModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://siliconflow.cn/zh-cn/models
4
4
  const siliconcloudChatModels: AIChatModelCard[] = [
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const sparkChatModels: 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
  // https://platform.stepfun.com/docs/pricing/details
4
4
 
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://docs.wair.ac.cn/maas/jiage.html
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/1772/115969
4
4
  const tencentCloudChatModels: AIChatModelCard[] = [
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const togetheraiChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // https://console.upstage.ai/docs/capabilities/chat
4
4
 
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const v0ChatModels: AIChatModelCard[] = [
4
4
  {
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  // ref: https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models
4
4
  const vertexaiChatModels: AIChatModelCard[] = [
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const vllmChatModels: 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
  // modelInfo https://www.volcengine.com/docs/82379/1330310
4
4
  // pricing https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement
@@ -1,4 +1,4 @@
1
- import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
1
+ import { AIChatModelCard, AIImageModelCard } from '../types/aiModel';
2
2
 
3
3
  const wenxinChatModels: 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
  // https://docs.x.ai/docs/models
4
4
  const xaiChatModels: AIChatModelCard[] = [