mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-19 13:54:10 +00:00
Compare commits
465 Commits
style/sync
...
v1.4.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 3463b30309 | |||
| 79c5f86804 | |||
| f699021430 | |||
| c9eef7291b | |||
| 3b94540514 | |||
| 9f211e26be | |||
| 5e8780d311 | |||
| 6335be41c6 | |||
| 6e6ad3ecc1 | |||
| 441565269a | |||
| 968e1f244b | |||
| c7f8f3851c | |||
| 85ed192fae | |||
| b597c5ac6b | |||
| 7583631802 | |||
| 1f059590b8 | |||
| a5be879bbf | |||
| a4580e9f2e | |||
| e6dc16a1b4 | |||
| 357d6ee6b6 | |||
| e53bb5a06d | |||
| 7100d1c8b5 | |||
| 3a1ceba359 | |||
| 7a4bbc003c | |||
| b696a4088a | |||
| 9acce91559 | |||
| 7da3cdcfd3 | |||
| 6171b2a531 | |||
| c79d647ac2 | |||
| 36f94bd91e | |||
| 4ead315f7a | |||
| 4476a5ebde | |||
| f5fe60aeec | |||
| 4a241b9313 | |||
| d3bdb610d8 | |||
| dda6dcb058 | |||
| 1fa160fa1a | |||
| 7fa3b42546 | |||
| 3ce59ca40c | |||
| 0c09c84088 | |||
| 6c4c8f7dc1 | |||
| 4dbf79547d | |||
| b8e9f21f7c | |||
| 3f2d9be937 | |||
| 1230777860 | |||
| 35f24919e2 | |||
| ffbb39924b | |||
| ad306e37ab | |||
| cf9c145fbf | |||
| 7ee6f6a694 | |||
| ae5987ac9d | |||
| 73b88379e9 | |||
| 006c9c1a55 | |||
| 53fb29211d | |||
| 9304008f5e | |||
| c85143a0ea | |||
| d71108ae9a | |||
| 49f7f33313 | |||
| 6619c5de7e | |||
| 2d9635f853 | |||
| f0d037e15d | |||
| 378cf020e5 | |||
| e431d1a21a | |||
| a35143b66e | |||
| 4bd05fc2a7 | |||
| e7c1ba8f74 | |||
| 9ea871105e | |||
| a148c3b031 | |||
| 0854a1d0d2 | |||
| 8c1512df26 | |||
| f3b29f6930 | |||
| 3f5a4b456d | |||
| cc0b177317 | |||
| b7f4bf6e4a | |||
| f33325a7e1 | |||
| c1e7e194b8 | |||
| 6448570910 | |||
| bda40fa100 | |||
| eba81480b4 | |||
| bdadfeeccf | |||
| 90dc95cb61 | |||
| 457106b3d8 | |||
| b9299858be | |||
| a5c348db0e | |||
| 23f3efbd79 | |||
| 3042e35722 | |||
| 8e54ca0f59 | |||
| 8ae29afeb6 | |||
| 7585fc22ac | |||
| 61b6ac9c3f | |||
| 1a067b1306 | |||
| 62a1ef2a22 | |||
| 5160f232bb | |||
| f40292e55b | |||
| 01e965be0d | |||
| b5517c763e | |||
| 9cc059cbad | |||
| e03a24c7f5 | |||
| 1d891ac52b | |||
| 6ca63892c6 | |||
| 5d9bef4378 | |||
| 9ab200c602 | |||
| 2104c737aa | |||
| af14225d31 | |||
| fa78599548 | |||
| 89414c2971 | |||
| 15a681fc8e | |||
| 499550109b | |||
| a20d1aeca1 | |||
| df0af9933b | |||
| 93f1cffa86 | |||
| 6f53f35d6d | |||
| 4a3c21d01b | |||
| c52bce8db8 | |||
| 3f85ffbb28 | |||
| 13c4037c15 | |||
| df67dc0e80 | |||
| 2603505241 | |||
| d7b31d91b3 | |||
| 90db48e1e8 | |||
| 7fda93ae8e | |||
| a91d6b23a2 | |||
| e78a6862e5 | |||
| bede6b0094 | |||
| 37eb8fe534 | |||
| 596b9c8091 | |||
| 6e9341ae3b | |||
| 7f6e3b18fe | |||
| aa1d7b7f1c | |||
| 1764383ddd | |||
| b3e915e064 | |||
| 67e5eead26 | |||
| de4de71d03 | |||
| 39864df37d | |||
| ea06536349 | |||
| dde04b7735 | |||
| f40300cf1a | |||
| 53d91e6a13 | |||
| 4173015f1b | |||
| 9d005c6636 | |||
| 93d460a267 | |||
| bdacb45e7c | |||
| c8d45e482b | |||
| bf97f0e8a8 | |||
| c4352e503f | |||
| 5274d8f506 | |||
| c394628882 | |||
| d13d64c621 | |||
| 2b54caeda1 | |||
| cd9a143b3d | |||
| 9d48eb3c61 | |||
| 4229e4fd14 | |||
| bb86f6399a | |||
| 1fd7d76ae8 | |||
| 93e896b458 | |||
| 3a1e0cf12d | |||
| c88a4b6a62 | |||
| b02020d9a3 | |||
| e815c47492 | |||
| e1989a1e6d | |||
| fbc488e994 | |||
| 76aa46a5cd | |||
| bb33ba411a | |||
| 8e1a5536a8 | |||
| ec4f481175 | |||
| 8156b6cdcf | |||
| d5d76aaa34 | |||
| 8ab8ac7635 | |||
| 19fd4d57d7 | |||
| 093ac69d10 | |||
| 45f104b5ba | |||
| b88deed358 | |||
| 97bb377326 | |||
| 6e2d03bf04 | |||
| 96e1789b40 | |||
| 1ad516bdea | |||
| 4dcf81fad2 | |||
| 7e4ab83d3b | |||
| 492a9aa24c | |||
| 6c1f6db2a6 | |||
| b26afbff7f | |||
| 7789340ead | |||
| 6f5be5de27 | |||
| 9174b291e7 | |||
| 18241e7266 | |||
| 1f306143d5 | |||
| 920d60fe13 | |||
| 044bf2d0a5 | |||
| a9d678bf20 | |||
| d815109ed7 | |||
| fef62d625d | |||
| 5be43f09d1 | |||
| fb97be93d5 | |||
| 3c96d46753 | |||
| 4be5dd34e2 | |||
| a5c3d6fc08 | |||
| b6ffb848ae | |||
| 2f5f5c77ad | |||
| 30b00aa322 | |||
| dd42080b82 | |||
| ddf42f8ab3 | |||
| 428c9f0d76 | |||
| 468913d7d9 | |||
| b32f428027 | |||
| 41d96bef14 | |||
| 82c29f174b | |||
| 139295728a | |||
| 4e31314b0e | |||
| 7bb4fec7f6 | |||
| adebf0a921 | |||
| 8f4760f60c | |||
| 75cd63aa39 | |||
| 5676899181 | |||
| b5b025d453 | |||
| 39906a229a | |||
| 8164f3ce9d | |||
| 4593b0e6f7 | |||
| a7f2982258 | |||
| 1d2bc0ddce | |||
| fbdfde9625 | |||
| 3fc975b741 | |||
| b713453b7a | |||
| 1aa79dee2f | |||
| b37976c24e | |||
| 455c432a52 | |||
| af9af9f087 | |||
| 5c64849695 | |||
| 2ee834458e | |||
| ce198f4d72 | |||
| b103c3cd2a | |||
| 36ce76100e | |||
| a5ddd9adf0 | |||
| c8cc640726 | |||
| d4ee64b8a2 | |||
| 5eb43e80b8 | |||
| fade53ef83 | |||
| 0b460453e9 | |||
| 3019a0a4cd | |||
| f99c9ce90e | |||
| ee6cb65f7b | |||
| 4d3fe3814d | |||
| 22c9b9c56f | |||
| 6a51975844 | |||
| 3e41d9962c | |||
| e4c7536b8c | |||
| 3493129b74 | |||
| 0dfcf8dd3f | |||
| c84df58ce8 | |||
| 8df856ec39 | |||
| 920a70d422 | |||
| 4d4ad0e6ef | |||
| 1022ed5cc1 | |||
| 283ab9ee51 | |||
| e2019374c4 | |||
| d420de3b88 | |||
| 10b8f0ef90 | |||
| 729a9775e2 | |||
| 65e3b80250 | |||
| 87030fffd2 | |||
| 19cd0b9971 | |||
| 774c6c90fa | |||
| 56865fe3ab | |||
| 48da563963 | |||
| 622b3908dc | |||
| e903c1115f | |||
| c9fb2dee1d | |||
| 3fc4265022 | |||
| b4c575fdf1 | |||
| e1ae39b5c3 | |||
| 4049bc703e | |||
| 6650daf3c7 | |||
| bef8926532 | |||
| d1cdaa002b | |||
| db8f2c6137 | |||
| 0b9be471e9 | |||
| fe95f312c2 | |||
| cb70e4adea | |||
| 1c185b443e | |||
| 76351296a1 | |||
| 899cd520ea | |||
| 58f3ed103b | |||
| e76e284682 | |||
| 2f311dc4b6 | |||
| 25e6007c92 | |||
| 7ad3af2002 | |||
| d7d34d15ea | |||
| 0f2d30e64e | |||
| 12726c24e1 | |||
| 4712849938 | |||
| b9ecb417e1 | |||
| 1f70305edf | |||
| 69600dad09 | |||
| 9a19438c14 | |||
| 5bfc0dfbb2 | |||
| 634870a0ed | |||
| 73989e725d | |||
| ab4216e03d | |||
| ce85cc653a | |||
| 7fee545c7a | |||
| 4a23cad8ca | |||
| 81ea8865b1 | |||
| f7d4635ae2 | |||
| 5e1a4d6f3c | |||
| 2a3e94dda9 | |||
| b287b0aa87 | |||
| 047e55909c | |||
| c7fc8da939 | |||
| 6842e4642b | |||
| fa1409e851 | |||
| b735afa4a1 | |||
| 4ffe8b7fc7 | |||
| f0e796515d | |||
| 054a4049cf | |||
| 86777594f0 | |||
| a3f161e427 | |||
| acc0fdc9ef | |||
| df6dc6ced2 | |||
| cbebfbc314 | |||
| b173c70db0 | |||
| 5eb225a6af | |||
| eab2f37d06 | |||
| bca147e4e2 | |||
| 1a3f8f32d3 | |||
| 8026689990 | |||
| 3945387d3b | |||
| 56fe865350 | |||
| 0c62fb76da | |||
| 71a2f1512a | |||
| c733fcfcc2 | |||
| bf96b92787 | |||
| 086244caff | |||
| 3cad4701c0 | |||
| ddf1abffc8 | |||
| 5a1706b962 | |||
| 461bf3d672 | |||
| bc506190ad | |||
| 1823b0dd5c | |||
| cb266552a6 | |||
| 28db3d5b45 | |||
| 8340ad8509 | |||
| 35f623084d | |||
| 0186b4b403 | |||
| 224bd67782 | |||
| 5fc90a9baf | |||
| 6638c702d4 | |||
| d809d3f574 | |||
| 911c98c31d | |||
| a1fabf6299 | |||
| 5c4ffc797c | |||
| 84c69c9fd7 | |||
| 54cf16aa7a | |||
| efe28daa48 | |||
| aae108ec5d | |||
| 9c3f5a8b7c | |||
| 80b908dded | |||
| f5ce7c99bc | |||
| 02f3fc363b | |||
| 882ebbe940 | |||
| 9e0195dbc2 | |||
| 7263a331ce | |||
| ffbe641c45 | |||
| a08f802f0f | |||
| 556847278c | |||
| b94d4d926b | |||
| ade6269d1e | |||
| f6b4ca4f7d | |||
| d108280b70 | |||
| 90e742db14 | |||
| d61f69ad14 | |||
| 24489bc729 | |||
| 315c8728cb | |||
| f55747ffb7 | |||
| 1d7b557ecc | |||
| 39637fbdfb | |||
| 1484a042be | |||
| 8b1202a520 | |||
| 5f4523a5b3 | |||
| eadcefc7b4 | |||
| 488cde7718 | |||
| ae6a03f442 | |||
| f28711a32e | |||
| db1f888110 | |||
| 465dbfc3b1 | |||
| 5815d864d2 | |||
| 3c047efe0d | |||
| a9e2faf3ac | |||
| aa03833061 | |||
| 6dbcd70f23 | |||
| 8264d5d212 | |||
| 2aa50db019 | |||
| 18028f340d | |||
| a77f4fbaaf | |||
| 54524ab39e | |||
| 344f257cf5 | |||
| 6e9c69a8f6 | |||
| db81d9f704 | |||
| 91f72942e4 | |||
| b7913660bf | |||
| 760fe6736c | |||
| fc488ccf81 | |||
| 98715085cc | |||
| 4ba23ea04a | |||
| ba69a418e3 | |||
| 2b712d8bf3 | |||
| 7c493de58d | |||
| 2a252f904b | |||
| 24c81f29af | |||
| 7404f3bcea | |||
| 5e57399de6 | |||
| ebcd0831f5 | |||
| 3fdea6839f | |||
| ac6bcf2d78 | |||
| 9b8a4b1a79 | |||
| e5f5a147a9 | |||
| 0deb079aa8 | |||
| 156cf5fe96 | |||
| 30bbe611ba | |||
| 6695c4bc74 | |||
| 0e01db0662 | |||
| 023c21b305 | |||
| 862c0ae51a | |||
| ba1ba2ab2d | |||
| 538b7bca7e | |||
| 425bdcb0ef | |||
| d362d0aa43 | |||
| cb2a0849c2 | |||
| 2dd557d29c | |||
| 998a191a81 | |||
| c1f87d1031 | |||
| 5e78089954 | |||
| f37f42b355 | |||
| 380d8daf08 | |||
| 2630c86ebb | |||
| f853b4aa51 | |||
| 2aeaedce6f | |||
| bf1fe3dba2 | |||
| 97412b8b2d | |||
| 12c62a03ec | |||
| 04c1826816 | |||
| dfb892b86a | |||
| e7252da36b | |||
| 682305ff1c | |||
| e71e9dc9e0 | |||
| 1eb20c7a85 | |||
| d6074f792d | |||
| cf474bb150 | |||
| 00016c0584 | |||
| 8c70bdde2b | |||
| 091ce6b6fe | |||
| 44b29a9ac8 | |||
| 7488f53ed3 | |||
| 4f98e6c608 | |||
| aeb09f50b7 | |||
| ddd00d2d24 | |||
| 50938973d8 | |||
| dbda1074d8 | |||
| f8c36ffef5 | |||
| 8e6ec9a397 | |||
| 80a270db25 | |||
| 54496306ec | |||
| 9cf60b5072 | |||
| 9bbaa629d1 | |||
| d1fc51242b | |||
| 7a9a53d717 | |||
| bf8ef1f862 |
@@ -104,6 +104,14 @@ OPENAI_API_KEY=sk-xxxxxxxxx
|
||||
|
||||
# MINIMAX_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
### DeepSeek AI ####
|
||||
|
||||
# DEEPSEEK_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
### Qwen AI ####
|
||||
|
||||
# QWEN_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
########################################
|
||||
############ Market Service ############
|
||||
########################################
|
||||
@@ -121,3 +129,55 @@ OPENAI_API_KEY=sk-xxxxxxxxx
|
||||
# set the plugin settings
|
||||
# the format is `plugin-identifier:key1=value1;key2=value2`, multiple settings fields are separated by semicolons `;`, multiple plugin settings are separated by commas `,`.
|
||||
# PLUGIN_SETTINGS=search-engine:SERPAPI_API_KEY=xxxxx
|
||||
|
||||
|
||||
########################################
|
||||
##### S3 Object Storage Service ########
|
||||
########################################
|
||||
|
||||
# S3 keys
|
||||
#S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
||||
#S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
||||
|
||||
# Bucket name
|
||||
#S3_BUCKET=lobechat
|
||||
|
||||
# Bucket request endpoint
|
||||
#S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
||||
|
||||
# Public access domain for the bucket
|
||||
#NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
|
||||
|
||||
# Bucket region, such as us-west-1, generally not needed to add
|
||||
# but some service providers may require configuration
|
||||
# S3_REGION=us-west-1
|
||||
|
||||
|
||||
########################################
|
||||
############ Auth Service ##############
|
||||
########################################
|
||||
|
||||
|
||||
# Clerk related configurations
|
||||
|
||||
# Clerk public key and secret key
|
||||
#NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
|
||||
#CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
# you need to config the clerk webhook secret key if you want to use the clerk with database
|
||||
#CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
|
||||
########################################
|
||||
########## Server Database #############
|
||||
########################################
|
||||
|
||||
# Specify the service mode as server if you want to use the server database
|
||||
#NEXT_PUBLIC_SERVICE_MODE=server
|
||||
|
||||
# Postgres database URL
|
||||
#DATABASE_URL=postgres://username:password@host:port/database
|
||||
|
||||
# use `openssl rand -base64 32` to generate a key for the encryption of the database
|
||||
# we use this key to encrypt the user api key
|
||||
#KEY_VAULTS_SECRET=xxxxx/xxxxxxxxxxxxxx=
|
||||
|
||||
+1
-2
@@ -10,9 +10,8 @@ coverage
|
||||
|
||||
# test
|
||||
jest*
|
||||
_test_
|
||||
__test__
|
||||
*.test.ts
|
||||
*.test.tsx
|
||||
|
||||
# umi
|
||||
.umi
|
||||
|
||||
@@ -5,53 +5,64 @@ labels: ['🐛 Bug']
|
||||
body:
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: '💻 Operating System'
|
||||
label: '📦 Environment'
|
||||
multiple: true
|
||||
options:
|
||||
- Windows
|
||||
- macOS
|
||||
- Ubuntu
|
||||
- Other Linux
|
||||
- iOS
|
||||
- Android
|
||||
- Other
|
||||
- 'Official Preview'
|
||||
- 'Vercel'
|
||||
- 'Zeabur'
|
||||
- 'Sealos'
|
||||
- 'Netlify'
|
||||
- 'Docker'
|
||||
- 'Other'
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: '📌 Version'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: '📦 Environment'
|
||||
label: '💻 Operating System'
|
||||
multiple: true
|
||||
options:
|
||||
- Official Preview
|
||||
- Vercel / Zeabur / Sealos
|
||||
- Docker
|
||||
- Other
|
||||
- 'Windows'
|
||||
- 'macOS'
|
||||
- 'Ubuntu'
|
||||
- 'Other Linux'
|
||||
- 'iOS'
|
||||
- 'Android'
|
||||
- 'Other'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: '🌐 Browser'
|
||||
multiple: true
|
||||
options:
|
||||
- Chrome
|
||||
- Edge
|
||||
- Safari
|
||||
- Firefox
|
||||
- Other
|
||||
- 'Chrome'
|
||||
- 'Edge'
|
||||
- 'Safari'
|
||||
- 'Firefox'
|
||||
- 'Other'
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '🐛 Bug Description'
|
||||
description: A clear and concise description of the bug.
|
||||
description: A clear and concise description of the bug, if the above option is `Other`, please also explain in detail.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '🚦 Expected Behavior'
|
||||
description: A clear and concise description of what you expected to happen.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '📷 Recurrence Steps'
|
||||
description: A clear and concise description of how to recurrence.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '🚦 Expected Behavior'
|
||||
description: A clear and concise description of what you expected to happen.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '📝 Additional Information'
|
||||
|
||||
@@ -5,54 +5,64 @@ labels: ['🐛 Bug']
|
||||
body:
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: '💻 系统环境'
|
||||
label: '📦 部署环境'
|
||||
multiple: true
|
||||
options:
|
||||
- Windows
|
||||
- macOS
|
||||
- Ubuntu
|
||||
- Other Linux
|
||||
- iOS
|
||||
- Android
|
||||
- Other
|
||||
- 'Official Preview'
|
||||
- 'Vercel'
|
||||
- 'Zeabur'
|
||||
- 'Sealos'
|
||||
- 'Netlify'
|
||||
- 'Docker'
|
||||
- 'Other'
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: '📌 软件版本'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: '📦 部署环境'
|
||||
label: '💻 系统环境'
|
||||
multiple: true
|
||||
options:
|
||||
- Official Preview
|
||||
- Vercel / Zeabur / Sealos
|
||||
- Docker
|
||||
- Other
|
||||
- 'Windows'
|
||||
- 'macOS'
|
||||
- 'Ubuntu'
|
||||
- 'Other Linux'
|
||||
- 'iOS'
|
||||
- 'Android'
|
||||
- 'Other'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: '🌐 浏览器'
|
||||
multiple: true
|
||||
options:
|
||||
- Chrome
|
||||
- Edge
|
||||
- Safari
|
||||
- Firefox
|
||||
- Other
|
||||
- 'Chrome'
|
||||
- 'Edge'
|
||||
- 'Safari'
|
||||
- 'Firefox'
|
||||
- 'Other'
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '🐛 问题描述'
|
||||
description: 请提供一个清晰且简洁的问题描述。
|
||||
description: 请提供一个清晰且简洁的问题描述,若上述选项为`Other`,也请详细说明。
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '🚦 期望结果'
|
||||
description: 请提供一个清晰且简洁的描述,说明您期望发生什么。
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '📷 复现步骤'
|
||||
description: 请提供一个清晰且简洁的描述,说明如何复现问题。
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '🚦 期望结果'
|
||||
description: 请提供一个清晰且简洁的描述,说明您期望发生什么。
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '📝 补充信息'
|
||||
|
||||
@@ -8,6 +8,17 @@ jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
env:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
options: >-
|
||||
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
ports:
|
||||
- 5432:5432
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -22,8 +33,16 @@ jobs:
|
||||
- name: Lint
|
||||
run: bun run lint
|
||||
|
||||
- name: Test
|
||||
run: bun run test
|
||||
- name: Test Server Coverage
|
||||
run: bun run test-server:coverage
|
||||
env:
|
||||
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
|
||||
DATABASE_DRIVER: node
|
||||
NEXT_PUBLIC_SERVICE_MODE: server
|
||||
KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=
|
||||
|
||||
- name: Test App Coverage
|
||||
run: bun run test-app:coverage
|
||||
|
||||
- name: Release
|
||||
run: bun run release
|
||||
|
||||
@@ -7,7 +7,7 @@ permissions:
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 * * * *' # every hour
|
||||
- cron: '0 */6 * * *' # every 6 hours
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -1,9 +1,23 @@
|
||||
name: Test CI
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
env:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
options: >-
|
||||
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
|
||||
|
||||
ports:
|
||||
- 5432:5432
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -18,10 +32,27 @@ jobs:
|
||||
- name: Lint
|
||||
run: bun run lint
|
||||
|
||||
- name: Test and coverage
|
||||
run: bun run test:coverage
|
||||
- name: Test Server Coverage
|
||||
run: bun run test-server:coverage
|
||||
env:
|
||||
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
|
||||
DATABASE_DRIVER: node
|
||||
NEXT_PUBLIC_SERVICE_MODE: server
|
||||
KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
- name: Upload Server coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }} # required
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: ./coverage/server/lcov.info
|
||||
flags: server
|
||||
|
||||
- name: Test App Coverage
|
||||
run: bun run test-app:coverage
|
||||
|
||||
- name: Upload App Coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: ./coverage/app/lcov.info
|
||||
flags: app
|
||||
|
||||
@@ -60,3 +60,4 @@ sitemap*.xml
|
||||
robots.txt
|
||||
|
||||
*.patch
|
||||
*.pdf
|
||||
|
||||
@@ -14,3 +14,5 @@ public-hoist-pattern[]=*semantic-release*
|
||||
public-hoist-pattern[]=*stylelint*
|
||||
|
||||
public-hoist-pattern[]=@auth/core
|
||||
public-hoist-pattern[]=@clerk/backend
|
||||
public-hoist-pattern[]=@clerk/types
|
||||
|
||||
@@ -4,5 +4,6 @@ module.exports = {
|
||||
...config,
|
||||
rules: {
|
||||
'selector-id-pattern': null,
|
||||
...config.rules,
|
||||
},
|
||||
};
|
||||
|
||||
+3983
File diff suppressed because it is too large
Load Diff
+30
-1
@@ -19,13 +19,36 @@ RUN corepack enable
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json ./
|
||||
COPY .npmrc ./
|
||||
|
||||
# If you want to build docker in China
|
||||
# RUN npm config set registry https://registry.npmmirror.com/
|
||||
RUN pnpm i
|
||||
|
||||
COPY . .
|
||||
RUN pnpm run build:docker # run build standalone for docker version
|
||||
|
||||
ENV NEXT_PUBLIC_BASE_PATH ""
|
||||
|
||||
# Sentry
|
||||
ENV NEXT_PUBLIC_SENTRY_DSN ""
|
||||
ENV SENTRY_ORG ""
|
||||
ENV SENTRY_PROJECT ""
|
||||
|
||||
# Posthog
|
||||
ENV NEXT_PUBLIC_ANALYTICS_POSTHOG ""
|
||||
ENV NEXT_PUBLIC_POSTHOG_KEY ""
|
||||
ENV NEXT_PUBLIC_POSTHOG_HOST ""
|
||||
|
||||
# Umami
|
||||
ENV NEXT_PUBLIC_ANALYTICS_UMAMI ""
|
||||
ENV NEXT_PUBLIC_UMAMI_SCRIPT_URL ""
|
||||
ENV NEXT_PUBLIC_UMAMI_WEBSITE_ID ""
|
||||
|
||||
# Node
|
||||
ENV NODE_OPTIONS "--max-old-space-size=8192"
|
||||
|
||||
# run build standalone for docker version
|
||||
RUN npm run build:docker
|
||||
|
||||
## Production image, copy all the files and run next
|
||||
FROM base AS runner
|
||||
@@ -106,4 +129,10 @@ ENV TOGETHERAI_API_KEY ""
|
||||
# Minimax
|
||||
ENV MINIMAX_API_KEY ""
|
||||
|
||||
# DeepSeek
|
||||
ENV DEEPSEEK_API_KEY ""
|
||||
|
||||
# Qwen
|
||||
ENV QWEN_API_KEY ""
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
@@ -1,21 +1,38 @@
|
||||
MIT License
|
||||
Apache License Version 2.0
|
||||
|
||||
Copyright (c) 2023 - current LobeHub
|
||||
Copyright (c) 2024/06/17 - current LobeHub LLC. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
----------
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
From 1.0, LobeChat is licensed under the Apache License 2.0, with the following additional conditions:
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
1. The commercial usage of LobeChat:
|
||||
|
||||
a. LobeChat may be utilized commercially, including as a frontend and backend service without modifying the source code.
|
||||
|
||||
b. a commercial license must be obtained from the producer if you want to develop and distribute a derivative work based on LobeChat.
|
||||
|
||||
Please contact hello@lobehub.com by email to inquire about licensing matters.
|
||||
|
||||
|
||||
2. As a contributor, you should agree that:
|
||||
|
||||
a. The producer can adjust the open-source agreement to be more strict or relaxed as deemed necessary.
|
||||
|
||||
b. Your contributed code may be used for commercial purposes, including but not limited to its cloud edition.
|
||||
|
||||
Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache License 2.0. Detailed information about the Apache License 2.0 can be found at http://www.apache.org/licenses/LICENSE-2.0.
|
||||
|
||||
----------
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
@@ -8,7 +8,7 @@ An open-source, modern-design ChatGPT/LLMs UI/Framework.<br/>
|
||||
Supports speech-synthesis, multi-modal, and extensible ([function call][docs-functionc-call]) plugin system.<br/>
|
||||
One-click **FREE** deployment of your private OpenAI ChatGPT/Claude/Gemini/Groq/Ollama chat application.
|
||||
|
||||
**English** · [简体中文](./README.zh-CN.md) · [Changelog](./CHANGELOG.md) · [Documents][docs] · [Report Bug][github-issues-link] · [Request Feature][github-issues-link]
|
||||
**English** · [简体中文](./README.zh-CN.md) · [Official Site][official-site] · [Changelog](./CHANGELOG.md) · [Documents][docs] · [Blog][blog] · [Feedback][github-issues-link]
|
||||
|
||||
<!-- SHIELD GROUP -->
|
||||
|
||||
@@ -59,9 +59,11 @@ One-click **FREE** deployment of your private OpenAI ChatGPT/Claude/Gemini/Groq/
|
||||
- [`5` Text to Image Generation](#5-text-to-image-generation)
|
||||
- [`6` Plugin System (Function Calling)](#6-plugin-system-function-calling)
|
||||
- [`7` Agent Market (GPTs)](#7-agent-market-gpts)
|
||||
- [`8` Progressive Web App (PWA)](#8-progressive-web-app-pwa)
|
||||
- [`9` Mobile Device Adaptation](#9-mobile-device-adaptation)
|
||||
- [`10` Custom Themes](#10-custom-themes)
|
||||
- [`8` Support Local / Remote Database](#8-support-local--remote-database)
|
||||
- [`9` Support Multi-User Management](#9-support-multi-user-management)
|
||||
- [`10` Progressive Web App (PWA)](#10-progressive-web-app-pwa)
|
||||
- [`11` Mobile Device Adaptation](#11-mobile-device-adaptation)
|
||||
- [`12` Custom Themes](#12-custom-themes)
|
||||
- [`*` What's more](#-whats-more)
|
||||
- [⚡️ Performance](#️-performance)
|
||||
- [🛳 Self Hosting](#-self-hosting)
|
||||
@@ -130,6 +132,8 @@ We have implemented support for the following model service providers:
|
||||
- **ChatGLM**: Added the **ChatGLM** series models from Zhipuai (GLM-4/GLM-4-vision/GLM-3-turbo), providing users with another efficient conversation model choice. [Learn more](https://www.zhipuai.cn/)
|
||||
- **Moonshot AI (Dark Side of the Moon)**: Integrated with the Moonshot series models, an innovative AI startup from China, aiming to provide deeper conversation understanding. [Learn more](https://www.moonshot.cn/)
|
||||
- **Minimax**: Integrated the Minimax models, including the MoE model **abab6**, offers a broader range of choices. [Learn more](https://www.minimaxi.com/)
|
||||
- **DeepSeek**: Integrated with the DeepSeek series models, an innovative AI startup from China, The product has been designed to provide a model that balances performance with price. [Learn more](https://www.deepseek.com/)
|
||||
- **Qwen**: Integrated the Qwen series models, including the latest **qwen-turbo**, **qwen-plus** and **qwen-max**. [Lean more](https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction)
|
||||
|
||||
At the same time, we are also planning to support more model service providers, such as Replicate and Perplexity, to further enrich our service provider library. If you would like LobeChat to support your favorite service provider, feel free to join our [community discussion](https://github.com/lobehub/lobe-chat/discussions/1284).
|
||||
|
||||
@@ -222,14 +226,14 @@ In addition, these plugins are not limited to news aggregation, but can also ext
|
||||
|
||||
<!-- PLUGIN LIST -->
|
||||
|
||||
| Recent Submits | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Social Search](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-05-02**</sup> | The Social Search provides access to tweets, users, followers, images, media and more.<br/>`social` `twitter` `x` `search` |
|
||||
| [Search Google via Serper](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **Barry** on **2024-04-30**</sup> | Google search engine via Serper.dev free API (2500x🆓/month)<br/>`web` `search` |
|
||||
| [NFT Guru](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **swap** on **2024-04-03**</sup> | Discover current prices of NFTs across major platforms and keep track of the rapidly changing marketplace with real-time<br/>`crypto` `nft` |
|
||||
| [Calendar Assistant](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **cc** on **2024-03-13**</sup> | A plugin to manage your calendar events # will auto generate i18n in workflow<br/>`calendar` `schedule` `will-auto-generate-i-18-n-in-workflow` |
|
||||
| Recent Submits | Description |
|
||||
| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Savvy Trader AI](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **savvytrader** on **2024-06-27**</sup> | Realtime stock, crypto and other investment data.<br/>`stock` `analyze` |
|
||||
| [Social Search](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-06-02**</sup> | The Social Search provides access to tweets, users, followers, images, media and more.<br/>`social` `twitter` `x` `search` |
|
||||
| [Space](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **automateyournetwork** on **2024-05-12**</sup> | Space data including NASA.<br/>`space` `nasa` |
|
||||
| [Search1API](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **fatwang2** on **2024-05-06**</sup> | Search aggregation service, specifically designed for LLMs<br/>`web` `search` |
|
||||
|
||||
> 📊 Total plugins: [<kbd>**56**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
||||
> 📊 Total plugins: [<kbd>**52**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
||||
|
||||
<!-- PLUGIN LIST -->
|
||||
|
||||
@@ -261,14 +265,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
||||
|
||||
<!-- AGENT LIST -->
|
||||
|
||||
| Recent Submits | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [Sales Description Specialist](https://chat-preview.lobehub.com/market?agent=verkauf-kleinanzeigen)<br/><sup>By **[highseen](https://github.com/highseen)** on **2024-04-30**</sup> | Assists in the sale of used items through research, pricing, description, and title creation.<br/>`product-sales` `research` `description` |
|
||||
| [Jailbreak Assistant DAN](https://chat-preview.lobehub.com/market?agent=gpt-4-dan-assistant)<br/><sup>By **[MapleEve](https://github.com/MapleEve)** on **2024-04-26**</sup> | Bypass OpenAI review mechanism, ChatGPT after jailbreak<br/>`creative` `artificial-intelligence` `conversation` `jailbreak` |
|
||||
| [TailwindHelper](https://chat-preview.lobehub.com/market?agent=tailwind-helper)<br/><sup>By **[aototo](https://github.com/aototo)** on **2024-04-26**</sup> | TailwindHelper is a professional frontend designer with a solid foundation in design theory and rich practical experience. Created by a leading software development company, it aims to help developers and designers accelerate the development process of web interfaces. TailwindHelper is proficient in the Tailwind CSS framework and can translate complex design requirements into efficient and responsive CSS class names.<br/>`tailwindcss` `css` `tailwind-helper` |
|
||||
| [yapi JSON-SCHEMA to Typescript](https://chat-preview.lobehub.com/market?agent=yapi-ts-helper)<br/><sup>By **[zcf0508](https://github.com/zcf0508)** on **2024-04-26**</sup> | Specializes in converting JSON schema to TypeScript types.<br/>`typescript` `development` |
|
||||
| Recent Submits | Description |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Ducky Programming Assistant](https://chat-preview.lobehub.com/market?agent=rubber-duck-programming)<br/><sup>By **[JiyuShao](https://github.com/JiyuShao)** on **2024-07-10**</sup> | Ducky Programming Assistant<br/>`programming` |
|
||||
| [AOSP Source Code Expert](https://chat-preview.lobehub.com/market?agent=aosp-development)<br/><sup>By **[viruscoding](https://github.com/viruscoding)** on **2024-06-24**</sup> | An expert in AOSP (Android Open Source Project) for Android, with a deep understanding and analytical ability of the latest AOSP source code.<br/>`aosp` |
|
||||
| [Fastapi Project Development Assistant](https://chat-preview.lobehub.com/market?agent=fastapi-development)<br/><sup>By **[xwxw098](https://github.com/xwxw098)** on **2024-06-19**</sup> | Proficient in Python modular development, skilled in using FastAPI, PostgreSQL, Tortoise-ORM, and other technologies, able to provide clear code structure and detailed comments for large projects.<br/>`fast-api` `python` `modular-development` |
|
||||
| [IT Systems Architect](https://chat-preview.lobehub.com/market?agent=it-system-architect)<br/><sup>By **[a562314](https://github.com/a562314)** on **2024-06-19**</sup> | Senior IT architect specializing in requirements analysis, system design, technology selection, and cross-platform system optimization. With over 5 years of experience, proficient in Windows, macOS, and Linux operating systems, skilled in troubleshooting, and security protection.<br/>`it-architecture-design` `problem-solving` `agile-development` `system-optimization` `cross-platform-skills` `teamwork` |
|
||||
|
||||
> 📊 Total agents: [<kbd>**244**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
||||
> 📊 Total agents: [<kbd>**294**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
||||
|
||||
<!-- AGENT LIST -->
|
||||
|
||||
@@ -278,9 +282,44 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
||||
|
||||
</div>
|
||||
|
||||
[![][image-feat-database]][docs-feat-database]
|
||||
|
||||
### `8` [Support Local / Remote Database][docs-feat-database]
|
||||
|
||||
LobeChat supports the use of both server-side and local databases. Depending on your needs, you can choose the appropriate deployment solution:
|
||||
|
||||
- **Local database**: suitable for users who want more control over their data and privacy protection. LobeChat uses CRDT (Conflict-Free Replicated Data Type) technology to achieve multi-device synchronization. This is an experimental feature aimed at providing a seamless data synchronization experience.
|
||||
- **Server-side database**: suitable for users who want a more convenient user experience. LobeChat supports PostgreSQL as a server-side database. For detailed documentation on how to configure the server-side database, please visit [Configure Server-side Database](https://lobehub.com/docs/self-hosting/advanced/server-database).
|
||||
|
||||
Regardless of which database you choose, LobeChat can provide you with an excellent user experience.
|
||||
|
||||
<div align="right">
|
||||
|
||||
[![][back-to-top]](#readme-top)
|
||||
|
||||
</div>
|
||||
|
||||
[![][image-feat-auth]][docs-feat-auth]
|
||||
|
||||
### `9` [Support Multi-User Management][docs-feat-auth]
|
||||
|
||||
LobeChat supports multi-user management and provides two main user authentication and management solutions to meet different needs:
|
||||
|
||||
- **next-auth**: LobeChat integrates `next-auth`, a flexible and powerful identity verification library that supports multiple authentication methods, including OAuth, email login, credential login, etc. With `next-auth`, you can easily implement user registration, login, session management, social login, and other functions to ensure the security and privacy of user data.
|
||||
|
||||
- **Clerk**: For users who need more advanced user management features, LobeChat also supports `Clerk`, a modern user management platform. `Clerk` provides richer functions, such as multi-factor authentication (MFA), user profile management, login activity monitoring, etc. With `Clerk`, you can get higher security and flexibility, and easily cope with complex user management needs.
|
||||
|
||||
Regardless of which user management solution you choose, LobeChat can provide you with an excellent user experience and powerful functional support.
|
||||
|
||||
<div align="right">
|
||||
|
||||
[![][back-to-top]](#readme-top)
|
||||
|
||||
</div>
|
||||
|
||||
[![][image-feat-pwa]][docs-feat-pwa]
|
||||
|
||||
### `8` [Progressive Web App (PWA)][docs-feat-pwa]
|
||||
### `10` [Progressive Web App (PWA)][docs-feat-pwa]
|
||||
|
||||
We deeply understand the importance of providing a seamless experience for users in today's multi-device environment.
|
||||
Therefore, we have adopted Progressive Web Application ([PWA](https://support.google.com/chrome/answer/9658361)) technology,
|
||||
@@ -307,7 +346,7 @@ providing smooth animations, responsive layouts, and adapting to different devic
|
||||
|
||||
[![][image-feat-mobile]][docs-feat-mobile]
|
||||
|
||||
### `9` [Mobile Device Adaptation][docs-feat-mobile]
|
||||
### `11` [Mobile Device Adaptation][docs-feat-mobile]
|
||||
|
||||
We have carried out a series of optimization designs for mobile devices to enhance the user's mobile experience. Currently, we are iterating on the mobile user experience to achieve smoother and more intuitive interactions. If you have any suggestions or ideas, we welcome you to provide feedback through GitHub Issues or Pull Requests.
|
||||
|
||||
@@ -319,7 +358,7 @@ We have carried out a series of optimization designs for mobile devices to enhan
|
||||
|
||||
[![][image-feat-theme]][docs-feat-theme]
|
||||
|
||||
### `10` [Custom Themes][docs-feat-theme]
|
||||
### `12` [Custom Themes][docs-feat-theme]
|
||||
|
||||
As a design-engineering-oriented application, LobeChat places great emphasis on users' personalized experiences,
|
||||
hence introducing flexible and diverse theme modes, including a light mode for daytime and a dark mode for nighttime.
|
||||
@@ -627,11 +666,12 @@ Every bit counts and your one-time donation sparkles in our galaxy of support! Y
|
||||
</details>
|
||||
|
||||
Copyright © 2024 [LobeHub][profile-link]. <br />
|
||||
This project is [MIT](./LICENSE) licensed.
|
||||
This project is [Apache 2.0](./LICENSE) licensed.
|
||||
|
||||
<!-- LINK GROUP -->
|
||||
|
||||
[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square
|
||||
[blog]: https://lobehub.com/blog
|
||||
[chat-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/desktop/pagespeed.svg
|
||||
[chat-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/desktop/chat_preview_lobehub_com_chat.html
|
||||
[chat-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/mobile/pagespeed.svg
|
||||
@@ -658,11 +698,13 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[docker-release-shield]: https://img.shields.io/docker/v/lobehub/lobe-chat?color=369eff&label=docker&labelColor=black&logo=docker&logoColor=white&style=flat-square
|
||||
[docker-size-link]: https://hub.docker.com/r/lobehub/lobe-chat
|
||||
[docker-size-shield]: https://img.shields.io/docker/image-size/lobehub/lobe-chat?color=369eff&labelColor=black&style=flat-square
|
||||
[docs]: https://lobehub.com/docs
|
||||
[docs]: https://lobehub.com/docs/usage/start
|
||||
[docs-dev-guide]: https://github.com/lobehub/lobe-chat/wiki/index
|
||||
[docs-docker]: https://lobehub.com/docs/self-hosting/platform/docker
|
||||
[docs-env-var]: https://lobehub.com/docs/self-hosting/environment-variables
|
||||
[docs-feat-agent]: https://lobehub.com/docs/usage/features/agent-market
|
||||
[docs-feat-auth]: https://lobehub.com/docs/usage/features/auth
|
||||
[docs-feat-database]: https://lobehub.com/docs/usage/features/database
|
||||
[docs-feat-local]: https://lobehub.com/docs/usage/features/local-llm
|
||||
[docs-feat-mobile]: https://lobehub.com/docs/usage/features/mobile
|
||||
[docs-feat-plugin]: https://lobehub.com/docs/usage/features/plugin-system
|
||||
@@ -672,7 +714,7 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[docs-feat-theme]: https://lobehub.com/docs/usage/features/theme
|
||||
[docs-feat-tts]: https://lobehub.com/docs/usage/features/tts
|
||||
[docs-feat-vision]: https://lobehub.com/docs/usage/features/vision
|
||||
[docs-functionc-call]: https://platform.openai.com/docs/guides/function-calling
|
||||
[docs-functionc-call]: https://lobehub.com/blog/openai-function-call
|
||||
[docs-lighthouse]: https://github.com/lobehub/lobe-chat/wiki/Lighthouse
|
||||
[docs-plugin-dev]: https://lobehub.com/docs/usage/plugins/development
|
||||
[docs-self-hosting]: https://lobehub.com/docs/self-hosting/start
|
||||
@@ -692,7 +734,7 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[github-issues-link]: https://github.com/lobehub/lobe-chat/issues
|
||||
[github-issues-shield]: https://img.shields.io/github/issues/lobehub/lobe-chat?color=ff80eb&labelColor=black&style=flat-square
|
||||
[github-license-link]: https://github.com/lobehub/lobe-chat/blob/main/LICENSE
|
||||
[github-license-shield]: https://img.shields.io/github/license/lobehub/lobe-chat?color=white&labelColor=black&style=flat-square
|
||||
[github-license-shield]: https://img.shields.io/badge/license-apache%202.0-white?labelColor=black&style=flat-square
|
||||
[github-project-link]: https://github.com/lobehub/lobe-chat/projects
|
||||
[github-release-link]: https://github.com/lobehub/lobe-chat/releases
|
||||
[github-release-shield]: https://img.shields.io/github/v/release/lobehub/lobe-chat?color=369eff&labelColor=black&logo=github&style=flat-square
|
||||
@@ -704,6 +746,8 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[github-trending-url]: https://trendshift.io/repositories/2256
|
||||
[image-banner]: https://github.com/lobehub/lobe-chat/assets/28616219/9f155dff-4737-429f-9cad-a70a1a860c5f
|
||||
[image-feat-agent]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670869-f1ffbf66-42b6-42cf-a937-9ce1f8328514.png
|
||||
[image-feat-auth]: https://github.com/lobehub/lobe-chat/assets/17870709/8ce70e15-40df-451e-b700-66090fe5b8c2
|
||||
[image-feat-database]: https://github.com/lobehub/lobe-chat/assets/17870709/c27a0234-a4e9-40e5-8bcb-42d5ce7e40f9
|
||||
[image-feat-local]: https://github.com/lobehub/lobe-chat/assets/28616219/ca9a21bc-ea6c-4c90-bf4a-fa53b4fb2b5c
|
||||
[image-feat-mobile]: https://gw.alipayobjects.com/zos/kitchen/R441AuFS4W/mobile.webp
|
||||
[image-feat-plugin]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670883-33c43a5c-a512-467e-855c-fa299548cce5.png
|
||||
@@ -713,7 +757,7 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[image-feat-theme]: https://gw.alipayobjects.com/zos/kitchen/pvus1lo%26Z7/darkmode.webp
|
||||
[image-feat-tts]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072124-c9853d8d-f1b5-44a8-a305-45ebc0f6d19a.png
|
||||
[image-feat-vision]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072129-382bdf30-e3d6-4411-b5a0-249710b8ba08.png
|
||||
[image-overview]: https://github.com/lobehub/lobe-chat/assets/28616219/8b04c3c9-3d71-4fb4-bd9b-a4f415c5876d
|
||||
[image-overview]: https://github.com/lobehub/lobe-chat/assets/17870709/56b95d48-f573-41cd-8b38-387bf88bc4bf
|
||||
[image-star]: https://github.com/lobehub/lobe-chat/assets/17870709/cb06b748-513f-47c2-8740-d876858d7855
|
||||
[issues-link]: https://img.shields.io/github/issues/lobehub/lobe-chat.svg?style=flat
|
||||
[lobe-chat-plugins]: https://github.com/lobehub/lobe-chat-plugins
|
||||
@@ -733,6 +777,7 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[lobe-ui-github]: https://github.com/lobehub/lobe-ui
|
||||
[lobe-ui-link]: https://www.npmjs.com/package/@lobehub/ui
|
||||
[lobe-ui-shield]: https://img.shields.io/npm/v/@lobehub/ui?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square
|
||||
[official-site]: https://lobehub.com
|
||||
[pr-welcome-link]: https://github.com/lobehub/lobe-chat/pulls
|
||||
[pr-welcome-shield]: https://img.shields.io/badge/🤯_pr_welcome-%E2%86%92-ffcb47?labelColor=black&style=for-the-badge
|
||||
[profile-link]: https://github.com/lobehub
|
||||
@@ -757,5 +802,5 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[submit-plugin-link]: https://github.com/lobehub/lobe-chat-plugins
|
||||
[submit-plugin-shield]: https://img.shields.io/badge/🧩/🏪_submit_plugin-%E2%86%92-95f3d9?labelColor=black&style=for-the-badge
|
||||
[vercel-link]: https://chat-preview.lobehub.com
|
||||
[vercel-shield]: https://img.shields.io/website?down_message=offline&label=vercel&labelColor=black&logo=vercel&style=flat-square&up_message=online&url=https%3A%2F%2Fchat-preview.lobehub.com
|
||||
[vercel-shield-badge]: https://img.shields.io/website?down_message=offline&label=try%20lobechat&labelColor=black&logo=vercel&style=for-the-badge&up_message=online&url=https%3A%2F%2Fchat-preview.lobehub.com
|
||||
[vercel-shield]: https://img.shields.io/badge/vercel-online-55b467?labelColor=black&logo=vercel&style=flat-square
|
||||
[vercel-shield-badge]: https://img.shields.io/badge/TRY%20LOBECHAT-ONLINE-55b467?labelColor=black&logo=vercel&style=for-the-badge
|
||||
|
||||
+79
-31
@@ -8,7 +8,7 @@
|
||||
支持语音合成、多模态、可扩展的([function call][docs-functionc-call])插件系统<br/>
|
||||
一键**免费**拥有你自己的 ChatGPT/Gemini/Claude/Ollama 应用
|
||||
|
||||
[English](./README.md) · **简体中文** · [更新日志](./CHANGELOG.md) · [文档][github-document-link] · [报告问题][github-issues-link] · [请求功能][github-issues-link]
|
||||
[English](./README.md) · **简体中文** · [官网][official-site] · [更新日志](./CHANGELOG.md) · [文档][docs] · [博客][blog] · [反馈问题][github-issues-link]
|
||||
|
||||
<!-- SHIELD GROUP -->
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<sup>探索私人生产力的未来。在个体崛起的时代中为你打造.</sup>
|
||||
|
||||
[![][github-trending-shield]][github-trending-url]
|
||||
[![][github-hello-shield]][github-hello-url]
|
||||
|
||||
[![][image-overview]][vercel-link]
|
||||
|
||||
@@ -58,9 +59,11 @@
|
||||
- [`5` Text to Image 文生图](#5-text-to-image-文生图)
|
||||
- [`6` 插件系统 (Function Calling)](#6-插件系统-function-calling)
|
||||
- [`7` 助手市场 (GPTs)](#7-助手市场-gpts)
|
||||
- [`8` 渐进式 Web 应用 (PWA)](#8-渐进式-web-应用-pwa)
|
||||
- [`9` 移动设备适配](#9-移动设备适配)
|
||||
- [`10` 自定义主题](#10-自定义主题)
|
||||
- [`8` 支持本地 / 远程数据库](#8-支持本地--远程数据库)
|
||||
- [`9` 支持多用户管理](#9-支持多用户管理)
|
||||
- [`10` 渐进式 Web 应用 (PWA)](#10-渐进式-web-应用-pwa)
|
||||
- [`11` 移动设备适配](#11-移动设备适配)
|
||||
- [`12` 自定义主题](#12-自定义主题)
|
||||
- [更多特性](#更多特性)
|
||||
- [⚡️ 性能测试](#️-性能测试)
|
||||
- [🛳 开箱即用](#-开箱即用)
|
||||
@@ -129,6 +132,8 @@
|
||||
- **Groq**:接入了 Groq 的 AI 模型,高效处理消息序列,生成回应,胜任多轮对话及单次交互任务。[了解更多](https://groq.com/)
|
||||
- **OpenRouter**:其支持包括 **Claude 3**,**Gemma**,**Mistral**,**Llama2**和**Cohere**等模型路由,支持智能路由优化,提升使用效率,开放且灵活。[了解更多](https://openrouter.ai/)
|
||||
- **Minimax**: 接入了 Minimax 的 AI 模型,包括 MoE 模型 **abab6**,提供了更多的选择空间。[了解更多](https://www.minimaxi.com/)
|
||||
- **DeepSeek**: 接入了 DeepSeek 的 AI 模型,包括最新的 **DeepSeek-V2**,提供兼顾性能与价格的模型。[了解更多](https://www.deepseek.com/)
|
||||
- **Qwen**: 接入了 Qwen 的 AI 模型,包括最新的 **qwen-turbo**,**qwen-plus** 和 **qwen-max** 等模型。[了解更多](https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction)
|
||||
|
||||
同时,我们也在计划支持更多的模型服务商,如 Replicate 和 Perplexity 等,以进一步丰富我们的服务商库。如果你希望让 LobeChat 支持你喜爱的服务商,欢迎加入我们的[社区讨论](https://github.com/lobehub/lobe-chat/discussions/1284)。
|
||||
|
||||
@@ -214,14 +219,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
||||
|
||||
<!-- PLUGIN LIST -->
|
||||
|
||||
| 最近新增 | 插件描述 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- |
|
||||
| [社交搜索](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-05-02**</sup> | 社交搜索提供访问推文、用户、关注者、图片、媒体等功能。<br/>`社交` `推特` `x` `搜索` |
|
||||
| [通过 Serper 搜索 Google](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **Barry** on **2024-04-30**</sup> | 通过 Serper.dev 免费 API 进行 Google 搜索引擎(每月 2500 次🆓)<br/>`网络` `搜索` |
|
||||
| [NFT Guru](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **swap** on **2024-04-03**</sup> | 发现主要平台上 NFT 的当前价格,并通过实时跟踪快速变化的市场了解情况<br/>`加密货币` `nft` |
|
||||
| [日历助手](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **cc** on **2024-03-13**</sup> | 一个用于管理日历事件的插件 # 将自动生成工作流程中的 i18n<br/>`日历` `日程安排` `将自动生成工作流程中的-i-18-n` |
|
||||
| 最近新增 | 插件描述 |
|
||||
| ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
||||
| [Savvy Trader AI](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **savvytrader** on **2024-06-27**</sup> | 实时股票、加密货币和其他投资数据。<br/>`股票` `分析` |
|
||||
| [社交搜索](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-06-02**</sup> | 社交搜索提供访问推文、用户、关注者、图片、媒体等功能。<br/>`社交` `推特` `x` `搜索` |
|
||||
| [空间](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **automateyournetwork** on **2024-05-12**</sup> | 包括 NASA 的空间数据。<br/>`空间` `nasa` |
|
||||
| [Search1API](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **fatwang2** on **2024-05-06**</sup> | 搜索聚合服务,专为 LLMs 设计<br/>`web` `search` |
|
||||
|
||||
> 📊 Total plugins: [<kbd>**56**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
||||
> 📊 Total plugins: [<kbd>**52**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
||||
|
||||
<!-- PLUGIN LIST -->
|
||||
|
||||
@@ -249,14 +254,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
||||
|
||||
<!-- AGENT LIST -->
|
||||
|
||||
| 最近新增 | 助手说明 |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [销售描述专家](https://chat-preview.lobehub.com/market?agent=verkauf-kleinanzeigen)<br/><sup>By **[highseen](https://github.com/highseen)** on **2024-04-30**</sup> | 通过研究、定价、描述和标题设计帮助销售二手物品。<br/>`产品销售` `研究` `描述` |
|
||||
| [越狱助手 DAN](https://chat-preview.lobehub.com/market?agent=gpt-4-dan-assistant)<br/><sup>By **[MapleEve](https://github.com/MapleEve)** on **2024-04-26**</sup> | 突破 OpenAI 审核机制,越狱之后的 ChatGPT<br/>`创意` `人工智能` `对话` `越狱` |
|
||||
| [TailwindHelper](https://chat-preview.lobehub.com/market?agent=tailwind-helper)<br/><sup>By **[aototo](https://github.com/aototo)** on **2024-04-26**</sup> | TailwindHelper 是一位专业的前端设计师,拥有深厚的设计理论基础和丰富的实践经验。它由一家领先的软件开发公司创建,旨在帮助开发者和设计师加速 Web 界面的开发过程。TailwindHelper 精通 Tailwind CSS 框架,并能够理解复杂的设计要求,转化为高效且响应式的 CSS 类名。<br/>`tailwindcss` `css` `tailwind-helper` |
|
||||
| [yapi JSON-SCHEMA to Typescript](https://chat-preview.lobehub.com/market?agent=yapi-ts-helper)<br/><sup>By **[zcf0508](https://github.com/zcf0508)** on **2024-04-26**</sup> | 擅长将 JSON schema 转换为 TypeScript 类型。<br/>`typescript` `开发` |
|
||||
| 最近新增 | 助手说明 |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [小黄鸭编程助手](https://chat-preview.lobehub.com/market?agent=rubber-duck-programming)<br/><sup>By **[JiyuShao](https://github.com/JiyuShao)** on **2024-07-10**</sup> | 小黄鸭编程助手<br/>`programming` |
|
||||
| [AOSP 源码专家](https://chat-preview.lobehub.com/market?agent=aosp-development)<br/><sup>By **[viruscoding](https://github.com/viruscoding)** on **2024-06-24**</sup> | 一位精通 AOSP(Android Open Source Project)安卓的专家,对最新 AOSP 源代码有着深入的理解和分析能力。<br/>`aosp` |
|
||||
| [Fastapi 项目开发助手](https://chat-preview.lobehub.com/market?agent=fastapi-development)<br/><sup>By **[xwxw098](https://github.com/xwxw098)** on **2024-06-19**</sup> | 擅长 Python 模块化开发,熟练运用 FastAPI、PostgreSQL、Tortoise-ORM 等技术栈,能为大型项目提供清晰的代码结构并添加详细注释。<br/>`fast-api` `python` `模块化开发` |
|
||||
| [IT 系统架构师](https://chat-preview.lobehub.com/market?agent=it-system-architect)<br/><sup>By **[a562314](https://github.com/a562314)** on **2024-06-19**</sup> | 资深 IT 架构师,擅长需求分析、系统设计、技术选型和跨平台系统优化。5 年以上经验,精通 Windows、macOS 和 Linux 三大操作系统,具备故障排除和安全防护能力<br/>`it架构设计` `问题解决` `敏捷开发` `系统优化` `跨平台技能` |
|
||||
|
||||
> 📊 Total agents: [<kbd>**244**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
||||
> 📊 Total agents: [<kbd>**294**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
||||
|
||||
<!-- AGENT LIST -->
|
||||
|
||||
@@ -266,9 +271,44 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
||||
|
||||
</div>
|
||||
|
||||
[![][image-feat-database]][docs-feat-database]
|
||||
|
||||
### `8` [支持本地 / 远程数据库][docs-feat-database]
|
||||
|
||||
LobeChat 支持同时使用服务端数据库和本地数据库。根据您的需求,您可以选择合适的部署方案:
|
||||
|
||||
- 本地数据库:适合希望对数据有更多掌控感和隐私保护的用户。LobeChat 采用了 CRDT (Conflict-Free Replicated Data Type) 技术,实现了多端同步功能。这是一项实验性功能,旨在提供无缝的数据同步体验。
|
||||
- 服务端数据库:适合希望更便捷使用体验的用户。LobeChat 支持 PostgreSQL 作为服务端数据库。关于如何配置服务端数据库的详细文档,请前往 [配置服务端数据库](https://lobehub.com/zh/docs/self-hosting/advanced/server-database)。
|
||||
|
||||
无论您选择哪种数据库,LobeChat 都能为您提供卓越的用户体验。
|
||||
|
||||
<div align="right">
|
||||
|
||||
[![][back-to-top]](#readme-top)
|
||||
|
||||
</div>
|
||||
|
||||
[![][image-feat-auth]][docs-feat-auth]
|
||||
|
||||
### `9` [支持多用户管理][docs-feat-auth]
|
||||
|
||||
LobeChat 支持多用户管理,提供了两种主要的用户认证和管理方案,以满足不同需求:
|
||||
|
||||
- **next-auth**:LobeChat 集成了 `next-auth`,一个灵活且强大的身份验证库,支持多种身份验证方式,包括 OAuth、邮件登录、凭证登录等。通过 `next-auth`,您可以轻松实现用户的注册、登录、会话管理以及社交登录等功能,确保用户数据的安全性和隐私性。
|
||||
|
||||
- **Clerk**:对于需要更高级用户管理功能的用户,LobeChat 还支持 `Clerk`,一个现代化的用户管理平台。`Clerk` 提供了更丰富的功能,如多因素认证 (MFA)、白名单、用户管理、登录活动监控等。通过 `Clerk`,您可以获得更高的安全性和灵活性,轻松应对生产级的用户管理需求。
|
||||
|
||||
您可以根据自己的需求,选择合适的用户管理方案。
|
||||
|
||||
<div align="right">
|
||||
|
||||
[![][back-to-top]](#readme-top)
|
||||
|
||||
</div>
|
||||
|
||||
[![][image-feat-pwa]][docs-feat-pwa]
|
||||
|
||||
### `8` [渐进式 Web 应用 (PWA)][docs-feat-pwa]
|
||||
### `10` [渐进式 Web 应用 (PWA)][docs-feat-pwa]
|
||||
|
||||
我们深知在当今多设备环境下为用户提供无缝体验的重要性。为此,我们采用了渐进式 Web 应用 [PWA](https://support.google.com/chrome/answer/9658361) 技术,
|
||||
这是一种能够将网页应用提升至接近原生应用体验的现代 Web 技术。通过 PWA,LobeChat 能够在桌面和移动设备上提供高度优化的用户体验,同时保持轻量级和高性能的特点。
|
||||
@@ -291,7 +331,7 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
||||
|
||||
[![][image-feat-mobile]][docs-feat-mobile]
|
||||
|
||||
### `9` [移动设备适配][docs-feat-mobile]
|
||||
### `11` [移动设备适配][docs-feat-mobile]
|
||||
|
||||
针对移动设备进行了一系列的优化设计,以提升用户的移动体验。目前,我们正在对移动端的用户体验进行版本迭代,以实现更加流畅和直观的交互。如果您有任何建议或想法,我们非常欢迎您通过 GitHub Issues 或者 Pull Requests 提供反馈。
|
||||
|
||||
@@ -303,7 +343,7 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
||||
|
||||
[![][image-feat-theme]][docs-feat-theme]
|
||||
|
||||
### `10` [自定义主题][docs-feat-theme]
|
||||
### `12` [自定义主题][docs-feat-theme]
|
||||
|
||||
作为设计工程师出身,LobeChat 在界面设计上充分考虑用户的个性化体验,因此引入了灵活多变的主题模式,其中包括日间的亮色模式和夜间的深色模式。
|
||||
除了主题模式的切换,还提供了一系列的颜色定制选项,允许用户根据自己的喜好来调整应用的主题色彩。无论是想要沉稳的深蓝,还是希望活泼的桃粉,或者是专业的灰白,用户都能够在 LobeChat 中找到匹配自己风格的颜色选择。
|
||||
@@ -477,9 +517,9 @@ API Key 是使用 LobeChat 进行大语言模型会话的必要信息,本节
|
||||
如果你发现注册 OpenAI 账户或者绑定外币信用卡比较麻烦,可以考虑借助一些知名的 OpenAI 第三方代理商来获取 API Key,这可以有效降低获取 OpenAI API Key 的门槛。但与此同时,一旦使用三方服务,你可能也需要承担潜在的风险,
|
||||
请根据你自己的实际情况自行决策。以下是常见的第三方模型代理商列表,供你参考:
|
||||
|
||||
| | 服务商 | 特性说明 | Proxy 代理地址 | 链接 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------------------------------------------------------------- | ------------------------- | ------------------------------- |
|
||||
| <img src="https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/296272721-c3ac0bf3-e433-4496-89c4-ebdc20689c17.jpg" width="48" /> | **AiHubMix** | 使用 OpenAI 企业接口,全站模型价格为官方 **6 折**(含 GPT-4 ) | `https://aihubmix.com/v1` | [获取](https://lobe.li/XHnZIUP) |
|
||||
| | 服务商 | 特性说明 | Proxy 代理地址 | 链接 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | --------------------------------------------------------------- | ------------------------- | ------------------------------- |
|
||||
| <img src="https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/296272721-c3ac0bf3-e433-4496-89c4-ebdc20689c17.jpg" width="48" /> | **AiHubMix** | 使用 OpenAI 企业接口,全站模型价格为官方 **86 折**(含 GPT-4 ) | `https://aihubmix.com/v1` | [获取](https://lobe.li/XHnZIUP) |
|
||||
|
||||
> \[!WARNING]
|
||||
>
|
||||
@@ -648,11 +688,12 @@ $ pnpm run dev
|
||||
</details>
|
||||
|
||||
Copyright © 2023 [LobeHub][profile-link]. <br />
|
||||
This project is [MIT](./LICENSE) licensed.
|
||||
This project is [Apache 2.0](./LICENSE) licensed.
|
||||
|
||||
<!-- LINK GROUP -->
|
||||
|
||||
[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square
|
||||
[blog]: https://lobehub.com/zh/blog
|
||||
[chat-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/desktop/pagespeed.svg
|
||||
[chat-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/desktop/chat_preview_lobehub_com_chat.html
|
||||
[chat-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/mobile/pagespeed.svg
|
||||
@@ -679,10 +720,13 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[docker-release-shield]: https://img.shields.io/docker/v/lobehub/lobe-chat?color=369eff&label=docker&labelColor=black&logo=docker&logoColor=white&style=flat-square
|
||||
[docker-size-link]: https://hub.docker.com/r/lobehub/lobe-chat
|
||||
[docker-size-shield]: https://img.shields.io/docker/image-size/lobehub/lobe-chat?color=369eff&labelColor=black&style=flat-square
|
||||
[docs]: https://lobehub.com/zh/docs/usage/start
|
||||
[docs-dev-guide]: https://github.com/lobehub/lobe-chat/wiki/index
|
||||
[docs-docker]: https://lobehub.com/docs/self-hosting/platform/docker
|
||||
[docs-env-var]: https://lobehub.com/docs/self-hosting/environment-variables
|
||||
[docs-feat-agent]: https://lobehub.com/docs/usage/features/agent-market
|
||||
[docs-feat-auth]: https://lobehub.com/docs/usage/features/auth
|
||||
[docs-feat-database]: https://lobehub.com/docs/usage/features/database
|
||||
[docs-feat-local]: https://lobehub.com/docs/usage/features/local-llm
|
||||
[docs-feat-mobile]: https://lobehub.com/docs/usage/features/mobile
|
||||
[docs-feat-plugin]: https://lobehub.com/docs/usage/features/plugin-system
|
||||
@@ -692,7 +736,7 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[docs-feat-theme]: https://lobehub.com/docs/usage/features/theme
|
||||
[docs-feat-tts]: https://lobehub.com/docs/usage/features/tts
|
||||
[docs-feat-vision]: https://lobehub.com/docs/usage/features/vision
|
||||
[docs-functionc-call]: https://platform.openai.com/docs/guides/function-calling
|
||||
[docs-functionc-call]: https://lobehub.com/zh/blog/openai-function-call
|
||||
[docs-lighthouse]: https://github.com/lobehub/lobe-chat/wiki/Lighthouse.zh-CN
|
||||
[docs-plugin-dev]: https://lobehub.com/docs/usage/plugins/development
|
||||
[docs-self-hosting]: https://lobehub.com/docs/self-hosting/start
|
||||
@@ -707,13 +751,14 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[github-action-test-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/lobe-chat/test.yml?label=test&labelColor=black&logo=githubactions&logoColor=white&style=flat-square
|
||||
[github-contributors-link]: https://github.com/lobehub/lobe-chat/graphs/contributors
|
||||
[github-contributors-shield]: https://img.shields.io/github/contributors/lobehub/lobe-chat?color=c4f042&labelColor=black&style=flat-square
|
||||
[github-document-link]: https://lobehub.com/docs
|
||||
[github-forks-link]: https://github.com/lobehub/lobe-chat/network/members
|
||||
[github-forks-shield]: https://img.shields.io/github/forks/lobehub/lobe-chat?color=8ae8ff&labelColor=black&style=flat-square
|
||||
[github-hello-shield]: https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=39701baf5a734cb894ec812248a5655a&claim_uid=HxYvFN34htJzGCD&theme=dark&theme=neutral&theme=dark&theme=neutral
|
||||
[github-hello-url]: https://hellogithub.com/repository/39701baf5a734cb894ec812248a5655a
|
||||
[github-issues-link]: https://github.com/lobehub/lobe-chat/issues
|
||||
[github-issues-shield]: https://img.shields.io/github/issues/lobehub/lobe-chat?color=ff80eb&labelColor=black&style=flat-square
|
||||
[github-license-link]: https://github.com/lobehub/lobe-chat/blob/main/LICENSE
|
||||
[github-license-shield]: https://img.shields.io/github/license/lobehub/lobe-chat?color=white&labelColor=black&style=flat-square
|
||||
[github-license-shield]: https://img.shields.io/badge/license-apache%202.0-white?labelColor=black&style=flat-square
|
||||
[github-project-link]: https://github.com/lobehub/lobe-chat/projects
|
||||
[github-release-link]: https://github.com/lobehub/lobe-chat/releases
|
||||
[github-release-shield]: https://img.shields.io/github/v/release/lobehub/lobe-chat?color=369eff&labelColor=black&logo=github&style=flat-square
|
||||
@@ -725,6 +770,8 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[github-trending-url]: https://trendshift.io/repositories/2256
|
||||
[image-banner]: https://github.com/lobehub/lobe-chat/assets/28616219/9f155dff-4737-429f-9cad-a70a1a860c5f
|
||||
[image-feat-agent]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670869-f1ffbf66-42b6-42cf-a937-9ce1f8328514.png
|
||||
[image-feat-auth]: https://github.com/lobehub/lobe-chat/assets/17870709/8ce70e15-40df-451e-b700-66090fe5b8c2
|
||||
[image-feat-database]: https://github.com/lobehub/lobe-chat/assets/17870709/c27a0234-a4e9-40e5-8bcb-42d5ce7e40f9
|
||||
[image-feat-local]: https://github.com/lobehub/lobe-chat/assets/28616219/ca9a21bc-ea6c-4c90-bf4a-fa53b4fb2b5c
|
||||
[image-feat-mobile]: https://gw.alipayobjects.com/zos/kitchen/R441AuFS4W/mobile.webp
|
||||
[image-feat-plugin]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670883-33c43a5c-a512-467e-855c-fa299548cce5.png
|
||||
@@ -734,7 +781,7 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[image-feat-theme]: https://gw.alipayobjects.com/zos/kitchen/pvus1lo%26Z7/darkmode.webp
|
||||
[image-feat-tts]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072124-c9853d8d-f1b5-44a8-a305-45ebc0f6d19a.png
|
||||
[image-feat-vision]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072129-382bdf30-e3d6-4411-b5a0-249710b8ba08.png
|
||||
[image-overview]: https://github.com/lobehub/lobe-chat/assets/28616219/8b04c3c9-3d71-4fb4-bd9b-a4f415c5876d
|
||||
[image-overview]: https://github.com/lobehub/lobe-chat/assets/17870709/56b95d48-f573-41cd-8b38-387bf88bc4bf
|
||||
[image-star]: https://github.com/lobehub/lobe-chat/assets/17870709/cb06b748-513f-47c2-8740-d876858d7855
|
||||
[issues-link]: https://img.shields.io/github/issues/lobehub/lobe-chat.svg?style=flat
|
||||
[lobe-chat-plugins]: https://github.com/lobehub/lobe-chat-plugins
|
||||
@@ -754,6 +801,7 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[lobe-ui-github]: https://github.com/lobehub/lobe-ui
|
||||
[lobe-ui-link]: https://www.npmjs.com/package/@lobehub/ui
|
||||
[lobe-ui-shield]: https://img.shields.io/npm/v/@lobehub/ui?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square
|
||||
[official-site]: https://lobehub.com
|
||||
[pr-welcome-link]: https://github.com/lobehub/lobe-chat/pulls
|
||||
[pr-welcome-shield]: https://img.shields.io/badge/🤯_pr_welcome-%E2%86%92-ffcb47?labelColor=black&style=for-the-badge
|
||||
[profile-link]: https://github.com/lobehub
|
||||
@@ -776,5 +824,5 @@ This project is [MIT](./LICENSE) licensed.
|
||||
[submit-plugin-link]: https://github.com/lobehub/lobe-chat-plugins
|
||||
[submit-plugin-shield]: https://img.shields.io/badge/🧩/🏪_submit_plugin-%E2%86%92-95f3d9?labelColor=black&style=for-the-badge
|
||||
[vercel-link]: https://chat-preview.lobehub.com
|
||||
[vercel-shield]: https://img.shields.io/website?down_message=offline&label=vercel&labelColor=black&logo=vercel&style=flat-square&up_message=online&url=https%3A%2F%2Fchat-preview.lobehub.com
|
||||
[vercel-shield-badge]: https://img.shields.io/website?down_message=offline&label=try%20lobechat&labelColor=black&logo=vercel&style=for-the-badge&up_message=online&url=https%3A%2F%2Fchat-preview.lobehub.com
|
||||
[vercel-shield]: https://img.shields.io/badge/vercel-online-55b467?labelColor=black&logo=vercel&style=flat-square
|
||||
[vercel-shield-badge]: https://img.shields.io/badge/TRY%20LOBECHAT-ONLINE-55b467?labelColor=black&logo=vercel&style=for-the-badge
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
coverage:
|
||||
status:
|
||||
project:
|
||||
default: off
|
||||
server:
|
||||
flags:
|
||||
- server
|
||||
app:
|
||||
flags:
|
||||
- app
|
||||
patch: off
|
||||
@@ -4,14 +4,14 @@ This document aims to guide developers on how to develop a complete feature requ
|
||||
|
||||
We will use the implementation of sessionGroup as an example: [✨ feat: add session group manager](https://github.com/lobehub/lobe-chat/pull/1055), and explain the complete implementation process through the following six main sections:
|
||||
|
||||
1. Data Model / Database Definition
|
||||
2. Service Implementation / Model Implementation
|
||||
3. Frontend Data Flow Store Implementation
|
||||
4. UI Implementation and Action Binding
|
||||
5. Data Migration
|
||||
6. Data Import and Export
|
||||
1. [Data Model / Database Definition](#1-data-model--database-definition)
|
||||
2. [Service Implementation / Model Implementation](#2-service-implementation--model-implementation)
|
||||
3. [Frontend Data Flow Store Implementation](#3-frontend-data-flow-store-implementation)
|
||||
4. [UI Implementation and Action Binding](#4-ui-implementation-and-action-binding)
|
||||
5. [Data Migration](#5-data-migration)
|
||||
6. [Data Import and Export](#6-data-import-and-export)
|
||||
|
||||
## 1. Database Section
|
||||
## 1. Data Model / Database Definition
|
||||
|
||||
To implement the Session Group feature, it is necessary to define the relevant data model and indexes at the database level.
|
||||
|
||||
@@ -119,7 +119,7 @@ As a result, you can now view the `sessionGroups` table in the `LOBE_CHAT_DB` in
|
||||
|
||||

|
||||
|
||||
## 2. Model and Service Section
|
||||
## 2. Service Implementation / Model Implementation
|
||||
|
||||
### Define Model
|
||||
|
||||
@@ -176,7 +176,7 @@ class SessionService {
|
||||
}
|
||||
```
|
||||
|
||||
## 3. Store Action Section
|
||||
## 3. Frontend Data Flow Store Implementation
|
||||
|
||||
In the LobeChat application, the Store module is used to manage the frontend state of the application. The Actions within it are functions that trigger state updates, usually by calling methods in the service layer to perform actual data processing operations and then updating the state in the Store. We use `zustand` as the underlying dependency for the Store module. For a detailed practical introduction to state management, you can refer to [📘 Best Practices for State Management](../State-Management/State-Management-Intro.zh-CN.md).
|
||||
|
||||
@@ -351,7 +351,7 @@ Since all data retrieval in the UI is implemented using syntax like `useSessionS
|
||||
>
|
||||
> If you are not familiar with the concept and functionality of selectors, you can refer to the section [📘 Data Storage and Retrieval Module](./State-Management-Selectors.en-US) for relevant information.
|
||||
|
||||
## IV. UI Section
|
||||
## 4. UI Implementation and Action Binding
|
||||
|
||||
Bind Store Action in the UI component to implement interactive logic, for example `CreateGroupModal`:
|
||||
|
||||
@@ -570,7 +570,7 @@ export class LocalDB extends Dexie {
|
||||
|
||||
This is our data migration strategy. When performing the migration, it is essential to ensure the correctness of the migration script and validate the migration results through thorough testing.
|
||||
|
||||
## VI. Data Import and Export
|
||||
## 6. Data Import and Export
|
||||
|
||||
In LobeChat, the data import and export feature is designed to ensure that users can migrate their data between different devices. This includes session, topic, message, and settings data. In the implementation of the Session Group feature, we also need to handle data import and export to ensure that the complete exported data can be restored exactly the same on other devices.
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
我们将以 sessionGroup 的实现为示例:[✨ feat: add session group manager](https://github.com/lobehub/lobe-chat/pull/1055) , 通过以下六个主要部分来阐述完整的实现流程:
|
||||
|
||||
1. 数据模型 / 数据库定义
|
||||
2. Service 实现 / Model 实现
|
||||
3. 前端数据流 Store 实现
|
||||
4. UI 实现与 action 绑定
|
||||
5. 数据迁移
|
||||
6. 数据导入导出
|
||||
1. [数据模型 / 数据库定义](#一数据模型--数据库定义)
|
||||
2. [Service 实现 / Model 实现](#二service-实现--model-实现)
|
||||
3. [前端数据流 Store 实现](#三前端数据流-store-实现)
|
||||
4. [UI 实现与 action 绑定](#四ui-实现与-action-绑定)
|
||||
5. [数据迁移](#五数据迁移)
|
||||
6. [数据导入导出](#六数据导入导出)
|
||||
|
||||
## 一、数据库部分
|
||||
## 一、数据模型 / 数据库定义
|
||||
|
||||
为了实现 Session Group 功能,首先需要在数据库层面定义相关的数据模型和索引。
|
||||
|
||||
@@ -119,7 +119,7 @@ export class LocalDB extends Dexie {
|
||||
|
||||

|
||||
|
||||
## 二、Model 与 Service 部分
|
||||
## 二、Service 实现 / Model 实现
|
||||
|
||||
### 定义 Model
|
||||
|
||||
@@ -176,7 +176,7 @@ class SessionService {
|
||||
}
|
||||
```
|
||||
|
||||
## 三、Store Action 部分
|
||||
## 三、前端数据流 Store 实现
|
||||
|
||||
在 LobeChat 应用中,Store 是用于管理应用前端状态的模块。其中的 Action 是触发状态更新的函数,通常会调用服务层的方法来执行实际的数据处理操作,然后更新 Store 中的状态。我们采用了 `zustand` 作为 Store 模块的底层依赖,对于状态管理的详细实践介绍,可以查阅 [📘 状态管理最佳实践](../State-Management/State-Management-Intro.zh-CN.md)
|
||||
|
||||
@@ -351,7 +351,7 @@ const customSessionGroups = (s: SessionStore): CustomSessionGroup[] => s.customS
|
||||
>
|
||||
> 如果你对 Selectors 的概念和功能不太了解,可以查阅 [📘 数据存储取数模块](../State-Management/State-Management-Selectors.zh-CN.md) 部分了解相关内容。
|
||||
|
||||
## 四、UI 部分
|
||||
## 四、UI 实现与 action 绑定
|
||||
|
||||
在 UI 组件中绑定 Store Action 实现交互逻辑,例如 `CreateGroupModal`:
|
||||
|
||||
|
||||
+81
-13
@@ -1,22 +1,26 @@
|
||||
# Technical Development Getting Started Guide
|
||||
|
||||
Welcome to the LobeChat technical development getting started guide. LobeChat is an AI conversation application built on the Next.js framework, which integrates a series of technology stacks to achieve diverse functions and features. This guide will provide a detailed introduction to the main technical components of LobeChat and how to configure and use these technologies in your development environment.
|
||||
Welcome to the LobeChat Technical Development Getting Started Guide. LobeChat is an AI conversation application built on the Next.js framework, incorporating a range of technology stacks to achieve diverse functionalities and features. This guide will detail the main technical components of LobeChat and how to configure and use these technologies in your development environment.
|
||||
|
||||
#### TOC
|
||||
|
||||
- [Basic Technology Stack](#basic-technology-stack)
|
||||
- [Folder Directory Structure](#folder-directory-structure)
|
||||
- [Local Development Environment Setup](#local-development-environment-setup)
|
||||
- [Code Style and Contribution Guide](#code-style-and-contribution-guide)
|
||||
- [Internationalization Implementation Guide](#internationalization-implementation-guide)
|
||||
- [Appendix: Resources and References](#appendix-resources-and-references)
|
||||
|
||||
## Basic Technology Stack
|
||||
|
||||
The core technology stack of LobeChat includes:
|
||||
The core technology stack of LobeChat is as follows:
|
||||
|
||||
- **Framework**: We have chosen [Next.js](https://nextjs.org/), a powerful React framework that provides key features such as server-side rendering, routing framework, and Router Handler for our project.
|
||||
- **Component Library**: We use [Ant Design (antd)](https://ant.design/) as the basic component library, and also introduce [lobe-ui](https://github.com/lobehub/lobe-ui) as our business component library.
|
||||
- **State Management**: We have opted for [zustand](https://github.com/pmndrs/zustand), a lightweight and easy-to-use state management library.
|
||||
- **Framework**: We chose [Next.js](https://nextjs.org/), a powerful React framework that provides key features such as server-side rendering, routing framework, and Router Handler.
|
||||
- **Component Library**: We use [Ant Design (antd)](https://ant.design/) as the basic component library, along with [lobe-ui](https://github.com/lobehub/lobe-ui) as our business component library.
|
||||
- **State Management**: We selected [zustand](https://github.com/pmndrs/zustand), a lightweight and easy-to-use state management library.
|
||||
- **Network Requests**: We use [swr](https://swr.vercel.app/), a React Hooks library for data fetching.
|
||||
- **Routing**: For routing management, we directly use the solution provided by [Next.js](https://nextjs.org/) itself.
|
||||
- **Internationalization**: We use [i18next](https://www.i18next.com/) to implement multi-language support for the application.
|
||||
- **Routing**: For routing management, we directly use the solution provided by [Next.js](https://nextjs.org/).
|
||||
- **Internationalization**: We use [i18next](https://www.i18next.com/) to support multiple languages in the application.
|
||||
- **Styling**: We use [antd-style](https://github.com/ant-design/antd-style), a CSS-in-JS library that complements Ant Design.
|
||||
- **Unit Testing**: We use [vitest](https://github.com/vitest-dev/vitest) for unit testing.
|
||||
|
||||
@@ -26,18 +30,82 @@ The folder directory structure of LobeChat is as follows:
|
||||
|
||||
```bash
|
||||
src
|
||||
├── app # Main logic of the application and code related to state management
|
||||
├── app # Code related to the main logic and state management of the application
|
||||
├── components # Reusable UI components
|
||||
├── config # Application configuration files, including client-side environment variables and server-side environment variables
|
||||
├── config # Application configuration files, including client and server environment variables
|
||||
├── const # Used to define constants, such as action types, route names, etc.
|
||||
├── features # Function modules related to business features, such as Agent settings, plugin development pop-ups, etc.
|
||||
├── hooks # Custom utility hooks reused throughout the application
|
||||
├── features # Business-related feature modules, such as Agent settings, plugin development pop-ups, etc.
|
||||
├── hooks # Custom utility Hooks reusable across the application
|
||||
├── layout # Application layout components, such as navigation bars, sidebars, etc.
|
||||
├── locales # Language files for internationalization
|
||||
├── services # Encapsulated backend service interfaces, such as HTTP requests
|
||||
├── store # Zustand store for state management
|
||||
├── types # TypeScript type definition files
|
||||
└── utils # Common utility functions
|
||||
└── utils # General utility functions
|
||||
```
|
||||
|
||||
For a detailed introduction to the directory structure, please refer to: [Folder Directory Structure](Folder-Structure.en-US.md)
|
||||
For a detailed introduction to the directory structure, see: [Folder Directory Structure](Folder-Structure.zh-CN.md)
|
||||
|
||||
## Local Development Environment Setup
|
||||
|
||||
This section outlines setting up the development environment and local development. Before starting, please ensure that Node.js, Git, and your chosen package manager (Bun or PNPM) are installed in your local environment.
|
||||
|
||||
We recommend using WebStorm as your integrated development environment (IDE).
|
||||
|
||||
1. **Get the code**: Clone the LobeChat code repository locally:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/lobehub/lobe-chat.git
|
||||
```
|
||||
|
||||
2. **Install dependencies**: Enter the project directory and install the required dependencies:
|
||||
|
||||
```bash
|
||||
cd lobe-chat
|
||||
# If you use Bun
|
||||
bun install
|
||||
# If you use PNPM
|
||||
pnpm install
|
||||
```
|
||||
|
||||
3. **Run and debug**: Start the local development server and begin your development journey:
|
||||
|
||||
```bash
|
||||
# Start the development server with Bun
|
||||
bun run dev
|
||||
# Visit http://localhost:3010 to view the application
|
||||
```
|
||||
|
||||
> \[!IMPORTANT]\
|
||||
> If you encounter the error "Could not find 'stylelint-config-recommended'" when installing dependencies with `npm`, please reinstall the dependencies using `pnpm` or `bun`.
|
||||
|
||||
Now, you should be able to see the welcome page of LobeChat in your browser. For a detailed environment setup guide, please refer to [Development Environment Setup Guide](Setup-Development.zh-CN.md).
|
||||
|
||||
## Code Style and Contribution Guide
|
||||
|
||||
In the LobeChat project, we place great emphasis on the quality and consistency of the code. For this reason, we have established a series of code style standards and contribution processes to ensure that every developer can smoothly participate in the project. Here are the code style and contribution guidelines you need to follow as a developer.
|
||||
|
||||
- **Code Style**: We use `@lobehub/lint` to unify the code style, including ESLint, Prettier, remarklint, and stylelint configurations. Please adhere to our code standards to maintain code consistency and readability.
|
||||
- **Contribution Process**: We use gitmoji and semantic release for code submission and release processes. Please use gitmoji to annotate your commit messages and ensure compliance with the semantic release standards so that our automation systems can correctly handle version control and releases.
|
||||
|
||||
All contributions will undergo code review. Maintainers may suggest modifications or requirements. Please respond actively to review comments and make timely adjustments. We look forward to your participation and contribution.
|
||||
|
||||
For detailed code style and contribution guidelines, please refer to [Code Style and Contribution Guide](Contributing-Guidelines.zh-CN.md).
|
||||
|
||||
## Internationalization Implementation Guide
|
||||
|
||||
LobeChat uses `i18next` and `lobe-i18n` to implement multilingual support, ensuring a global user experience.
|
||||
|
||||
Internationalization files are located in `src/locales`, containing the default language (Chinese). We generate other language JSON files automatically through `lobe-i18n`.
|
||||
|
||||
If you want to add a new language, follow specific steps detailed in [New Language Addition Guide](../Internationalization/Add-New-Locale.zh-CN.md). We encourage you to participate in our internationalization efforts to provide better services to global users.
|
||||
|
||||
For a detailed guide on internationalization implementation, please refer to [Internationalization Implementation Guide](../Internationalization/Internationalization-Implementation.zh-CN.md).
|
||||
|
||||
## Appendix: Resources and References
|
||||
|
||||
To support developers in better understanding and using the technology stack of LobeChat, we provide a comprehensive list of resources and references — [LobeChat Resources and References](https://github.com/lobehub/lobe-chat/wiki/Resources.zh-CN) - Visit our maintained list of resources, including tutorials, articles, and other useful links.
|
||||
|
||||
We encourage developers to utilize these resources to deepen their learning and enhance their skills, join community discussions through [LobeChat GitHub Discussions](https://github.com/lobehub/lobe-chat/discussions) or [Discord](https://discord.com/invite/AYFPHvv2jT), ask questions, or share your experiences.
|
||||
|
||||
If you have any questions or need further assistance, please do not hesitate to contact us through the above channels.
|
||||
|
||||
@@ -76,6 +76,9 @@ bun run dev
|
||||
# 访问 http://localhost:3010 查看应用
|
||||
```
|
||||
|
||||
> \[!IMPORTANT]\
|
||||
> 如果使用`npm`安装依赖出现`Could not find "stylelint-config-recommended"`错误,请使用 `pnpm` 或者 `bun` 重新安装依赖。
|
||||
|
||||
现在,你应该可以在浏览器中看到 LobeChat 的欢迎页面。详细的环境配置指南,请参考 [开发环境设置指南](Setup-Development.zh-CN.md)。
|
||||
|
||||
## 代码风格与贡献指南
|
||||
|
||||
@@ -1,40 +1,56 @@
|
||||
---
|
||||
title: >-
|
||||
LobeChat Identity Verification Service - Centralized User Authorization
|
||||
Management
|
||||
title: LobeChat Authorization Service
|
||||
description: >-
|
||||
Learn about LobeChat's support for configuring external identity verification
|
||||
services for centralized user authorization within enterprises/organizations.
|
||||
Explore supported services like Auth0, Microsoft Entra ID, Authentik, Github,
|
||||
and ZITADEL.
|
||||
tags:
|
||||
- Identity Verification Service
|
||||
- Centralized User Authorization
|
||||
- SSO Providers
|
||||
- Auth0
|
||||
- Microsoft Entra ID
|
||||
- Authentik
|
||||
- Github
|
||||
- ZITADEL
|
||||
- Next Auth
|
||||
- Clerk
|
||||
---
|
||||
|
||||
# Identity Verification Service
|
||||
# LobeChat Authorization
|
||||
|
||||
LobeChat supports the configuration of external identity verification services for internal use within enterprises/organizations to centrally manage user authorization.
|
||||
|
||||
## Clerk
|
||||
|
||||
Clerk is a comprehensive identity verification solution that has recently gained popularity. It provides a simple yet powerful API and services to handle user authentication and session management. Clerk's design philosophy is to offer a concise and modern authentication solution that enables developers to easily integrate and use it.
|
||||
|
||||
LobeChat has deeply integrated with Clerk to provide users with a more secure and convenient login and registration experience. It also relieves developers from the burden of managing authentication logic. Clerk's concise and modern design philosophy aligns perfectly with LobeChat's goals, making user management on the entire platform more efficient and reliable.
|
||||
|
||||
By setting the environment variables NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY in LobeChat's environment, you can enable and use Clerk.
|
||||
|
||||
## Next Auth
|
||||
|
||||
Before using NextAuth, please set the following variables in LobeChat's environment variables:
|
||||
|
||||
| Environment Variable | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can use the following command: `openssl rand -base64 32`, or visit `https://generate-secret.vercel.app/32` to generate the key. |
|
||||
| `ACCESS_CODE` | Required | Add a password to access this service. You can set a sufficiently long random password to "disable" access code authorization. |
|
||||
| `NEXTAUTH_URL` | Optional | This URL specifies the callback address for Auth.js when performing OAuth verification. Set this only if the default generated redirect address is incorrect. `https://example.com/api/auth` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | Optional | This environment variable is used to enable multiple identity verification sources simultaneously, separated by commas, for example, `auth0,azure-ad,authentik`. |
|
||||
|
||||
Currently supported identity verification services include:
|
||||
|
||||
- [Auth0](/docs/self-hosting/advanced/sso-providers/auth0)
|
||||
- [Microsoft Entra ID](/docs/self-hosting/advanced/sso-providers/microsoft-entra-id)
|
||||
- [Authentik](/docs/self-hosting/advanced/sso-providers/authentik)
|
||||
- [Github](/docs/self-hosting/advanced/sso-providers/github)
|
||||
- [ZITADEL](/docs/self-hosting/advanced/sso-providers/zitadel)
|
||||
|
||||
<Cards>
|
||||
<Card href={'/docs/self-hosting/advanced/sso-providers/auth0'} title={'Auth0'} />
|
||||
<Card
|
||||
href={'/docs/self-hosting/advanced/sso-providers/microsoft-entra-id'}
|
||||
title={'Microsoft Entra ID'}
|
||||
/>
|
||||
<Card href={'/docs/self-hosting/advanced/sso-providers/authentik'} title={'Authentik'} />
|
||||
<Card href={'/docs/self-hosting/advanced/sso-providers/github'} title={'Github'} />
|
||||
<Card href={'/docs/self-hosting/advanced/sso-providers/zitadel'} title={'ZITADEL'} />
|
||||
</Cards>
|
||||
Click on the links to view the corresponding platform's configuration documentation.
|
||||
|
||||
## Advanced Configuration
|
||||
|
||||
To simultaneously enable multiple identity verification sources, please set the `SSO_PROVIDERS` environment variable, separating them with commas, for example, `auth0,azure-ad,authentik`.
|
||||
To simultaneously enable multiple identity verification sources, please set the `NEXT_AUTH_SSO_PROVIDERS` environment variable, separating them with commas, for example, `auth0,azure-ad,authentik`.
|
||||
|
||||
The order corresponds to the display order of the SSO providers.
|
||||
|
||||
|
||||
@@ -1,36 +1,54 @@
|
||||
---
|
||||
title: LobeChat 外部身份验证服务配置指南
|
||||
description: >-
|
||||
了解如何配置外部身份验证服务以统一管理用户授权。支持的身份验证服务包括 Auth0, Microsoft Entra ID, Authentik,
|
||||
Github, 和 ZITADEL。
|
||||
title: LobeChat 身份验证服务配置
|
||||
description: 了解如何使用 Clerk 或 Next Auth 配置外部身份验证服务,以统一管理用户授权。支持的身份验证服务包括 Auth0、 Azure ID 等。
|
||||
tags:
|
||||
- 身份验证服务
|
||||
- LobeChat
|
||||
- SSO
|
||||
- Auth0
|
||||
- Microsoft Entra ID
|
||||
- Authentik
|
||||
- Github
|
||||
- ZITADEL
|
||||
- Clerk
|
||||
---
|
||||
|
||||
# 身份验证服务
|
||||
|
||||
LobeChat 支持配置外部身份验证服务,供企业 / 组织内部使用,统一管理用户授权。
|
||||
LobeChat 支持使用 Clerk 或者 Next Auth 配置外部身份验证服务,供企业 / 组织内部使用,统一管理用户授权。
|
||||
|
||||
## Clerk
|
||||
|
||||
Clerk 是一个近期流行起来的全面的身份验证解决方案,它提供了简单而强大的 API 和服务来处理用户认证和会话管理。Clerk 的设计哲学是提供一套简洁、现代的认证解决方案,使得开发者可以轻松集成和使用。
|
||||
|
||||
LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全、便捷的登录和注册体验,同时也为开发者减轻了管理身份验证逻辑的负担。Clerk 的简洁和现代的设计理念与 LobeChat 的目标非常契合,使得整个平台的用户管理更加高效和可靠。
|
||||
|
||||
在 LobeChat 的环境变量中设置 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY`,即可开启和使用 Clerk。
|
||||
|
||||
## Next Auth
|
||||
|
||||
在使用 NextAuth 之前,请先在 LobeChat 的环境变量中设置以下变量:
|
||||
|
||||
| 环境变量 | 类型 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 |
|
||||
| `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个足够长的随机密码以 “禁用” 访问码授权 |
|
||||
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,azure-ad,authentik`。 |
|
||||
|
||||
目前支持的身份验证服务有:
|
||||
|
||||
- [Auth0](/docs/self-hosting/advanced/sso-providers/auth0)
|
||||
- [Microsoft Entra ID](/docs/self-hosting/advanced/sso-providers/microsoft-entra-id)
|
||||
- [Authentik](/docs/self-hosting/advanced/sso-providers/authentik)
|
||||
- [Github](/docs/self-hosting/advanced/sso-providers/github)
|
||||
- [ZITADEL](/docs/self-hosting/advanced/sso-providers/zitadel)
|
||||
<Cards>
|
||||
<Card href={'/zh/docs/self-hosting/advanced/sso-providers/auth0'} title={'Auth0'} />
|
||||
<Card
|
||||
href={'/zh/docs/self-hosting/advanced/sso-providers/microsoft-entra-id'}
|
||||
title={'Microsoft Entra ID'}
|
||||
/>
|
||||
<Card href={'/zh/docs/self-hosting/advanced/sso-providers/authentik'} title={'Authentik'} />
|
||||
<Card href={'/zh/docs/self-hosting/advanced/sso-providers/github'} title={'Github'} />
|
||||
<Card href={'/zh/docs/self-hosting/advanced/sso-providers/zitadel'} title={'ZITADEL'} />
|
||||
</Cards>
|
||||
|
||||
点击链接可以查看对应平台的配置文档。
|
||||
点击即可查看对应平台的配置文档。
|
||||
|
||||
## 进阶配置
|
||||
|
||||
同时启用多个身份验证源请设置 `SSO_PROVIDERS` 环境变量,以逗号 `,` 分割,例如 `auth0,azure-ad,authentik`。
|
||||
同时启用多个身份验证源请设置 `NEXT_AUTH_SSO_PROVIDERS` 环境变量,以逗号 `,` 分割,例如 `auth0,azure-ad,authentik`。
|
||||
|
||||
顺序为 SSO 提供商的显示顺序。
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
title: LobeChat Feature Flags Environment Variables Configuration Guide
|
||||
description: >-
|
||||
Learn how to use environment variables to customize LobeChat's feature flags,
|
||||
including controlling whether a feature is enabled or disabled, or enabling or
|
||||
disabling features for specific user groups or environments as needed.
|
||||
tags:
|
||||
- LobeChat
|
||||
- Environment Variables
|
||||
- Configuration Guide
|
||||
- Feature Flags
|
||||
---
|
||||
|
||||
# Feature Flags
|
||||
|
||||
In addition to basic environment variable configuration, LobeChat also offers feature flags to control whether a feature is enabled globally, or to enable or disable features for specific user groups or environments as needed.
|
||||
|
||||
## Feature Flags Environment Variable `FEATURE_FLAGS`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Used to control LobeChat's feature functionalities. Supports multiple feature flags, using `+` to add a feature and `-` to disable a feature. Separate multiple feature flags with a comma `,` and enclose the entire value in quotes `"` to avoid parsing errors.
|
||||
- Default: `-`
|
||||
- Example: `"-welcome_suggest"`
|
||||
|
||||
All features are controlled by the `FEATURE_FLAGS` variable as the sole configuration variable.
|
||||
|
||||
You can achieve various feature combinations using the above configuration syntax. All feature flags are Boolean values, enabled with `+` and disabled with `-`.
|
||||
|
||||
<Callout type={'tip'}>
|
||||
Attention: Unlike the `OPENAI_MODEL_LIST` variable, the `FEATURE_FLAGS` variable does not support
|
||||
the `all` keyword. You need to manually control all feature flags (otherwise, they will adopt
|
||||
their default values).
|
||||
</Callout>
|
||||
|
||||
| Configuration Item | Description | Default Value |
|
||||
| ------------------------- | ----------------------------------------------- | ------------- |
|
||||
| `webrtc_sync` | Enables WebRTC sync functionality. | Disabled |
|
||||
| `language_model_settings` | Enables language model settings. | Enabled |
|
||||
| `openai_api_key` | Allows users to customize the OpenAI API Key. | Enabled |
|
||||
| `openai_proxy_url` | Allows users to customize the OpenAI proxy URL. | Enabled |
|
||||
| `create_session` | Allows users to create sessions. | Enabled |
|
||||
| `edit_agent` | Allows users to edit assistants. | Enabled |
|
||||
| `dalle` | Enables the DALL-E functionality. | Enabled |
|
||||
| `check_updates` | Allows checking for updates. | Enabled |
|
||||
| `welcome_suggest` | Displays welcome suggestions. | Enabled |
|
||||
|
||||
You can always check the [featureFlags](https://github.com/lobehub/lobe-chat/blob/main/src/config/featureFlags/schema.ts) to get the latest list of feature flags.
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
title: LobeChat 特性标志环境变量配置指南
|
||||
description: 了解如何使用环境变量自定义 LobeChat 的特性标志,包括控制否启用某个功能、或者根据需要对特定用户群体或环境启用或禁用功能。
|
||||
tags:
|
||||
- LobeChat
|
||||
- 环境变量
|
||||
- 配置指南
|
||||
- 特征标志
|
||||
---
|
||||
|
||||
# 特性标志
|
||||
|
||||
除了基础的环境变量配置外,LobeChat 还提供了一些特性标志(Feature Flags),用于控制是否全局启用某个功能,或者根据需要对特定用户群体或环境启用或禁用功能。
|
||||
|
||||
## 特性标志环境变量 `FEATURE_FLAGS`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:用于控制 LobeChat 的特性功能,支持多个功能标志,使用 `+` 增加一个功能,使用 `-` 来关闭一个功能,多个功能标志之间使用英文逗号 `,` 隔开,最外层建议添加引号 `"` 以避免解析错误。
|
||||
- 默认值:`-`
|
||||
- 示例:`"-welcome_suggest"`
|
||||
|
||||
所有的功能统一以特性标志 `FEATURE_FLAGS` 作为唯一的配置变量。
|
||||
|
||||
你可以通过上述配置语法来实现更多的功能组合。所有的功能配置项都是布尔类型,通过 `+` 来启用,通过 `-` 来关闭。
|
||||
|
||||
<Callout type={'tip'}>
|
||||
注意:与 `OPENAI_MODEL_LIST` 变量不同,`FEATURE_FLAGS` 变量不支持 `all`
|
||||
关键字,你需要手动控制所有的功能标志(否则它们会采用对应的默认值)。
|
||||
</Callout>
|
||||
|
||||
| 配置项 | 解释 | 默认值 |
|
||||
| ------------------------- | -------------------------------- | ------ |
|
||||
| `webrtc_sync` | 启用 WebRTC 同步功能。 | 关闭 |
|
||||
| `language_model_settings` | 启用语言模型设置。 | 开启 |
|
||||
| `openai_api_key` | 允许用户自定义 OpenAI API Key。 | 开启 |
|
||||
| `openai_proxy_url` | 允许用户自定义 OpenAI 代理 URL。 | 开启 |
|
||||
| `create_session` | 允许用户创建会话。 | 开启 |
|
||||
| `edit_agent` | 允许用户编辑助手。 | 开启 |
|
||||
| `dalle` | 启用 DALL-E 功能。 | 开启 |
|
||||
| `check_updates` | 允许检查更新。 | 开启 |
|
||||
| `welcome_suggest` | 显示欢迎建议。 | 开启 |
|
||||
|
||||
你可以随时检查 [featureFlags](https://github.com/lobehub/lobe-chat/blob/main/src/config/featureFlags/schema.ts) 以获取最新的特性标志列表。
|
||||
@@ -12,10 +12,10 @@ tags:
|
||||
|
||||
# Model List
|
||||
|
||||
LobeChat supports customizing the model list during deployment. You can use `+` to add a model, `-` to hide a model, and use `model name=display name<extension configuration>` to customize the display name of a model, separated by English commas. The basic syntax is as follows:
|
||||
LobeChat supports customizing the model list during deployment. This configuration is done in the environment for each [model provider](/docs/self-hosting/environment-variables/model-provider). You can use `+` to add a model, `-` to hide a model, and use `model name=display name<extension configuration>` to customize the display name of a model, separated by English commas. The basic syntax is as follows:
|
||||
|
||||
```shell
|
||||
id=displayName < maxToken:vision:fc:file > ,model2,model3
|
||||
```text
|
||||
id=displayName<maxToken:vision:fc:file>,model2,model3
|
||||
```
|
||||
|
||||
For example: `+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turbo`
|
||||
|
||||
@@ -8,12 +8,13 @@ tags:
|
||||
- 模型展示名
|
||||
- 模型能力
|
||||
---
|
||||
|
||||
# Model List
|
||||
|
||||
LobeChat 支持在部署时自定义模型列表,可以使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名<扩展配置>` 来自定义模型的展示名,用英文逗号隔开。通过 `<>` 来添加扩展配置。基本语法如下:
|
||||
|
||||
```shell
|
||||
id=displayName < maxToken:vision:fc:file > ,model2,model3
|
||||
```text
|
||||
id=displayName<maxToken:vision:fc:file>,model2,model3
|
||||
```
|
||||
|
||||
例如: `+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turbo`
|
||||
|
||||
@@ -0,0 +1,425 @@
|
||||
---
|
||||
title: Deploying Server-Side Database - Configuration Guide for LobeChat on Vercel
|
||||
description: >-
|
||||
Learn how to deploy the server-side database version of LobeChat on Vercel,
|
||||
including database configuration, identity authentication service setup, and
|
||||
S3 storage service configuration.
|
||||
tags:
|
||||
- Server-Side Database
|
||||
- Vercel Deployment
|
||||
- Postgres Database
|
||||
- Identity Authentication
|
||||
- S3 Storage Service
|
||||
- Configuration Guide
|
||||
---
|
||||
|
||||
# Deploying Server-Side Database
|
||||
|
||||
LobeChat defaults to using a client-side database (IndexedDB) but also supports using a server-side database. LobeChat uses Postgres as the backend storage database. PostgreSQL is a powerful open-source relational database management system with high scalability and standard SQL support. It provides rich data types, concurrency control, data integrity, security, and programmability, making it suitable for complex applications and large-scale data management.
|
||||
|
||||
This article will detail how to deploy the server-side database version of LobeChat on Vercel, including: 1) database configuration; 2) identity authentication service configuration; 3) steps for setting up the S3 storage service.
|
||||
|
||||
<Callout type={'info'}>
|
||||
Due to workload constraints, currently only deployment on Vercel using the server-side database
|
||||
version is supported, with Docker version support planned for future iterations.
|
||||
</Callout>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Before proceeding, please ensure the following
|
||||
- **Export all data.** After deploying the server-side database, the original user data cannot be migrated automatically. You must back it up in advance and import it manually!
|
||||
- **The `ACCESS_CODE` environment variable is set.** It should not be empty or cleared!
|
||||
- **It is crucial to fill in all the environment variables required for the server-side database configuration before deployment.** Failure to do so may result in database migration issues!
|
||||
</Callout>
|
||||
|
||||
## 1. Configure the Database
|
||||
|
||||
<Steps>
|
||||
|
||||
### Prepare a Server-Side Database Instance and Obtain the Connection URL
|
||||
|
||||
Before deployment, make sure you have prepared a Postgres database instance. You can choose either of the following methods:
|
||||
|
||||
- `A.` Use Serverless Postgres instances like Vercel/Neon;
|
||||
- `B.` Use self-deployed Postgres instances like Docker.
|
||||
|
||||
The configuration for both methods is slightly different, which will be distinguished in the next step.
|
||||
|
||||
### Add Environment Variables in Vercel
|
||||
|
||||
In Vercel's deployment environment variables, add the `DATABASE_URL` and other environment variables. Fill in the prepared Postgres database connection URL. The typical format for the database connection URL is `postgres://username:password@host:port/database`.
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Confirm the type of `Postgres` your provider offers. If it's `Node Postgres`, you must add the environment variable `DATABASE_DRIVER=node`.
|
||||
</Callout>
|
||||
|
||||
<Tabs items={['Serverless Postgres', 'Node Postgres']}>
|
||||
|
||||
<Tab>
|
||||
|
||||
Variables required for Serverless Postgres are as follows:
|
||||
|
||||
```shell
|
||||
# Serverless Postgres DB Url
|
||||
DATABASE_URL=
|
||||
|
||||
# Specify the service mode as server, otherwise it won't enter the server-side database
|
||||
NEXT_PUBLIC_SERVICE_MODE=server
|
||||
```
|
||||
|
||||
An example of how to fill in Vercel is shown below:
|
||||
|
||||
<Image
|
||||
alt={'Add Serverless Postgres DATABASE_URL'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/d4a710cd-6404-4196-90d0-cd08ca385074'}
|
||||
></Image>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab>
|
||||
Variables required for Node Postgres are as follows:
|
||||
|
||||
```shell
|
||||
# Node Postgres DB Url
|
||||
DATABASE_URL=
|
||||
|
||||
# Specify the Postgres database driver as node
|
||||
DATABASE_DRIVER=node
|
||||
|
||||
# Specify the service mode as server, otherwise it won't enter the server-side database
|
||||
NEXT_PUBLIC_SERVICE_MODE=server
|
||||
```
|
||||
|
||||
An example of how to fill in Vercel is shown below:
|
||||
|
||||
<Image
|
||||
alt={'Add Node Postgres DATABASE_URL'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/1c689738-809b-4199-b305-ba5770d39da7'}
|
||||
></Image>
|
||||
|
||||
</Tab>
|
||||
|
||||
</Tabs>
|
||||
|
||||
<Callout type={'info'}>
|
||||
To connect to the database using SSL, please refer to this [link](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode) for instructions on how to configure it.
|
||||
</Callout>
|
||||
|
||||
### Add the `KEY_VAULTS_SECRET` Environment Variable
|
||||
|
||||
After adding the `DATABASE_URL` environment variable, you need to add a `KEY_VAULTS_SECRET` environment variable. This variable is used to encrypt sensitive information like user-stored API keys. You can generate a random 32-character string as the key using `openssl rand -base64 32`.
|
||||
|
||||
```shell
|
||||
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
||||
```
|
||||
|
||||
Add this to the Vercel environment variables as well.
|
||||
|
||||
</Steps>
|
||||
|
||||
## 2. Configure the Identity Authentication Service
|
||||
|
||||
A server-side database needs to be paired with an identity authentication service to function properly. Therefore, the corresponding identity authentication service needs to be configured.
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Due to workload constraints, currently only Clerk is supported as an identity authentication
|
||||
service solution. Integration with Next-Auth for server-side database is under development.
|
||||
</Callout>
|
||||
|
||||
<Steps>
|
||||
|
||||
### Prepare the Clerk Identity Authentication Service
|
||||
|
||||
Go to [Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) to register and create an application to obtain the corresponding Public Key and Secret Key.
|
||||
|
||||
<Callout type={'info'}>
|
||||
If you are unfamiliar with Clerk, you can refer to [Authentication
|
||||
Service-Clerk](/en/docs/self-hosting/advanced/authentication#clerk) for details on using Clerk.
|
||||
</Callout>
|
||||
|
||||
### Add Public and Private Key Environment Variables in Vercel
|
||||
|
||||
In Vercel's deployment environment variables, add the `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variables. You can click on "API Keys" in the menu, then copy the corresponding values and paste them into Vercel's environment variables.
|
||||
|
||||
<Image
|
||||
alt={'Find the corresponding public and private key environment variables in Clerk'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/89883703-7a1a-4a11-b944-5d804544e57c'}
|
||||
></Image>
|
||||
|
||||
The environment variables required for this step are as follows:
|
||||
|
||||
```shell
|
||||
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
|
||||
CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
Add these variables to Vercel:
|
||||
|
||||
<Image
|
||||
alt={'Add Clerk public and private key environment variables in Vercel'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/2bfa13df-6e20-4768-97c0-4dad06c85a2f'}
|
||||
></Image>
|
||||
|
||||
### Create and Configure a Webhook in Clerk
|
||||
|
||||
Since we let Clerk handle user authentication and management entirely, we need Clerk to notify our application and store data in the database when there are changes in the user lifecycle (create, update, delete). We achieve this using the Webhook provided by Clerk.
|
||||
|
||||
We need to add an endpoint in Clerk's Webhooks to inform Clerk to send notifications to this endpoint when a user's status changes.
|
||||
|
||||
<Image
|
||||
alt={'Add an endpoint in Clerk Webhooks'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/f50f47fb-5e8e-4930-bf4e-8cf6f5b8afb9'}
|
||||
>
|
||||
|
||||
</Image>
|
||||
|
||||
Fill in your Vercel project's URL in the endpoint, such as `https://your-project.vercel.app/api/webhooks/clerk`. Then, in the Subscribe to events section, check the three user events (`user.created`, `user.deleted`, `user.updated`), and click create.
|
||||
|
||||
<Callout type={'warning'}>Ensure that the URL includes the `https://` prefix. Maintaining the integrity of the URL is crucial.</Callout>
|
||||
|
||||
<Image
|
||||
alt={'Configure URL and user events when adding Clerk Webhooks'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/0249ea56-ab17-4aa9-a56c-9ebd556c2645'}
|
||||
></Image>
|
||||
|
||||
### Add the Webhook Secret to Vercel Environment Variables
|
||||
|
||||
After creation, you can find the secret of this Webhook in the bottom right corner:
|
||||
|
||||
<Image
|
||||
alt={'View Clerk Webhook secret'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'}
|
||||
></Image>
|
||||
|
||||
The corresponding environment variable name for this secret is `CLERK_WEBHOOK_SECRET`:
|
||||
|
||||
```shell
|
||||
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
Add this to Vercel's environment variables:
|
||||
|
||||
<Image
|
||||
alt={'Add Clerk Webhook secret in Vercel'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/5fdc9479-007f-46ab-9d6e-a9603e949116'}>
|
||||
|
||||
</Image>
|
||||
|
||||
</Steps>
|
||||
|
||||
You have now successfully configured the Clerk identity authentication service. Next, we will configure the S3 storage service.
|
||||
|
||||
## 3. Configure S3 Storage Service
|
||||
|
||||
LobeChat has long supported multimodal AI conversations, involving the function of uploading images to AI. In the client-side database solution, image files are stored as binary data in the browser's indexedDB database. However, this solution is not feasible in the server-side database. We need to configure the S3 storage service to store a large number of image files, and S3 can also serve as a storage solution for file uploads.
|
||||
|
||||
<Callout type={'info'}>
|
||||
In this article, S3 refers to a compatible S3 storage solution, which supports object storage
|
||||
systems that comply with the Amazon S3 API. Common examples include Cloudflare R2 etc., all of
|
||||
which support S3-compatible APIs.
|
||||
</Callout>
|
||||
|
||||
<Steps>
|
||||
|
||||
### Configure and Obtain S3 Bucket
|
||||
|
||||
You need to go to your S3 service provider (such as AWS S3, Cloudflare R2, etc.) and create a new storage bucket. Below is an example of the creation process using Cloudflare R2.
|
||||
|
||||
The interface of Cloudflare R2 is shown below:
|
||||
|
||||
<Image
|
||||
alt={'Cloudflare R2 Storage Interface'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/41f7f677-0153-4a96-b849-5ac9b7ebefee'}
|
||||
></Image>
|
||||
|
||||
When creating the bucket, specify its name and then click create.
|
||||
|
||||
<Image
|
||||
alt={'Create Bucket in R2'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/9c0d184c-3169-40fa-9115-011cfffb9ca7'}
|
||||
></Image>
|
||||
|
||||
### Obtain Environment Variables for the Bucket
|
||||
|
||||
In the settings of the R2 storage bucket, you can view the bucket configuration information:
|
||||
|
||||
<Image
|
||||
alt={'View Bucket Information'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/2ceb210c-eca0-4439-ba27-8734d4ebb3ee'}
|
||||
></Image>
|
||||
|
||||
The corresponding environment variables are:
|
||||
|
||||
```shell
|
||||
# Bucket name
|
||||
S3_BUCKET=lobechat
|
||||
# Bucket request endpoint(note that the path of this link contains the bucket name, you must remove the path, or use the link provided on the "Apply for S3 API Token" page)
|
||||
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
||||
# Public domain for accessing the bucket
|
||||
NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
|
||||
```
|
||||
|
||||
<Callout type={'warning'}>The path must be removed from the `S3_ENDPOINT`, otherwise, uploaded files will be inaccessible.</Callout>
|
||||
|
||||
### Obtain S3 Key Environment Variables
|
||||
|
||||
You need to obtain the access key for S3 so that the LobeChat server has permission to access the S3 storage service. In R2, you can configure the access key in the account details:
|
||||
|
||||
<Image
|
||||
alt={'View Access Key for Bucket'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/be0c95c0-6693-44ee-a490-7e8dfaa8b34d'}
|
||||
></Image>
|
||||
|
||||
Click the button in the upper right corner to create an API token, then enter the API Token creation page.
|
||||
|
||||
<Image
|
||||
alt={'Create Corresponding API Token'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/7b0ea46c-5157-40a8-888f-f47664a4884f'}
|
||||
></Image>
|
||||
|
||||
Since our server-side database needs to read and write to the S3 storage service, the permission needs to be set to `Administrator Read and Write`. Then, click Create.
|
||||
|
||||
<Callout type={'warning'}>The permission must be set to `Administrator Read and Write`, otherwise, uploading photos and other files will not be possible.</Callout>
|
||||
|
||||
<Image
|
||||
alt={'Configure API Token Permissions'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/d6f5a918-7b50-4d6e-83a6-3894ab930ddf'}
|
||||
></Image>
|
||||
|
||||
After creation, you can see the corresponding S3 API token.
|
||||
|
||||
<Image
|
||||
alt={'Copy API Token'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/763b18f9-2b5f-44bb-a479-9b56d46f7397'}
|
||||
></Image>
|
||||
|
||||
The corresponding environment variables are:
|
||||
|
||||
```shell
|
||||
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
||||
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
||||
```
|
||||
|
||||
### Add the Corresponding Environment Variables in Vercel
|
||||
|
||||
The steps to obtain the required environment variables may vary for different S3 service providers, but the obtained environment variables should be consistent in the end:
|
||||
|
||||
<Callout type={'warning'}>Ensure that the `S3_ENDPOINT` includes the `https://` prefix. Maintaining the integrity of the URL is crucial.</Callout>
|
||||
|
||||
```shell
|
||||
# S3 Key
|
||||
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
||||
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
||||
|
||||
# Bucket name
|
||||
S3_BUCKET=lobechat
|
||||
# Bucket request endpoint
|
||||
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
||||
# Public domain for accessing the bucket
|
||||
NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
|
||||
|
||||
# Bucket region, such as us-west-1, generally not required to add, but some service providers may need to configure
|
||||
# S3_REGION=us-west-1
|
||||
```
|
||||
|
||||
Then enter the above environment variables into Vercel's environment variables:
|
||||
|
||||
<Image
|
||||
alt={'Add S3 Environment Variables in Vercel'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/cd74152d-0ae8-44fd-b815-3307c56a3c18'}
|
||||
></Image>
|
||||
|
||||
### Configure Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
Since S3 storage services are often on a separate domain, cross-origin access needs to be configured.
|
||||
|
||||
In R2, you can find the CORS configuration in the settings of the storage bucket:
|
||||
|
||||
<Image
|
||||
alt={'Cloudflare R2 CORS Settings'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/ab008be7-26b2-4b78-8bd9-24301bf34d23'}
|
||||
></Image>
|
||||
|
||||
Add a CORS rule to allow requests from your domain (in this case, `https://your-project.vercel.app`):
|
||||
|
||||
<Image
|
||||
alt={'Configure Allowed Site Domain'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/dfcc2cb3-2958-4498-a8a4-51bec584fe7d'}
|
||||
></Image>
|
||||
|
||||
Example configuration:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"AllowedOrigins": ["https://your-project.vercel.app"],
|
||||
"AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"],
|
||||
"AllowedHeaders": ["*"]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
After configuration, click save.
|
||||
|
||||
</Steps>
|
||||
|
||||
## 4. Deployment and Verification
|
||||
|
||||
After completing the above steps, the configuration of the server database should be done. Next, we can deploy LobeChat to Vercel and then visit your Vercel link to verify if the server database is working correctly.
|
||||
|
||||
<Steps>
|
||||
### Redeploy the latest commit
|
||||
|
||||
After configuring the environment variables, you need to redeploy the latest commit and wait for the deployment to complete.
|
||||
|
||||
<Image
|
||||
alt={'Redeploy the latest commit'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/b3a78112-adc8-4837-b4e3-48f67058f16e'}
|
||||
></Image>
|
||||
|
||||
### Check if the features are working properly
|
||||
|
||||
If you click on the login button in the top left corner and the login popup appears normally, then you have configured it successfully. Enjoy using it\~
|
||||
|
||||
<Image alt={'User login popup'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/da84edc3-46f7-4e2b-a0cd-dc33a98bf5cb'}>
|
||||
|
||||
</Image>
|
||||
|
||||
<Image alt={'Login success status'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/9cb5150d-6e1e-4c59-9a18-4e418dce1a5d'}>
|
||||
|
||||
</Image>
|
||||
|
||||
</Steps>
|
||||
|
||||
## Appendix
|
||||
|
||||
### Overview of Server Database Environment Variables
|
||||
|
||||
For easy copying, here is a summary of the environment variables required to configure the server database:
|
||||
|
||||
```shell
|
||||
# Specify the service mode as server
|
||||
NEXT_PUBLIC_SERVICE_MODE=server
|
||||
|
||||
# Postgres database URL
|
||||
DATABASE_URL=
|
||||
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
||||
|
||||
# Clerk related configurations
|
||||
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
|
||||
CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
|
||||
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
# S3 related configurations
|
||||
# S3 keys
|
||||
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
||||
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
||||
|
||||
# Bucket name
|
||||
S3_BUCKET=lobechat
|
||||
# Bucket request endpoint
|
||||
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
||||
# Public access domain for the bucket
|
||||
NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
|
||||
# Bucket region, such as us-west-1, generally not needed to add, but some service providers may require configuration
|
||||
# S3_REGION=us-west-1
|
||||
```
|
||||
@@ -0,0 +1,413 @@
|
||||
---
|
||||
title: 使用服务端数据库部署 - 配置 Postgres、Clerk 和 S3 存储服务
|
||||
description: 本文详细介绍如何在 Vercel 中部署服务端数据库版 LobeChat,包括数据库配置、身份验证服务配置和 S3 存储服务的设置步骤。
|
||||
tags:
|
||||
- 服务端数据库
|
||||
- Postgres
|
||||
- Clerk
|
||||
- S3存储服务
|
||||
- Vercel部署
|
||||
- 数据库配置
|
||||
- 身份验证服务
|
||||
- 环境变量配置
|
||||
---
|
||||
|
||||
# 使用服务端数据库部署
|
||||
|
||||
LobeChat 默认使用客户端数据库(IndexedDB),同时也支持使用服务端数据库。LobeChat 采用了 Postgres 作为后端存储数据库。PostgreSQL是一种强大的开源关系型数据库管理系统,具备高度扩展性和标准SQL支持。它提供了丰富的数据类型、并发处理、数据完整性、安全性及可编程性,适用于复杂应用和大规模数据管理。
|
||||
|
||||
本文将详细介绍如何在 Vercel 中部署服务端数据库版 LobeChat,包括: 1)数据库配置;2)身份验证服务配置;3) S3 存储服务的设置步骤。
|
||||
|
||||
<Callout type={'info'}>
|
||||
限于工作量原因,目前仅支持在 Vercel 中部署使用服务端数据库版本,Docker 版本将会在后续迭代中支持。
|
||||
</Callout>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
进行后续操作前,请务必确认以下事项
|
||||
- 导出所有数据,部署服务端数据库后,原有用户数据无法自动迁移,只能提前备份后进行手动导入!
|
||||
- 环境变量中的`ACCESS_CODE`未设置或已清除!
|
||||
- 配置服务端数据库所需要的环境变量时,需全部填入后再进行部署,否则可能遭遇数据库迁移问题!
|
||||
</Callout>
|
||||
|
||||
## 一、 配置数据库
|
||||
|
||||
<Steps>
|
||||
|
||||
### 准备服务端数据库实例,获取连接 URL
|
||||
|
||||
在部署之前,请确保你已经准备好 Postgres 数据库实例,你可以选择以下任一方式:
|
||||
|
||||
- `A.` 使用 Vercel / Neon 等 Serverless Postgres 实例;
|
||||
- `B.` 使用 Docker 等自部署 Postgres 实例。
|
||||
|
||||
两者的配置方式略有不同,在下一步会有所区分。
|
||||
|
||||
### 在 Vercel 中添加环境变量
|
||||
|
||||
在 Vercel 的部署环境变量中,添加 `DATABASE_URL` 等环境变量,将上一步准备好的 Postgres 数据库连接 URL 填入其中。数据库连接 URL 的通常格式为 `postgres://username:password@host:port/database`。
|
||||
|
||||
<Callout type={'warning'}>
|
||||
确认您的供应商所提供的`Postgres`类型,若为`Node Postgres`,则必须添加环境变量`DATABASE_DRIVER=node`
|
||||
</Callout>
|
||||
|
||||
<Tabs items={['Serverless Postgres', 'Node Postgres']}>
|
||||
|
||||
<Tab>
|
||||
|
||||
Serverless Postgres 需要填写的变量如下:
|
||||
|
||||
```shell
|
||||
# Serverless Postgres DB Url
|
||||
DATABASE_URL=
|
||||
|
||||
# 指定 service mode 为 server,否则不会进入服务端数据库
|
||||
NEXT_PUBLIC_SERVICE_MODE=server
|
||||
```
|
||||
|
||||
在 Vercel 中填写的示例如下:
|
||||
|
||||
<Image alt={'添加 Serverless Postgres DATABASE_URL'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/d4a710cd-6404-4196-90d0-cd08ca385074'}></Image>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab>
|
||||
Node Postgres 需要填写的变量如下:
|
||||
|
||||
```shell
|
||||
# Node Postgres DB Url
|
||||
DATABASE_URL=
|
||||
|
||||
# 指定 Postgres database driver 为 node
|
||||
DATABASE_DRIVER=node
|
||||
|
||||
# 指定 service mode 为 server,否则不会进入服务端数据库
|
||||
NEXT_PUBLIC_SERVICE_MODE=server
|
||||
```
|
||||
|
||||
在 Vercel 中填写的示例如下:
|
||||
|
||||
<Image alt={'添加 Node Postgres DATABASE_URL'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/1c689738-809b-4199-b305-ba5770d39da7'}></Image>
|
||||
|
||||
</Tab>
|
||||
|
||||
</Tabs>
|
||||
|
||||
<Callout type={'info'}>
|
||||
如果希望连接数据库时启用 SSL ,请自行参考[链接](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)进行设置
|
||||
</Callout>
|
||||
|
||||
### 添加 `KEY_VAULTS_SECRET` 环境变量
|
||||
|
||||
在完成数据库 DATABASE_URL 环境变量添加后,需要添加一个 `KEY_VAULTS_SECRET` 环境变量。该变量用于加密用户存储的 apikey 等敏感信息。你可以使用 `openssl rand -base64 32` 生成一个随机的 32 位字符串作为密钥。
|
||||
|
||||
```shell
|
||||
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
||||
```
|
||||
|
||||
同样需要将其添加到 Vercel 环境变量中。
|
||||
|
||||
</Steps>
|
||||
|
||||
## 二、 配置身份验证服务
|
||||
|
||||
服务端数据库需要搭配用户身份验证服务才可以正常使用。因此需要配置对应的身份验证服务。
|
||||
|
||||
<Callout type={'warning'}>
|
||||
同样由于工作量原因,目前仅支持 Clerk 作为身份验证服务方案, Next-Auth 的服务端数据库集成有待开发
|
||||
</Callout>
|
||||
|
||||
<Steps>
|
||||
|
||||
### 准备 Clerk 身份验证服务
|
||||
|
||||
前往 [Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) 注册并创建应用,获取相应的 Public Key 和 Secret Key。
|
||||
|
||||
<Callout type={'info'}>
|
||||
如果对 Clerk 不太了解,可以查阅
|
||||
[身份验证服务-Clerk](/zh/docs/self-hosting/advanced/authentication#clerk) 了解 Clerk 的使用详情。
|
||||
</Callout>
|
||||
|
||||
### 在 Vercel 中添加公、私钥环境变量
|
||||
|
||||
在 Vercel 的部署环境变量中,添加 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY` 环境变量。你可以在菜单中点击「API Keys」,然后复制对应的值填入 Vercel 的环境变量中。
|
||||
|
||||
<Image
|
||||
alt={'在 Clerk 中找到对应的公私钥环境变量'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/89883703-7a1a-4a11-b944-5d804544e57c'}
|
||||
></Image>
|
||||
|
||||
此步骤所需的环境变量如下:
|
||||
|
||||
```shell
|
||||
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
|
||||
CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
添加上述变量到 Vercel 中:
|
||||
|
||||
<Image
|
||||
alt={'在 Vercel 中添加 Clerk 公私钥环境变量'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/2bfa13df-6e20-4768-97c0-4dad06c85a2f'}
|
||||
></Image>
|
||||
|
||||
### 在 Clerk 中创建并配置 Webhook
|
||||
|
||||
由于我们让 Clerk 完全接管用户鉴权与管理,因此我们需要在 Clerk 用户生命周期变更时(创建、更新、删除)中通知我们的应用并存储落库。我们通过 Clerk 提供的 Webhook 来实现这一诉求。
|
||||
|
||||
我们需要在 Clerk 的 Webhooks 中添加一个端点(Endpoint),告诉 Clerk 当用户发生变更时,向这个端点发送通知。
|
||||
|
||||
<Image
|
||||
alt={'Clerk 添加 Webhooks 端点'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/f50f47fb-5e8e-4930-bf4e-8cf6f5b8afb9'}
|
||||
></Image>
|
||||
|
||||
在 endppint 中填写你的 Vercel 项目的 URL,如 `https://your-project.vercel.app/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。
|
||||
|
||||
<Callout type={'warning'}>URL的`https://`不可缺失,须保持URL的完整性</Callout>
|
||||
|
||||
<Image
|
||||
alt={'添加 Clerk Webhooks 时,配置 URL 和用户事件'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/0249ea56-ab17-4aa9-a56c-9ebd556c2645'}
|
||||
></Image>
|
||||
|
||||
### 将 Webhook 秘钥添加到 Vercel 环境变量
|
||||
|
||||
创建完毕后,可以在右下角找到该 Webhook 的秘钥:
|
||||
|
||||
<Image
|
||||
alt={'查看 Clerk Webhooks 秘钥'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'}
|
||||
></Image>
|
||||
|
||||
这个秘钥所对应的环境变量名为 `CLERK_WEBHOOK_SECRET`:
|
||||
|
||||
```shell
|
||||
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
将其添加到 Vercel 的环境变量中:
|
||||
|
||||
<Image
|
||||
alt={'在 Vercel 中 添加 Clerk Webhooks 秘钥'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/5fdc9479-007f-46ab-9d6e-a9603e949116'}
|
||||
></Image>
|
||||
|
||||
</Steps>
|
||||
|
||||
这样,你已经成功配置了 Clerk 身份验证服务。接下来我们将配置 S3 存储服务。
|
||||
|
||||
## 三、 配置 S3 存储服务
|
||||
|
||||
LobeChat 在很早以前就支持了多模态 的 AI 会话,其中涉及到图片上传给 AI 的功能。在客户端数据库方案中,图片文件直接以二进制数据存储在浏览器 indexedDB 数据库,但在服务端数据库中这个方案并不可行。我们需要配置 S3 存储服务来存储大量的图片文件,同时 S3 也可以作为文件上传的存储方案。
|
||||
|
||||
<Callout type={'info'}>
|
||||
在本文,S3所指代的是指兼容 S3 存储方案,即支持 Amazon S3 API 的对象存储系统,常见例如 Cloudflare
|
||||
R2 、阿里云 OSS 等均支持 S3 兼容 API。
|
||||
</Callout>
|
||||
|
||||
<Steps>
|
||||
|
||||
### 配置并获取 S3 存储桶
|
||||
|
||||
你需要前往你的 S3 服务提供商(如 AWS S3、Cloudflare R2 等)并创建一个新的存储桶(Bucket)。接下来以 Cloudflare R2 为例,介绍创建流程。
|
||||
|
||||
下图是 Cloudflare R2 的界面:
|
||||
|
||||
<Image
|
||||
alt={'Cloudflare R2 存储界面'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/41f7f677-0153-4a96-b849-5ac9b7ebefee'}
|
||||
></Image>
|
||||
|
||||
创建存储桶时将指定其名称,然后点击创建。
|
||||
<Image
|
||||
alt={'R2 创建存储桶'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/9c0d184c-3169-40fa-9115-011cfffb9ca7'}
|
||||
></Image>
|
||||
|
||||
### 获取存储桶相关环境变量
|
||||
|
||||
在 R2 存储桶的设置中,可以看到桶配置的信息:
|
||||
|
||||
<Image
|
||||
alt={'查看存储桶的相关信息'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/2ceb210c-eca0-4439-ba27-8734d4ebb3ee'}
|
||||
></Image>
|
||||
|
||||
其对应的环境变量为:
|
||||
|
||||
```shell
|
||||
# 存储桶的名称
|
||||
S3_BUCKET=lobechat
|
||||
# 存储桶的请求端点(注意此处链接的路径带存储桶名称,必须删除该路径,或使用申请 S3 API token 页面所提供的链接)
|
||||
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
||||
# 存储桶对外的访问域名
|
||||
NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
|
||||
```
|
||||
|
||||
<Callout type={'warning'}>`S3_ENDPOINT`必须删除其路径,否则会无法访问所上传文件</Callout>
|
||||
|
||||
### 获取 S3 密钥环境变量
|
||||
|
||||
你需要获取 S3 的访问密钥,以便 LobeChat 的服务端有权限访问 S3 存储服务。在 R2 中,你可以在账户详情中配置访问密钥:
|
||||
|
||||
<Image
|
||||
alt={'查看存储桶的访问秘钥'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/be0c95c0-6693-44ee-a490-7e8dfaa8b34d'}
|
||||
></Image>
|
||||
|
||||
点击右上角按钮创建 API token,进入创建 API Token 页面
|
||||
|
||||
<Image
|
||||
alt={'创建对应 API token'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/7b0ea46c-5157-40a8-888f-f47664a4884f'}
|
||||
></Image>
|
||||
|
||||
鉴于我们的服务端数据库需要读写 S3 存储服务,因此权限需要选择`管理员读与写`,然后点击创建。
|
||||
|
||||
<Callout type={'warning'}>权限必须为`管理员读与写`,否则无法上传照片等其它文件</Callout>
|
||||
|
||||
<Image
|
||||
alt={'配置 API token 权限'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/d6f5a918-7b50-4d6e-83a6-3894ab930ddf'}
|
||||
></Image>
|
||||
|
||||
创建完成后,就可以看到对应的 S3 API token
|
||||
|
||||
<Image
|
||||
alt={'复制 API token'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/763b18f9-2b5f-44bb-a479-9b56d46f7397'}
|
||||
></Image>
|
||||
|
||||
其对应的环境变量为:
|
||||
|
||||
```shell
|
||||
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
||||
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
||||
```
|
||||
|
||||
### 在 Vercel 中添加对应的环境变量
|
||||
|
||||
不同 S3 服务商获取所需环境变量的步骤可能有所不同,但最终获得到的环境变量应该都是一致的:
|
||||
|
||||
<Callout type={'warning'}>URL的`https://`不可缺失,须保持URL的完整性</Callout>
|
||||
|
||||
```shell
|
||||
# S3 秘钥
|
||||
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
||||
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
||||
|
||||
# 存储桶的名称
|
||||
S3_BUCKET=lobechat
|
||||
# 存储桶的请求端点
|
||||
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
||||
# 存储桶对外的访问域名
|
||||
NEXT_PUBLIC_S3_DOMAIN=https://s3-dev.your-domain.com
|
||||
|
||||
# 桶的区域,如 us-west-1,一般来说不需要添加,但某些服务商则需要配置
|
||||
# S3_REGION=us-west-1
|
||||
```
|
||||
|
||||
然后将上述环境变量填入 Vercel 的环境变量中:
|
||||
|
||||
<Image
|
||||
alt={'在 Vercel 中添加 S3 的环境变量'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/cd74152d-0ae8-44fd-b815-3307c56a3c18'}
|
||||
></Image>
|
||||
|
||||
### 配置跨域
|
||||
|
||||
由于 S3 存储服务往往是一个独立的网址,因此需要配置跨域访问。
|
||||
|
||||
在 R2 中,你可以在存储桶的设置中找到跨域配置:
|
||||
|
||||
<Image
|
||||
alt={'Cloudflare R2 的跨域设置'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/ab008be7-26b2-4b78-8bd9-24301bf34d23'}
|
||||
></Image>
|
||||
|
||||
添加跨域规则,允许你的域名(在上文是 `https://your-project.vercel.app`)来源的请求:
|
||||
|
||||
<Image
|
||||
alt={'配置允许你的站点域名'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/dfcc2cb3-2958-4498-a8a4-51bec584fe7d'}
|
||||
></Image>
|
||||
|
||||
示例配置如下:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"AllowedOrigins": ["https://your-project.vercel.app"],
|
||||
"AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"],
|
||||
"AllowedHeaders": ["*"]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
配置后点击保存即可。
|
||||
|
||||
</Steps>
|
||||
|
||||
## 四、部署并验证
|
||||
|
||||
通过上述步骤之后,我们应该就完成了服务端数据库的配置。接下来我们可以将 LobeChat 部署到 Vercel 上,然后访问你的 Vercel 链接,验证服务端数据库是否正常工作。
|
||||
|
||||
<Steps>
|
||||
### 重新部署最新的 commit
|
||||
|
||||
配置好环境变量后,你需要重新部署最新的 commit,并等待部署完成。
|
||||
|
||||
<Image
|
||||
alt={'重新部署最新的 commit'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/b3a78112-adc8-4837-b4e3-48f67058f16e'}
|
||||
></Image>
|
||||
|
||||
### 检查功能是否正常
|
||||
|
||||
如果你点击左上角登录,可以正常显示登录弹窗,那么说明你已经配置成功了,尽情享用吧~
|
||||
|
||||
<Image
|
||||
alt={'用户登录弹窗'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/da84edc3-46f7-4e2b-a0cd-dc33a98bf5cb'}
|
||||
></Image>
|
||||
|
||||
<Image
|
||||
alt={'登录成功状态'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/9cb5150d-6e1e-4c59-9a18-4e418dce1a5d'}
|
||||
></Image>
|
||||
|
||||
</Steps>
|
||||
|
||||
## 附录
|
||||
|
||||
### 服务端数据库环境变量一览
|
||||
|
||||
为方便一键复制,在此汇总配置服务端数据库所需要的环境变量:
|
||||
|
||||
```shell
|
||||
# 指定服务模式为 server
|
||||
NEXT_PUBLIC_SERVICE_MODE=server
|
||||
|
||||
# Postgres 数据库 URL
|
||||
DATABASE_URL=
|
||||
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
||||
|
||||
# Clerk 相关配置
|
||||
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
|
||||
CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
|
||||
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
# S3 相关配置
|
||||
# S3 秘钥
|
||||
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
||||
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
||||
|
||||
# 存储桶的名称
|
||||
S3_BUCKET=lobechat
|
||||
# 存储桶的请求端点
|
||||
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
||||
# 存储桶对外的访问域名
|
||||
NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
|
||||
# 桶的区域,如 us-west-1,一般来说不需要添加,但某些服务商则需要配置
|
||||
# S3_REGION=us-west-1
|
||||
```
|
||||
@@ -1,9 +1,25 @@
|
||||
# Share settings via URL
|
||||
---
|
||||
title: Share Settings via URL - Import and Export Configuration Settings
|
||||
description: >-
|
||||
Learn how to import and export configuration settings for LobeChat via URL.
|
||||
Understand the supported settings, URL format, and parameter schema for
|
||||
keyVaults and languageModel.
|
||||
tags:
|
||||
- Share Settings
|
||||
- URL Import
|
||||
- URL Export
|
||||
- Configuration Settings
|
||||
- LobeChat
|
||||
- Parameter Schema
|
||||
---
|
||||
|
||||
# Share settings via URL
|
||||
|
||||
LobeChat support import settings from external URL to quickly set up LobeChat configuration.
|
||||
|
||||
The currently supported settings are:
|
||||
|
||||
- `keyVaults`: provider api key and baseURL settings
|
||||
- `languageModel`: Language model settings
|
||||
|
||||
## Import from URL
|
||||
@@ -12,18 +28,18 @@ Use the following URL format to import settings parameters from an external URL:
|
||||
|
||||
```plaintext
|
||||
https://lobehub.com/?settings=<settings object in JSON format>
|
||||
https://lobehub.com/?settings={"languageModel":{"openai":{"apiKey":"user-key","endpoint":"https://lobehub.com/v1"}}}
|
||||
https://lobehub.com/?settings={"keyVaults":{"openai":{"apiKey":"user-key","baseURL":"https://your-proxy.com/v1"}}}
|
||||
```
|
||||
|
||||
Example of settings in JSON format:
|
||||
|
||||
```json
|
||||
{
|
||||
"languageModel": {
|
||||
"openai": {
|
||||
"apiKey": "user-key"
|
||||
}
|
||||
"keyVaults": {
|
||||
"openai": {
|
||||
"apiKey": "user-key"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -32,69 +48,100 @@ Example of settings in JSON format:
|
||||
```ts
|
||||
// Generate settings to export to URL
|
||||
const settings = {
|
||||
languageModel: {
|
||||
keyVaults: {
|
||||
openai: {
|
||||
apiKey: 'user-key',
|
||||
endpoint: 'https://lobehub.com/v1'
|
||||
apiKey: 'user-key',
|
||||
baseURL: 'https://your-proxy.com/v1',
|
||||
},
|
||||
}};
|
||||
},
|
||||
};
|
||||
// Convert settings to a JSON formatted string
|
||||
const url = `/?settings=${JSON.stringify(settings)}`;
|
||||
console.log(url);
|
||||
// /?settings={"languageModel":{"openai":{"apiKey":"user-key","endpoint":"https://lobehub.com/v1"}}}
|
||||
console.log(url);
|
||||
// /?settings={"keyVaults":{"openai":{"apiKey":"user-key","baseURL":"https://your-proxy.com/v1"}}}
|
||||
```
|
||||
|
||||
<Callout type={'warning'}>
|
||||
LobeChat does not verify the correctness of the settings parameters in the URL, nor provide encryption or decryption methods. Please use with caution.
|
||||
LobeChat does not verify the correctness of the settings parameters in the URL, nor provide
|
||||
encryption or decryption methods. Please use with caution.
|
||||
</Callout>
|
||||
|
||||
## Parameter schema
|
||||
|
||||
### languageModel
|
||||
### keyVaults
|
||||
|
||||
- Property name and type
|
||||
|
||||
| Property name | Type |
|
||||
|---------------|--------------------------------|
|
||||
| anthropic | GeneralModelProviderConfig |
|
||||
| azure | AzureOpenAIConfig |
|
||||
| bedrock | AWSBedrockConfig |
|
||||
| google | GeneralModelProviderConfig |
|
||||
| groq | GeneralModelProviderConfig |
|
||||
| minimax | GeneralModelProviderConfig |
|
||||
| mistral | GeneralModelProviderConfig |
|
||||
| moonshot | GeneralModelProviderConfig |
|
||||
| ollama | GeneralModelProviderConfig |
|
||||
| openai | GeneralModelProviderConfig |
|
||||
| openrouter | GeneralModelProviderConfig |
|
||||
| perplexity | GeneralModelProviderConfig |
|
||||
| togetherai | GeneralModelProviderConfig |
|
||||
| zeroone | GeneralModelProviderConfig |
|
||||
| zhipu | GeneralModelProviderConfig |
|
||||
| Property name | Type |
|
||||
| ------------- | -------------------------- |
|
||||
| anthropic | `OpenAICompatibleKeyVault` |
|
||||
| azure | `AzureOpenAIKeyVault` |
|
||||
| bedrock | `AWSBedrockKeyVault` |
|
||||
| google | `OpenAICompatibleKeyVault` |
|
||||
| groq | `OpenAICompatibleKeyVault` |
|
||||
| minimax | `OpenAICompatibleKeyVault` |
|
||||
| mistral | `OpenAICompatibleKeyVault` |
|
||||
| moonshot | `OpenAICompatibleKeyVault` |
|
||||
| ollama | `OpenAICompatibleKeyVault` |
|
||||
| openai | `OpenAICompatibleKeyVault` |
|
||||
| openrouter | `OpenAICompatibleKeyVault` |
|
||||
| perplexity | `OpenAICompatibleKeyVault` |
|
||||
| togetherai | `OpenAICompatibleKeyVault` |
|
||||
| zeroone | `OpenAICompatibleKeyVault` |
|
||||
| zhipu | `OpenAICompatibleKeyVault` |
|
||||
|
||||
- Type `GeneralModelProviderConfig`
|
||||
- Type `OpenAICompatibleKeyVault`
|
||||
|
||||
| Property name | Type | Description |
|
||||
|-----------------------|--------------------------|-----------------------------------------------------------------------------|
|
||||
| apiKey | string | The API key for the model provider. |
|
||||
| autoFetchModelLists | boolean | Whether to automatically fetch model lists. |
|
||||
| enabled | boolean | Whether the model provider is enabled. |
|
||||
| enabledModels | string[] | null | The IDs of the enabled models. |
|
||||
| endpoint | string | The endpoint for the model provider. |
|
||||
| fetchOnClient | boolean | Whether to fetch on the client. |
|
||||
| Property name | Type | Description |
|
||||
| ------------- | ------ | ------------------------------------ |
|
||||
| apiKey | string | The API key for the model provider. |
|
||||
| baseURL | string | The endpoint for the model provider. |
|
||||
|
||||
- Type `AzureOpenAIConfig`
|
||||
> Inherits the fields from `GeneralModelProviderConfig`
|
||||
- Type `AzureOpenAIKeyVault`
|
||||
|
||||
| Property name | Type | Description |
|
||||
|-----------------------|--------------------------|-----------------------------------------------------------------------------|
|
||||
| apiVersion | string | The API version for Azure OpenAI. |
|
||||
| Property name | Type | Description |
|
||||
| ------------- | ------ | ------------------------------------ |
|
||||
| apiVersion | string | The API version for Azure OpenAI. |
|
||||
| apiKey | string | The API key for the model provider. |
|
||||
| endpoint | string | The endpoint for the model provider. |
|
||||
|
||||
- Type `AWSBedrockConfig`
|
||||
> Inherits all fields from `GeneralModelProviderConfig` except `apiKey, endpoint`
|
||||
- Type `AWSBedrockKeyVault`
|
||||
|
||||
| Property name | Type | Description |
|
||||
| accessKeyId | string | The access key ID for AWS Bedrock. |
|
||||
| region | string | The region for AWS Bedrock. |
|
||||
| secretAccessKey | string | The secret access key for AWS Bedrock. |
|
||||
| Property name | Type | Description |
|
||||
| --------------- | ------ | -------------------------------------- |
|
||||
| accessKeyId | string | The access key ID for AWS Bedrock. |
|
||||
| region | string | The region for AWS Bedrock. |
|
||||
| secretAccessKey | string | The secret access key for AWS Bedrock. |
|
||||
|
||||
### languageModel
|
||||
|
||||
```ts
|
||||
export type UserModelProviderConfig = Record<string, ProviderConfig>;
|
||||
```
|
||||
|
||||
| Property name | Type |
|
||||
| ------------- | ---------------- |
|
||||
| anthropic | `ProviderConfig` |
|
||||
| azure | `ProviderConfig` |
|
||||
| bedrock | `ProviderConfig` |
|
||||
| google | `ProviderConfig` |
|
||||
| groq | `ProviderConfig` |
|
||||
| minimax | `ProviderConfig` |
|
||||
| mistral | `ProviderConfig` |
|
||||
| moonshot | `ProviderConfig` |
|
||||
| ollama | `ProviderConfig` |
|
||||
| openai | `ProviderConfig` |
|
||||
| openrouter | `ProviderConfig` |
|
||||
| perplexity | `ProviderConfig` |
|
||||
| togetherai | `ProviderConfig` |
|
||||
| zeroone | `ProviderConfig` |
|
||||
| zhipu | `ProviderConfig` |
|
||||
|
||||
- Type `ProviderConfig`
|
||||
|
||||
| Property name | Type | Description |
|
||||
| ------------------- | -------- | ------------------------------------------- | ------------------------------ |
|
||||
| autoFetchModelLists | boolean | Whether to automatically fetch model lists. |
|
||||
| enabled | boolean | Whether the model provider is enabled. |
|
||||
| enabledModels | string[] | null | The IDs of the enabled models. |
|
||||
| fetchOnClient | boolean | Whether to fetch on the client. |
|
||||
|
||||
@@ -1,10 +1,25 @@
|
||||
---
|
||||
title: URL 分享设置参数 - LobeChat 配置快速设置
|
||||
description: 了解如何从外部 URL 导入和导出 LobeChat 的设置参数,包括 keyVaults 和 languageModel,以及参数格式和类型。
|
||||
tags:
|
||||
- URL 分享
|
||||
- 设置参数
|
||||
- LobeChat
|
||||
- keyVaults
|
||||
- languageModel
|
||||
- JSON 格式
|
||||
- URL 导入
|
||||
- URL 导出
|
||||
---
|
||||
|
||||
# URL 分享设置参数
|
||||
|
||||
LobeChat 支持从外部 URL 导入设置参数,以便于快速设置 LobeChat 的配置。
|
||||
|
||||
目前支持的设置项有:
|
||||
|
||||
- `languageModel`:语言模型设置
|
||||
- `keyVaults`: 模型供应商相关秘钥设置
|
||||
- `languageModel`:语言模型设置
|
||||
|
||||
## 从 URL 中导入
|
||||
|
||||
@@ -12,18 +27,18 @@ LobeChat 支持从外部 URL 导入设置参数,以便于快速设置 LobeChat
|
||||
|
||||
```plaintext
|
||||
https://lobehub.com/?settings=<JSON格式的设置对象>
|
||||
https://lobehub.com/?settings={"languageModel":{"openai":{"apiKey":"user-key","endpoint":"https://lobehub.com/v1"}}}
|
||||
https://lobehub.com/?settings={"keyVaults":{"openai":{"apiKey":"user-key","baseURL":"https://your-proxy.com/v1"}}}
|
||||
```
|
||||
|
||||
JSON格式的设置示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"languageModel": {
|
||||
"openai": {
|
||||
"apiKey": "user-key"
|
||||
}
|
||||
"keyVaults": {
|
||||
"openai": {
|
||||
"apiKey": "user-key"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -32,69 +47,99 @@ JSON格式的设置示例:
|
||||
```ts
|
||||
// 生成要导出到 URL 的设置
|
||||
const settings = {
|
||||
languageModel: {
|
||||
keyVaults: {
|
||||
openai: {
|
||||
apiKey: 'user-key',
|
||||
endpoint: 'https://lobehub.com/v1'
|
||||
apiKey: 'user-key',
|
||||
baseURL: 'https://your-proxy.com/v1',
|
||||
},
|
||||
}};
|
||||
// 将设置转为 JSON 格式的字符串
|
||||
},
|
||||
};
|
||||
// Convert settings to a JSON formatted string
|
||||
const url = `/?settings=${JSON.stringify(settings)}`;
|
||||
console.log(url);
|
||||
// /?settings={"languageModel":{"openai":{"apiKey":"user-key","endpoint":"https://lobehub.com/v1"}}}
|
||||
console.log(url);
|
||||
// /?settings={"keyVaults":{"openai":{"apiKey":"user-key","baseURL":"https://your-proxy.com/v1"}}}
|
||||
```
|
||||
|
||||
<Callout type={'warning'}>
|
||||
LobeChat 不对 URL 中的设置参数进行正确性校验,也不提供加密、解密方法,请谨慎使用。
|
||||
LobeChat 不对 URL 中的设置参数进行正确性校验,也不提供 URL 的加密、解密方法,请谨慎使用。
|
||||
</Callout>
|
||||
|
||||
## 参数格式
|
||||
|
||||
### languageModel
|
||||
### keyVaults
|
||||
|
||||
- 参数及其类型
|
||||
|
||||
| 参数名称 | 类型 |
|
||||
|---------------|--------------------------------|
|
||||
| anthropic | GeneralModelProviderConfig |
|
||||
| azure | AzureOpenAIConfig |
|
||||
| bedrock | AWSBedrockConfig |
|
||||
| google | GeneralModelProviderConfig |
|
||||
| groq | GeneralModelProviderConfig |
|
||||
| minimax | GeneralModelProviderConfig |
|
||||
| mistral | GeneralModelProviderConfig |
|
||||
| moonshot | GeneralModelProviderConfig |
|
||||
| ollama | GeneralModelProviderConfig |
|
||||
| openai | GeneralModelProviderConfig |
|
||||
| openrouter | GeneralModelProviderConfig |
|
||||
| perplexity | GeneralModelProviderConfig |
|
||||
| togetherai | GeneralModelProviderConfig |
|
||||
| zeroone | GeneralModelProviderConfig |
|
||||
| zhipu | GeneralModelProviderConfig |
|
||||
| 参数名称 | 类型 |
|
||||
| ---------- | -------------------------- |
|
||||
| anthropic | `OpenAICompatibleKeyVault` |
|
||||
| azure | `AzureOpenAIKeyVault` |
|
||||
| bedrock | `AWSBedrockKeyVault` |
|
||||
| google | `OpenAICompatibleKeyVault` |
|
||||
| groq | `OpenAICompatibleKeyVault` |
|
||||
| minimax | `OpenAICompatibleKeyVault` |
|
||||
| mistral | `OpenAICompatibleKeyVault` |
|
||||
| moonshot | `OpenAICompatibleKeyVault` |
|
||||
| ollama | `OpenAICompatibleKeyVault` |
|
||||
| openai | `OpenAICompatibleKeyVault` |
|
||||
| openrouter | `OpenAICompatibleKeyVault` |
|
||||
| perplexity | `OpenAICompatibleKeyVault` |
|
||||
| togetherai | `OpenAICompatibleKeyVault` |
|
||||
| zeroone | `OpenAICompatibleKeyVault` |
|
||||
| zhipu | `OpenAICompatibleKeyVault` |
|
||||
|
||||
- 类型 `GeneralModelProviderConfig`
|
||||
- Type `OpenAICompatibleKeyVault`
|
||||
|
||||
| 参数 | TS 类型 | 描述 |
|
||||
|-----------------------|--------------------------|-----------------------------------------------------------------------------|
|
||||
| apiKey | string | 模型的 API 密钥。 |
|
||||
| autoFetchModelLists | boolean | 是否自动获取模型列表。 |
|
||||
| enabled | boolean | 是否启用该模型。 |
|
||||
| enabledModels | string[] | 启用的模型的 ID。 |
|
||||
| endpoint | string | 模型API端点。 |
|
||||
| fetchOnClient | boolean | 是否在客户端发起请求,默认在服务端发起请求。 |
|
||||
| 参数 | 类型 | 描述 |
|
||||
| ------- | ------ | ----------------- |
|
||||
| apiKey | string | 模型的 API 密钥。 |
|
||||
| baseURL | string | 模型API端点。 |
|
||||
|
||||
- 类型 `AzureOpenAIConfig`
|
||||
> 继承 `GeneralModelProviderConfig` 中的字段
|
||||
- Type `AzureOpenAIKeyVault`
|
||||
|
||||
| 参数 | TS 类型 | 描述 |
|
||||
|-----------------------|--------------------------|-----------------------------------------------------------------------------|
|
||||
| 参数 | 类型 | 描述 |
|
||||
| ---------- | ------ | -------------------------- |
|
||||
| apiVersion | string | Azure OpenAI 的 API 版本。 |
|
||||
| apiKey | string | 模型的 API 密钥。 |
|
||||
| baseURL | string | 模型API端点。 |
|
||||
|
||||
- 类型 `AWSBedrockConfig`
|
||||
> 继承 `GeneralModelProviderConfig` 中除 `apiKey, endpoint` 外的所有字段
|
||||
- Type `AWSBedrockKeyVault`
|
||||
|
||||
| 参数 | TS 类型 | 描述 |
|
||||
|-----------------------|--------------------------|-----------------------------------------------------------------------------|
|
||||
| accessKeyId | string | AWS Bedrock 的访问密钥 ID。 |
|
||||
| region | string | AWS Bedrock 的区域。 |
|
||||
| secretAccessKey | string | AWS Bedrock 的访问密钥。 |
|
||||
| 参数 | 类型 | 描述 |
|
||||
| --------------- | ------ | --------------------------- |
|
||||
| accessKeyId | string | AWS Bedrock 的访问密钥 ID。 |
|
||||
| region | string | AWS Bedrock 的区域。 |
|
||||
| secretAccessKey | string | AWS Bedrock 的访问密钥。 |
|
||||
|
||||
### languageModel
|
||||
|
||||
```ts
|
||||
export type UserModelProviderConfig = Record<string, ProviderConfig>;
|
||||
```
|
||||
|
||||
| 参数名称 | 类型 |
|
||||
| ---------- | ---------------- |
|
||||
| anthropic | `ProviderConfig` |
|
||||
| azure | `ProviderConfig` |
|
||||
| bedrock | `ProviderConfig` |
|
||||
| google | `ProviderConfig` |
|
||||
| groq | `ProviderConfig` |
|
||||
| minimax | `ProviderConfig` |
|
||||
| mistral | `ProviderConfig` |
|
||||
| moonshot | `ProviderConfig` |
|
||||
| ollama | `ProviderConfig` |
|
||||
| openai | `ProviderConfig` |
|
||||
| openrouter | `ProviderConfig` |
|
||||
| perplexity | `ProviderConfig` |
|
||||
| togetherai | `ProviderConfig` |
|
||||
| zeroone | `ProviderConfig` |
|
||||
| zhipu | `ProviderConfig` |
|
||||
|
||||
- 类型 `ProviderConfig`
|
||||
|
||||
| 参数 | TS 类型 | 描述 |
|
||||
| ------------------- | -------- | -------------------------------------------- |
|
||||
| autoFetchModelLists | boolean | 是否自动获取模型列表。 |
|
||||
| enabled | boolean | 是否启用该模型。 |
|
||||
| enabledModels | string[] | 启用的模型的 ID。 |
|
||||
| fetchOnClient | boolean | 是否在客户端发起请求,默认在服务端发起请求。 |
|
||||
|
||||
@@ -76,9 +76,8 @@ When deploying LobeChat, you need to configure the following environment variabl
|
||||
|
||||
| Environment Variable | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `ENABLE_OAUTH_SSO` | Required | Enable single sign-on (SSO) for LobeChat. Set to `1` to enable single sign-on. |
|
||||
| `NEXTAUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | Optional | Select the single sign-on provider for LoboChat. Use `auth0` for Auth0. |
|
||||
| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | Optional | Select the single sign-on provider for LoboChat. Use `auth0` for Auth0. |
|
||||
| `AUTH0_CLIENT_ID` | Required | Client ID of the Auth0 application |
|
||||
| `AUTH0_CLIENT_SECRET` | Required | Client Secret of the Auth0 application |
|
||||
| `AUTH0_ISSUER` | Required | Domain of the Auth0 application, `https://example.auth0.com` |
|
||||
|
||||
@@ -71,9 +71,8 @@ http(s)://your-domain/api/auth/callback/auth0
|
||||
|
||||
| 环境变量 | 类型 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 |
|
||||
| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Auth0 请填写 `auth0`。 |
|
||||
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Auth0 请填写 `auth0`。 |
|
||||
| `AUTH0_CLIENT_ID` | 必选 | Auth0 应用程序的 Client ID |
|
||||
| `AUTH0_CLIENT_SECRET` | 必选 | Auth0 应用程序的 Client Secret |
|
||||
| `AUTH0_ISSUER` | 必选 | Auth0 应用程序的 Domain,`https://example.auth0.com` |
|
||||
|
||||
@@ -54,9 +54,8 @@ When deploying LobeChat, you need to configure the following environment variabl
|
||||
|
||||
| Environment Variable | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `ENABLE_OAUTH_SSO` | Required | Enable Single Sign-On (SSO) for LobeChat. Set to `1` to enable SSO. |
|
||||
| `NEXTAUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `authentik` for Authentik. |
|
||||
| `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `authentik` for Authentik. |
|
||||
| `AUTHENTIK_CLIENT_ID` | Required | The Client ID from the Authentik application provider details page |
|
||||
| `AUTHENTIK_CLIENT_SECRET` | Required | The Client Secret from the Authentik application provider details page |
|
||||
| `AUTHENTIK_ISSUER` | Required | The OpenID Configuration Issuer from the Authentik application provider details page |
|
||||
|
||||
@@ -49,9 +49,8 @@ https://your-domain/api/auth/callback/authentik
|
||||
|
||||
| 环境变量 | 类型 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 |
|
||||
| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Authentik 请填写 `authentik`。 |
|
||||
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Authentik 请填写 `authentik`。 |
|
||||
| `AUTHENTIK_CLIENT_ID` | 必选 | Authentik 提供程序详情页的 客户端 ID |
|
||||
| `AUTHENTIK_CLIENT_SECRET` | 必选 | Authentik 提供程序详情页的 客户端 Secret |
|
||||
| `AUTHENTIK_ISSUER` | 必选 | Authentik 提供程序详情页的 OpenID 配置颁发者 |
|
||||
|
||||
@@ -82,9 +82,8 @@ When deploying LobeChat, you need to configure the following environment variabl
|
||||
|
||||
| Environment Variable | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `ENABLE_OAUTH_SSO` | Required | Enable Single Sign-On (SSO) for LobeChat. Set to `1` to enable SSO. |
|
||||
| `NEXTAUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the command: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | Required | Select the Single Sign-On provider for LobeChat. Use `github` for Github. |
|
||||
| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the command: `openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the Single Sign-On provider for LobeChat. Use `github` for Github. |
|
||||
| `GITHUB_CLIENT_ID` | Required | Client ID in the Github App details page. |
|
||||
| `GITHUB_CLIENT_SECRET` | Required | Client Secret in the Github App details page. |
|
||||
| `ACCESS_CODE` | Required | Add a password for accessing this service. You can set a long random password to "disable" access code authorization. |
|
||||
|
||||
@@ -78,9 +78,8 @@ tags:
|
||||
|
||||
| 环境变量 | 类型 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 |
|
||||
| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 |
|
||||
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 |
|
||||
| `GITHUB_CLIENT_ID` | 必选 | Github App详情页的 客户端 ID |
|
||||
| `GITHUB_CLIENT_SECRET` | 必选 | Github App详情页的 客户端 Secret |
|
||||
| `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个足够长的随机密码以 “禁用” 访问码授权 |
|
||||
|
||||
@@ -71,9 +71,8 @@ When deploying LobeChat, you need to configure the following environment variabl
|
||||
|
||||
| Environment Variable | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `ENABLE_OAUTH_SSO` | Required | Enable single sign-on (SSO) for LobeChat. Set to `1` to enable single sign-on. |
|
||||
| `NEXTAUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the following command: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `azure-ad` for Microsoft Entra ID. |
|
||||
| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the following command: `openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `azure-ad` for Microsoft Entra ID. |
|
||||
| `AZURE_AD_CLIENT_ID` | Required | Client ID of the Microsoft Entra ID application. |
|
||||
| `AZURE_AD_CLIENT_SECRET` | Required | Client Secret of the Microsoft Entra ID application. |
|
||||
| `AZURE_AD_TENANT_ID` | Required | Tenant ID of the Microsoft Entra ID application. |
|
||||
|
||||
@@ -68,9 +68,8 @@ https://your-domain/api/auth/callback/azure-ad
|
||||
|
||||
| 环境变量 | 类型 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 |
|
||||
| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Microsoft Entra ID 请填写 `azure-ad`。 |
|
||||
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Microsoft Entra ID 请填写 `azure-ad`。 |
|
||||
| `AZURE_AD_CLIENT_ID` | 必选 | Microsoft Entra ID 应用程序的 Client ID |
|
||||
| `AZURE_AD_CLIENT_SECRET` | 必选 | Microsoft Entra ID 应用程序的 Client Secret |
|
||||
| `AZURE_AD_TENANT_ID` | 必选 | Microsoft Entra ID 应用程序的 Tenant ID |
|
||||
|
||||
@@ -57,7 +57,8 @@ http(s)://your-domain/api/auth/callback/zitadel
|
||||
- You can fill in or modify redirect URIs after creating the application, but make sure the filled
|
||||
URL is consistent with the deployed URL.
|
||||
|
||||
- Replace `http(s)://your-domain` with the actual URL that LobeChat is deployed to.
|
||||
- Replace `http(s)://your-domain` with the actual URL that LobeChat is deployed to.
|
||||
|
||||
</Callout>
|
||||
|
||||
Confirm the configuration and click **Create**.
|
||||
@@ -76,8 +77,7 @@ Save the **ClientId** and **ClientSecret** for later use.
|
||||
src="https://github.com/lobehub/lobe-chat/assets/8692892/407b4eed-7f21-4aa6-b68f-9bae2faf09d0"
|
||||
/>
|
||||
|
||||
In the application settings page, navigate to the **Token Settings** tab, enable **User Info inside
|
||||
ID Token** option, and click **Save**.
|
||||
In the application settings page, navigate to the **Token Settings** tab, enable **User Info inside ID Token** option, and click **Save**.
|
||||
|
||||
<Image
|
||||
alt="Create ZITADEL Application S7"
|
||||
@@ -99,9 +99,8 @@ When deploying LobeChat, you need to configure the following environment variabl
|
||||
|
||||
| Environment Variable | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `ENABLE_OAUTH_SSO` | Required | Enable single sign-on (SSO) for LobeChat. Set to `1` to enable single sign-on. |
|
||||
| `NEXTAUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | Optional | Select the single sign-on provider for LoboChat. Use `zitadel` for ZITADEL. |
|
||||
| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | Optional | Select the single sign-on provider for LoboChat. Use `zitadel` for ZITADEL. |
|
||||
| `ZITADEL_CLIENT_ID` | Required | Client ID (`ClientId` as shown in ZITADEL) of the ZITADEL application |
|
||||
| `ZITADEL_CLIENT_SECRET` | Required | Client Secret (`ClientSecret` as shown in ZITADEL) of the ZITADEL application |
|
||||
| `ZITADEL_ISSUER` | Required | Issuer URL of the ZITADEL application |
|
||||
|
||||
@@ -53,7 +53,8 @@ http(s)://your-domain/api/auth/callback/zitadel
|
||||
<Callout type={'important'}>
|
||||
- 可以创建应用后再填写或修改重定向 URL,但请确保填写的 URL 与部署的 URL 一致。
|
||||
|
||||
- 请将 `http(s)://your-domain` 替换为 LobeChat 部署的实际 URL。
|
||||
- 请将 `http(s)://your-domain` 替换为 LobeChat 部署的实际 URL。
|
||||
|
||||
</Callout>
|
||||
|
||||
确认配置并点击「创建」。
|
||||
@@ -94,9 +95,8 @@ http(s)://your-domain/api/auth/callback/zitadel
|
||||
|
||||
| 环境变量 | 类型 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录(SSO)。设置为 `1` 以启用单点登录。 |
|
||||
| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成密钥:`openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | 可选 | 为 LobeChat 选择单点登录提供程序。对于 ZITADEL,请填写 `zitadel`。 |
|
||||
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成密钥:`openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 为 LobeChat 选择单点登录提供程序。对于 ZITADEL,请填写 `zitadel`。 |
|
||||
| `ZITADEL_CLIENT_ID` | 必选 | ZITADEL 应用的 Client ID(`ClientId`)。 |
|
||||
| `ZITADEL_CLIENT_SECRET` | 必选 | ZITADEL 应用的 Client Secret(`ClientSecret`)。 |
|
||||
| `ZITADEL_ISSUER` | 必选 | ZITADEL 应用的 OpenID Connect 颁发者(issuer)URL。 |
|
||||
|
||||
@@ -126,13 +126,13 @@ if [ $? -eq 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Detected Lobe-Chat update"
|
||||
echo "Detected lobe-chat update"
|
||||
|
||||
# Remove the old container
|
||||
echo "Removed: $(docker rm -f Lobe-Chat)"
|
||||
echo "Removed: $(docker rm -f lobe-chat)"
|
||||
|
||||
# Run the new container
|
||||
echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=Lobe-Chat --restart=always lobehub/lobe-chat)"
|
||||
# Run the new container(Please change the path to the env file)
|
||||
echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=lobe-chat --restart=always lobehub/lobe-chat)"
|
||||
|
||||
# Print the update time and version
|
||||
echo "Update time: $(date)"
|
||||
|
||||
@@ -103,7 +103,7 @@ OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.
|
||||
# auto-update-lobe-chat.sh
|
||||
|
||||
# 设置代理(可选)
|
||||
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
|
||||
# export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
|
||||
|
||||
# 拉取最新的镜像并将输出存储在变量中
|
||||
output=$(docker pull lobehub/lobe-chat:latest 2>&1)
|
||||
@@ -121,13 +121,13 @@ if [ $? -eq 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Detected Lobe-Chat update"
|
||||
echo "Detected lobe-chat update"
|
||||
|
||||
# 删除旧的容器
|
||||
echo "Removed: $(docker rm -f Lobe-Chat)"
|
||||
echo "Removed: $(docker rm -f lobe-chat)"
|
||||
|
||||
# 运行新的容器
|
||||
echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=Lobe-Chat --restart=always lobehub/lobe-chat)"
|
||||
# 运行新的容器(请将env配置文件地址改为你的实际地址)
|
||||
echo "Started: $(docker run -d --network=host --env-file path/to/lobe.env --name=lobe-chat --restart=always lobehub/lobe-chat)"
|
||||
|
||||
# 打印更新的时间和版本
|
||||
echo "Update time: $(date)"
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
# LobeChat WebRTC Sync
|
||||
|
||||
## Introduction to WebRTC
|
||||
|
||||
WebRTC (Web Real-Time Communication) is a technology that enables peer-to-peer communication between browsers. In LobeChat, we experimentally implemented real-time data synchronization between devices based on WebRTC and YJS, without relying on traditional server databases. This solution offers high privacy, zero conflicts, and provides a real-time session synchronization experience.
|
||||
|
||||
## Configuring WebRTC for Synchronization
|
||||
|
||||
To use the WebRTC synchronization feature in LobeChat, you need to complete the following steps:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Deploy Signaling Server
|
||||
|
||||
Deploy a WebRTC signaling server with one click using the Zeabur platform:
|
||||
|
||||
[](https://zeabur.com/templates/MY0JZG?referralCode=arvinxx)
|
||||
|
||||
Alternatively, you can view the [source code](https://github.com/lobehub/y-webrtc-signaling) and deploy it on your own.
|
||||
|
||||
After deployment, you will receive a URL, for example: `https://my-signaling-server.zeabur.app`.
|
||||
|
||||
### Enable WebRTC Sync in the Deployment Instance
|
||||
|
||||
The WebRTC sync feature in LobeChat is hidden by default and needs to be enabled by adding the environment variable `FEATURE_FLAGS=+webrtc_sync`.
|
||||
|
||||
### Configure WebRTC Sync Settings in LobeChat
|
||||
|
||||
1. Open LobeChat settings -> Data Sync
|
||||
2. Enter the signaling server address in the WebRTC sync section;
|
||||
3. Set the sync channel name and password
|
||||
|
||||
<Image
|
||||
alt={'LobeChat Data Sync Settings Page'}
|
||||
height={356}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/bf86bf1e-87fb-4015-8587-15ff28bb9c24'}
|
||||
/>
|
||||
|
||||
### Repeat the Above Configuration on Devices that Need to Sync
|
||||
|
||||
Ensure all devices use the same signaling server, channel name, and password. Once configured, the devices should automatically start syncing data.
|
||||
|
||||
</Steps>
|
||||
|
||||
## Limitations and Known Issues
|
||||
|
||||
Although WebRTC has the advantages of no database and flexibility, after extensive community testing, the following limitations and known issues have been identified:
|
||||
|
||||
### Requirement for Devices to be Online Simultaneously
|
||||
|
||||
WebRTC requires devices to be online simultaneously to synchronize, meaning changes cannot be made on one device while offline and then synced later on another device.
|
||||
|
||||
This limitation is due to the communication nature of WebRTC. In a pure frontend, serverless scenario, data synchronization between two devices can only be achieved through peer-to-peer communication. When one device is online and the other is offline, it is impossible to determine where the data should come from. Only when both devices are online can data communication occur. This mode is more like an online chat room where everyone needs to be online to see each other's data and achieve synchronization.
|
||||
|
||||
Therefore, in certain situations, WebRTC's pure peer-to-peer approach may not fully meet users' needs (e.g., one device is a work computer, and the other is a home computer), and there are also some issues with data synchronization.
|
||||
|
||||
### Network Issues Leading to Sync Failures
|
||||
|
||||
Due to the implementation mechanism of WebRTC, its peer-to-peer communication has strict network requirements. Many of our users have reported:
|
||||
|
||||
- Syncing between PCs is possible, but syncing between a mobile device with a SIM card and a PC is not, although syncing is possible when using the same WIFI as the PC;
|
||||
- Syncing fails when switching networks.
|
||||
|
||||
### Stability and Performance Issues
|
||||
|
||||
- Some users have reported ICE connection failures on the Firefox browser: [WebRTC Data Sync Feedback](https://github.com/lobehub/lobe-chat/issues/1683#issuecomment-2094745907)
|
||||
- For extremely long text or large amounts of conversation records, the synchronization process may slow down or become unstable: [When the model outputs a very long conversation, the end of the conversation will contain synchronization-related content tags, leading to sync failures](https://github.com/lobehub/lobe-chat/issues/1962)
|
||||
|
||||
## Our Recommendations
|
||||
|
||||
Considering the above reasons, we recommend users treat the WebRTC sync feature as experimental and regularly back up important data.
|
||||
|
||||
We have already released a more stable and user-friendly server database synchronization solution ([deployment guide](/docs/self-hosting/advanced/server-database)). We recommend users prioritize using the server database synchronization solution.
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Please note that we have officially announced the archiving of this sync feature in [PR
|
||||
3182](https://github.com/lobehub/lobe-chat/pull/3182), and the above issues will no longer be
|
||||
considered for fixes.
|
||||
</Callout>
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
title: LobeChat WebRTC 同步配置指南
|
||||
description: 在 LobeChat 中实现基于 WebRTC 和 YJS 的设备间实时数据同步。了解如何配置 WebRTC 并开启同步功能,以及使用局限性和已知问题。
|
||||
tags:
|
||||
- YJS
|
||||
- 信令服务器
|
||||
---
|
||||
|
||||
# LobeChat WebRTC 同步
|
||||
|
||||
## WebRTC 简介
|
||||
|
||||
WebRTC (Web Real-Time Communication) 是一项实现浏览器之间点对点通信的技术。在 LobeChat 中,我们实验性地基于 WebRTC 和 YJS 实现了设备间的实时数据同步,无需依赖传统的服务器数据库。这种方案具有高度隐私性、零冲突性,并能提供实时会话同步体验。
|
||||
|
||||
## 配置 WebRTC 并实现同步
|
||||
|
||||
要使用 LobeChat 的 WebRTC 同步功能,需要完成以下步骤:
|
||||
|
||||
<Steps>
|
||||
|
||||
### 部署信令服务器
|
||||
|
||||
使用 Zeabur 平台一键部署 WebRTC 信令服务器:
|
||||
|
||||
[](https://zeabur.com/templates/MY0JZG?referralCode=arvinxx)
|
||||
|
||||
或者查看 [源码](https://github.com/lobehub/y-webrtc-signaling) 自行部署。
|
||||
|
||||
部署完成后,可以得到一个 URL,例如:`https://my-signaling-server.zeabur.app`。
|
||||
|
||||
### 在部署实例中开启 WebRTC 同步
|
||||
|
||||
LobeChat 默认隐藏了 WebRTC 同步功能,需要通过添加环境变量 `FEATURE_FLAGS=+webrtc_sync` 来开启 WebRTC 同步特性。
|
||||
|
||||
### 配置 LobeChat 的 WebRTC 同步设置
|
||||
|
||||
1. 打开 LobeChat 设置 -> 数据同步
|
||||
2. 在 WebRTC 同步中填写信令服务器地址;
|
||||
3. 设置同步频道名称和密码
|
||||
|
||||
<Image
|
||||
alt={'LobeChat 数据同步设置页'}
|
||||
height={356}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/bf86bf1e-87fb-4015-8587-15ff28bb9c24'}
|
||||
/>
|
||||
|
||||
### 在需要同步的设备上重复以上配置
|
||||
|
||||
确保所有设备使用相同的信令服务器、频道名称和密码,完成配置后,设备间应该可以开始自动同步数据。
|
||||
|
||||
</Steps>
|
||||
|
||||
## 使用局限性和已知问题
|
||||
|
||||
虽然 WebRTC 具有无数据库、比较灵活的特性,但目前该功能经过大范围社区测试,存在以下局限性和已知问题:
|
||||
|
||||
### 设备同时在线要求
|
||||
|
||||
WebRTC 要求设备同时在线才能进行同步,这意味着无法在一台设备离线时在另一台设备上进行更改并稍后同步。
|
||||
|
||||
这是 WebRTC 本身的通信特性有关系,由于在纯前端、无服务端的情况下,两个设备的数据同步只能通过点对点通信的形式达成。当一个设备在线,一个设备离线的情况下,我们无从感知数据到底应该从哪来,只有当两台设备都在线的时候,双发数据才能通信。其实这种模式更像是一个在线聊天室,大家都在线时才能看到对方的数据,然后达成同步。
|
||||
|
||||
因此 WebRTC 这种纯点对点的方式在某些情况下并无法完全满足用户的诉求(例如一个是公司电脑,一个是家里电脑),同时也存在一些数据同步层面的问题。
|
||||
|
||||
### 网络问题可能导致同步失败
|
||||
|
||||
由于 WebRTC 的实现机制,其点对点通信对于网络要求非常苛刻,我们的很多用户反馈:
|
||||
|
||||
- 在 PC 上可以互相同步、 手机 sim 卡无法和 PC 同步、但是换成和PC一样的WIFI可以和 PC 同步;
|
||||
- 任何切换网络都无法同步;
|
||||
|
||||
### 稳定性与性能问题
|
||||
|
||||
- 部分用户报告在 Firefox 浏览器上遇到 ICE 连接失败的问题:[WebRTC Data Sync Feedback](https://github.com/lobehub/lobe-chat/issues/1683#issuecomment-2094745907)
|
||||
- 对于超长文本或大量对话记录,同步过程可能变慢或不稳定:[当模型输出超长对话时,对话末尾会出现同步相关的内容标签,导致同步失败](https://github.com/lobehub/lobe-chat/issues/1962)
|
||||
|
||||
## 我们的建议
|
||||
|
||||
鉴于以上原因,我们建议用户将 WebRTC 同步功能视为实验性功能,并定期备份重要数据。
|
||||
|
||||
目前我们已经发布了更稳定、更用户友好的服务端数据库同步方案([部署指南](/zh/docs/self-hosting/advanced/server-database)),我们建议用户优先考虑使用服务端数据库同步方案。
|
||||
|
||||
<Callout type={'warning'}>
|
||||
请注意,我们已经在 [PR 3182](https://github.com/lobehub/lobe-chat/pull/3182)
|
||||
中正式宣布归档该同步特性,上述问题将不再考虑进行修复。
|
||||
</Callout>
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: >-
|
||||
Integrating Data Analytics Services in LobeChat: Environment Variables and
|
||||
Configuration
|
||||
title: Integrating Analytics in LobeChat
|
||||
description: >-
|
||||
Learn how to configure environment variables for Vercel Analytics, Google
|
||||
Analytics, PostHog Analytics, and Umami Analytics in LobeChat for data
|
||||
@@ -36,44 +34,30 @@ We have integrated several free/open-source data analytics services in LobeChat
|
||||
|
||||
## Google Analytics
|
||||
|
||||
### `ENABLE_GOOGLE_ANALYTICS`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Used to configure the environment variable for Google Analytics. Set to `1` to enable Google Analytics.
|
||||
- Default: `-`
|
||||
- Example: `1`
|
||||
|
||||
### `GOOGLE_ANALYTICS_MEASUREMENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Google Analytics Measurement ID,you can get it from the Google Analytics dashboard.
|
||||
- Description: Google Analytics Measurement ID,you can get it from the Google Analytics dashboard. Add it will auto enable Google Analytics.
|
||||
- Default: `-`
|
||||
- Example: `G-63LP2TV03T`
|
||||
|
||||
## Posthog Analytics
|
||||
|
||||
### `NEXT_PUBLIC_ANALYTICS_POSTHOG`
|
||||
### `POSTHOG_KEY`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Used to enable the environment variable for [PostHog Analytics][posthog-analytics-url]. Set to `1` to enable PostHog Analytics.
|
||||
- Default: `-`
|
||||
- Example: `1`
|
||||
|
||||
### `NEXT_PUBLIC_POSTHOG_KEY`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Set the PostHog project Key.
|
||||
- Type: Required
|
||||
- Description: Set the PostHog project Key. Add it will auto enable PostHog Analytics.
|
||||
- Default: `-`
|
||||
- Example: `phc_xxxxxxxx`
|
||||
|
||||
### `NEXT_PUBLIC_POSTHOG_HOST`
|
||||
### `POSTHOG_HOST`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Set the deployment address of the PostHog service, defaulting to the official SAAS address.
|
||||
- Default: `https://app.posthog.com`
|
||||
- Example: `https://example.com`
|
||||
|
||||
### `NEXT_PUBLIC_POSTHOG_DEBUG`
|
||||
### `DEBUG_POSTHOG_ANALYTICS`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Enable the debug mode for PostHog.
|
||||
@@ -82,26 +66,19 @@ We have integrated several free/open-source data analytics services in LobeChat
|
||||
|
||||
## Umami Analytics
|
||||
|
||||
### `NEXT_PUBLIC_ANALYTICS_UMAMI`
|
||||
### `UMAMI_WEBSITE_ID`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Used to enable the environment variable for [Umami Analytics][umami-analytics-url]. Set to `1` to enable Umami Analytics.
|
||||
- Type: Required
|
||||
- Description: Your Umami Website ID. Add it will auto enable Umami Analytics.
|
||||
- Default: `-`
|
||||
- Example: `1`
|
||||
- Example: `E738D82A-EE9E-4806-A81F-0CA3CAE57F65`
|
||||
|
||||
### `NEXT_PUBLIC_UMAMI_SCRIPT_URL`
|
||||
### `UMAMI_SCRIPT_URL`
|
||||
|
||||
- Type: Optional
|
||||
- Description: The URL of the Umami script, defaulting to the script URL provided by Umami Cloud.
|
||||
- Default: `https://analytics.umami.is/script.js`
|
||||
- Example: `https://umami.your-site.com/script.js`
|
||||
|
||||
### `NEXT_PUBLIC_UMAMI_WEBSITE_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Your Umami Website ID.
|
||||
- Default: `-`
|
||||
- Example: `E738D82A-EE9E-4806-A81F-0CA3CAE57F65`
|
||||
|
||||
[posthog-analytics-url]: https://posthog.com
|
||||
[umami-analytics-url]: https://umami.is
|
||||
|
||||
@@ -32,44 +32,30 @@ tags:
|
||||
|
||||
## Google Analytics
|
||||
|
||||
### `ENABLE_GOOGLE_ANALYTICS`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:用于配置 Google Analytics 的环境变量,当设为 `1` 时开启 Google Analytics
|
||||
- 默认值: `-`
|
||||
- 示例:`1`
|
||||
|
||||
### `GOOGLE_ANALYTICS_MEASUREMENT_ID`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:Google Analytics 的 Measurement ID,如果开启了 Google Analytics,此项必填
|
||||
- 描述:Google Analytics 的 Measurement ID,填写此项后将自动开启 Google Analytics
|
||||
- 默认值: `-`
|
||||
- 示例:`G-63LP2TV03T`
|
||||
|
||||
## Posthog Analytics
|
||||
|
||||
### `NEXT_PUBLIC_ANALYTICS_POSTHOG`
|
||||
### `POSTHOG_KEY`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:用于开启 [PostHog Analytics][posthog-analytics-url] 的环境变量,设为 `1` 时开启 PostHog Analytics
|
||||
- 默认值: `-`
|
||||
- 示例:`1`
|
||||
|
||||
### `NEXT_PUBLIC_POSTHOG_KEY`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:设置 PostHog 项目 Key
|
||||
- 类型:必选
|
||||
- 描述:设置 PostHog 项目 Key,设置此项后将自动开启 PostHog Analytics
|
||||
- 默认值: `-`
|
||||
- 示例:`phc_xxxxxxxx`
|
||||
|
||||
### `NEXT_PUBLIC_POSTHOG_HOST`
|
||||
### `POSTHOG_HOST`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:设置 PostHog 服务的部署地址,默认为官方的 SAAS 地址
|
||||
- 描述:设置 PostHog 服务的部署地址,默认为官方的 SaaS 地址
|
||||
- 默认值:`https://app.posthog.com`
|
||||
- 示例:`https://example.com`
|
||||
|
||||
### `NEXT_PUBLIC_POSTHOG_DEBUG`
|
||||
### `POSTHOG_DEBUG`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:开启 PostHog 的调试模式
|
||||
@@ -78,26 +64,19 @@ tags:
|
||||
|
||||
## Umami Analytics
|
||||
|
||||
### `NEXT_PUBLIC_ANALYTICS_UMAMI`
|
||||
### `UMAMI_WEBSITE_ID`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:用于开启 [Umami Analytics][umami-analytics-url] 的环境变量,设为 `1` 时开启 Umami Analytics
|
||||
- 默认值: `-`
|
||||
- 示例:`1`
|
||||
- 类型:必选
|
||||
- 描述:你的 Umami 的 Website ID,填写此项后将自动开启 Umami Analytics
|
||||
- 默认值:`-`
|
||||
- 示例:`E738D82A-EE9E-4806-A81F-0CA3CAE57F65`
|
||||
|
||||
### `NEXT_PUBLIC_UMAMI_SCRIPT_URL`
|
||||
### `UMAMI_SCRIPT_URL`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:Umami 脚本的网址,默认为 Umami Cloud 提供的脚本网址
|
||||
- 默认值:`https://analytics.umami.is/script.js`
|
||||
- 示例:`https://umami.your-site.com/script.js`
|
||||
|
||||
### `NEXT_PUBLIC_UMAMI_WEBSITE_ID`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:你的 Umami 的 Website ID
|
||||
- 默认值:`-`
|
||||
- 示例:`E738D82A-EE9E-4806-A81F-0CA3CAE57F65`
|
||||
|
||||
[posthog-analytics-url]: https://posthog.com
|
||||
[umami-analytics-url]: https://umami.is
|
||||
|
||||
@@ -5,150 +5,143 @@ description: >-
|
||||
services in LobeChat, including OAuth SSO, NextAuth settings, and
|
||||
provider-specific details.
|
||||
tags:
|
||||
- LobeChat
|
||||
- Authentication Service
|
||||
- Environment Variables
|
||||
- OAuth SSO
|
||||
- Clerk
|
||||
- NextAuth
|
||||
- Provider Details
|
||||
---
|
||||
|
||||
## Authentication Service
|
||||
# Authentication Service
|
||||
|
||||
LobeChat provides a complete authentication service capability when deployed. The following are the relevant environment variables. You can use these environment variables to easily define the identity verification services that need to be enabled in LobeChat.
|
||||
|
||||
## General Settings
|
||||
## Next Auth
|
||||
|
||||
### `ENABLE_OAUTH_SSO`
|
||||
### General Settings
|
||||
|
||||
- Type: Required
|
||||
- Description: Enable single sign-on (SSO) for LobeChat. Set to `1` to enable single sign-on.
|
||||
- Default: `-`
|
||||
- Example: `1`
|
||||
|
||||
### `SSO_PROVIDERS`
|
||||
|
||||
- Type: Required
|
||||
- Description: Select the single sign-on provider for LoboChat. For multiple SSO Providers separating them with commas, for example, `auth0,azure-ad,authentik`.
|
||||
- Default: `auth0`
|
||||
- Example: `auth0,azure-ad,authentik`
|
||||
|
||||
### `NEXTAUTH_SECRET`
|
||||
#### `NEXT_AUTH_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Key used to encrypt the session tokens in Auth.js. You can generate the key using the following command: `openssl rand -base64 32`.
|
||||
- Default: `-`
|
||||
- Example: `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=`
|
||||
|
||||
### `NEXTAUTH_URL`
|
||||
#### `NEXT_AUTH_SSO_PROVIDERS`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Select the single sign-on provider for LoboChat. For multiple SSO Providers separating them with commas, for example, `auth0,azure-ad,authentik`.
|
||||
- Default: `auth0`
|
||||
- Example: `auth0,azure-ad,authentik`
|
||||
|
||||
#### `NEXTAUTH_URL`
|
||||
|
||||
- Type: Optional
|
||||
- Description: This URL is used to specify the callback address for Auth.js during OAuth authentication. It does not need to be set when deploying on Vercel.
|
||||
- Default: `-`
|
||||
- Example: `https://example.com/api/auth`
|
||||
|
||||
## Auth0
|
||||
### Auth0
|
||||
|
||||
### `AUTH0_CLIENT_ID`
|
||||
#### `AUTH0_CLIENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client ID of the Auth0 application. You can access it [here](https://manage.auth0.com/dashboard) and navigate to the application settings to view.
|
||||
- Default: `-`
|
||||
- Example: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
|
||||
|
||||
### `AUTH0_CLIENT_SECRET`
|
||||
#### `AUTH0_CLIENT_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client Secret of the Auth0 application.
|
||||
- Default: `-`
|
||||
- Example: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
|
||||
|
||||
### `AUTH0_ISSUER`
|
||||
#### `AUTH0_ISSUER`
|
||||
|
||||
- Type: Required
|
||||
- Description: Issuer/domain of the Auth0 application.
|
||||
- Default: `-`
|
||||
- Example: `https://example.auth0.com`
|
||||
|
||||
## Microsoft Entra ID
|
||||
### Microsoft Entra ID
|
||||
|
||||
### `AZURE_AD_CLIENT_ID`
|
||||
#### `AZURE_AD_CLIENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client ID of the Microsoft Entra ID application.
|
||||
- Default: `-`
|
||||
- Example: `be8f6da1-58c3-4f16-ff1b-78f5148e10df`
|
||||
|
||||
### `AZURE_AD_CLIENT_SECRET`
|
||||
#### `AZURE_AD_CLIENT_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client Secret of the Microsoft Entra ID application.
|
||||
- Default: `-`
|
||||
- Example: `~gI8Q.pTiN1vwB6Gl.E1yFT1ojcXABkdACfJXaNj`
|
||||
|
||||
### `AZURE_AD_TENANT_ID`
|
||||
#### `AZURE_AD_TENANT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Tenant ID of the Microsoft Entra ID application.
|
||||
- Default: `-`
|
||||
- Example: `c8ae2f36-edf6-4cda-96b9-d3e198a47cba`
|
||||
|
||||
## Authentik
|
||||
### Authentik
|
||||
|
||||
### `AUTHENTIK_CLIENT_ID`
|
||||
#### `AUTHENTIK_CLIENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client ID of the Authentik provider application. You can access it [here][auth0-client-page] and navigate to the application settings to view.
|
||||
- Default: `-`
|
||||
- Example: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
|
||||
|
||||
### `AUTHENTIK_CLIENT_SECRET`
|
||||
#### `AUTHENTIK_CLIENT_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client Secret of the Authentik provider application.
|
||||
- Default: `-`
|
||||
- Example: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
|
||||
|
||||
### `AUTHENTIK_ISSUER`
|
||||
#### `AUTHENTIK_ISSUER`
|
||||
|
||||
- Type: Required
|
||||
- Description: Issuer/domain of the Authentik provider application.
|
||||
- Default: `-`
|
||||
- Example: `https://your-authentik-domain.com/application/o/slug/`
|
||||
|
||||
## Github
|
||||
### Github
|
||||
|
||||
### `GITHUB_CLIENT_ID`
|
||||
#### `GITHUB_CLIENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client ID of the Github application. You can access it [here](https://github.com/settings/apps) and navigate to the application settings to view.
|
||||
- Default: `-`
|
||||
- Example: `abd94200333283550508`
|
||||
|
||||
### `GITHUB_CLIENT_SECRET`
|
||||
#### `GITHUB_CLIENT_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client Secret of the Github application.
|
||||
- Default: `-`
|
||||
- Example: `dd262976ac0931d947e104891586a053f3d3750b`
|
||||
|
||||
## ZITADEL
|
||||
### ZITADEL
|
||||
|
||||
### `ZITADEL_CLIENT_ID`
|
||||
#### `ZITADEL_CLIENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client ID of the ZITADEL application. This can be found under your application in the ZITADEL console.
|
||||
- Default: `-`
|
||||
- Example: `123456789012345678@your-project`
|
||||
|
||||
### `ZITADEL_CLIENT_SECRET`
|
||||
#### `ZITADEL_CLIENT_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client Secret of the ZITADEL application.
|
||||
- Default: `-`
|
||||
- Example: `9QF1n5ATzU7Z3mHp2Iw4gKX8kY6oR7uW1DnKcV3LqX2jF6iG3fBmJ1kV7nS5zE6A`
|
||||
|
||||
### `ZITADEL_ISSUER`
|
||||
#### `ZITADEL_ISSUER`
|
||||
|
||||
- Type: Required
|
||||
- Description: Issuer of the ZITADEL application. This is usually the URL of the ZITADEL instance, and can be found in `URLs` tab of your application in the console.
|
||||
@@ -160,3 +153,19 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
||||
providers, you can submit a [feature
|
||||
request](https://github.com/lobehub/lobe-chat/issues/new/choose) or Pull Request.
|
||||
</Callout>
|
||||
|
||||
## Clerk
|
||||
|
||||
### `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`
|
||||
|
||||
- Type: Required
|
||||
- Description: Publishable key of the Clerk application. You can access it [here](https://dashboard.clerk.com) and navigate to the API Keys to view.
|
||||
- Default: `-`
|
||||
- Example: `pk_test_Zmxvd4luZy1wdW1hLTIyLmNsXXJrTmFjY291bnRzLmRldiQ` in dev / `pk_live_Y2xlcdsubG9iZWh1Yi1cbmMuY24k` in production
|
||||
|
||||
### `CLERK_SECRET_KEY`
|
||||
|
||||
- Type: Required
|
||||
- Description: Secret key of the Clerk application.
|
||||
- Default: `-`
|
||||
- Example: `sk_test_513Ma0P7IAWM1XMv4waxZjRYRajWTaCfJLjpEO3SD2` in dev / `sk_live_eMMlHjwJvZFUfczFljSKqZdwQtLvmczmsJSNmdrpeZ` in production
|
||||
|
||||
@@ -1,155 +1,145 @@
|
||||
---
|
||||
title: LobeChat 身份验证服务设置
|
||||
description: >-
|
||||
了解如何配置 LobeChat 的身份验证服务环境变量,包括单点登录 (SSO)、Auth0、Microsoft Entra
|
||||
ID、Authentik、Github 和 ZITADEL。
|
||||
description: 了解如何配置 LobeChat 的身份验证服务环境变量。
|
||||
tags:
|
||||
- LobeChat
|
||||
- 身份验证服务
|
||||
- 单点登录
|
||||
- Auth0
|
||||
- Microsoft Entra ID
|
||||
- Authentik
|
||||
- Github
|
||||
- ZITADEL
|
||||
- Next Auth
|
||||
- Clerk
|
||||
---
|
||||
|
||||
# 身份验证服务
|
||||
|
||||
LobeChat 在部署时提供了完善的身份验证服务能力,以下是相关的环境变量,你可以使用这些环境变量轻松定义需要在 LobeChat 中开启的身份验证服务。
|
||||
|
||||
## 通用设置
|
||||
## Next Auth
|
||||
|
||||
### `ENABLE_OAUTH_SSO`
|
||||
### 通用设置
|
||||
|
||||
- 类型:必选
|
||||
- 描述:为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。
|
||||
- 默认值: `-`
|
||||
- 示例: `1`
|
||||
|
||||
### `SSO_PROVIDERS`
|
||||
|
||||
- Type: 必需
|
||||
- 描述:选择 LoboChat 的单点登录提供商。如果有多个单点登录提供商,请用逗号分隔,例如 `auth0,azure-ad,authentik`
|
||||
- 默认值: `auth0`
|
||||
- 示例: `auth0,azure-ad,authentik`
|
||||
|
||||
### `NEXTAUTH_SECRET`
|
||||
#### `NEXT_AUTH_SECRET`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32`.
|
||||
- 默认值: `-`
|
||||
- 示例: `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=`
|
||||
|
||||
### `NEXTAUTH_URL`
|
||||
#### `NEXT_AUTH_SSO_PROVIDERS`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:选择 LoboChat 的单点登录提供商。如果有多个单点登录提供商,请用逗号分隔,例如 `auth0,azure-ad,authentik`
|
||||
- 默认值: `auth0`
|
||||
- 示例: `auth0,azure-ad,authentik`
|
||||
|
||||
#### `NEXTAUTH_URL`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,在 Vercel 上部署时无需设置。
|
||||
- 默认值:`-`
|
||||
- 示例:`https://example.com/api/auth`
|
||||
|
||||
## Auth0
|
||||
### Auth0
|
||||
|
||||
### `AUTH0_CLIENT_ID`
|
||||
#### `AUTH0_CLIENT_ID`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Auth0 应用程序的 Client ID,您可以访问[这里](https://manage.auth0.com/dashboard)并导航至应用程序设置来查看
|
||||
- 默认值: `-`
|
||||
- 示例: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
|
||||
|
||||
### `AUTH0_CLIENT_SECRET`
|
||||
#### `AUTH0_CLIENT_SECRET`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Auth0 应用程序的 Client Secret
|
||||
- 默认值: `-`
|
||||
- 示例: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
|
||||
|
||||
### `AUTH0_ISSUER`
|
||||
#### `AUTH0_ISSUER`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Auth0 应用程序的签发人 / 域
|
||||
- 默认值: `-`
|
||||
- 示例: `https://example.auth0.com`
|
||||
|
||||
## Microsoft Entra ID
|
||||
### Microsoft Entra ID
|
||||
|
||||
### `AZURE_AD_CLIENT_ID`
|
||||
#### `AZURE_AD_CLIENT_ID`
|
||||
|
||||
- 类型:必需
|
||||
- 类型:必选
|
||||
- 描述:Microsoft Entra ID 应用程序的客户端 ID。
|
||||
- 默认值:`-`
|
||||
- 示例:`be8f6da1-58c3-4f16-ff1b-78f5148e10df`
|
||||
|
||||
### `AZURE_AD_CLIENT_SECRET`
|
||||
#### `AZURE_AD_CLIENT_SECRET`
|
||||
|
||||
- 类型:必需
|
||||
- 类型:必选
|
||||
- 描述:Microsoft Entra ID 应用程序的客户端密钥。
|
||||
- 默认值:`-`
|
||||
- 示例:`~gI8Q.pTiN1vwB6Gl.E1yFT1ojcXABkdACfJXaNj`
|
||||
|
||||
### `AZURE_AD_TENANT_ID`
|
||||
#### `AZURE_AD_TENANT_ID`
|
||||
|
||||
- 类型:必需
|
||||
- 类型:必选
|
||||
- 描述:Microsoft Entra ID 应用程序的租户 ID。
|
||||
- 默认值:`-`
|
||||
- 示例:`c8ae2f36-edf6-4cda-96b9-d3e198a47cba`
|
||||
|
||||
## Authentik
|
||||
### Authentik
|
||||
|
||||
### `AUTHENTIK_CLIENT_ID`
|
||||
#### `AUTHENTIK_CLIENT_ID`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Authentik 提供程序的 Client ID
|
||||
- 默认值: `-`
|
||||
- 示例: `YNtbIRlYF8Kj66mTLue59nsGLlb7HNyx1qjPH6VS`
|
||||
|
||||
### `AUTHENTIK_CLIENT_SECRET`
|
||||
#### `AUTHENTIK_CLIENT_SECRET`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Authentik 提供程序的 Client Secret
|
||||
- 默认值: `-`
|
||||
- 示例: `h3lMI1vPUzqyqqeIDUbH5UNNOxyQLXk35h89yETeaAwHk7qVXBG3sJQWeqHBU5pyggwhP9u0eaZ1eq6DHUddVPLoS4gncqD37yuCr8jI8dY66WAt45MStDsDcQm0Ygze`
|
||||
|
||||
### `AUTHENTIK_ISSUER`
|
||||
#### `AUTHENTIK_ISSUER`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Authentik 提供程序的 OpenID Connect 颁发者
|
||||
- 默认值: `-`
|
||||
- 示例: `https://your-authentik-domain.com/application/o/slug/`
|
||||
|
||||
## Github
|
||||
### Github
|
||||
|
||||
### `GITHUB_CLIENT_ID`
|
||||
#### `GITHUB_CLIENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Github应用的客户端ID。您可以在[这里](https://github.com/settings/apps)访问,并导航到应用程序设置以查看。
|
||||
- Default: `-`
|
||||
- Example: `abd94200333283550508`
|
||||
|
||||
### `GITHUB_CLIENT_SECRET`
|
||||
#### `GITHUB_CLIENT_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Github应用的客户端密钥。
|
||||
- Default: `-`
|
||||
- Example: `dd262976ac0931d947e104891586a053f3d3750b`
|
||||
|
||||
## ZITADEL
|
||||
### ZITADEL
|
||||
|
||||
### `ZITADEL_CLIENT_ID`
|
||||
#### `ZITADEL_CLIENT_ID`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:ZITADEL 应用的 Client ID。您可以在 ZITADEL 控制台应用设置中找到 Client ID。
|
||||
- 默认值:`-`
|
||||
- 示例:`123456789012345678@your-project`
|
||||
|
||||
### `ZITADEL_CLIENT_SECRET`
|
||||
#### `ZITADEL_CLIENT_SECRET`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:ZITADEL 应用的 Client Secret。
|
||||
- 默认值:`-`
|
||||
- 示例:`9QF1n5ATzU7Z3mHp2Iw4gKX8kY6oR7uW1DnKcV3LqX2jF6iG3fBmJ1kV7nS5zE6A`
|
||||
|
||||
### `ZITADEL_ISSUER`
|
||||
#### `ZITADEL_ISSUER`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:ZITADEL 应用的 OpenID Connect 颁发者(issuer),通常为 ZITADEL 实例的 URL。您可以在 ZITADEL 控制台应用设置中的 `URLs` 选项卡中找到 issuer。
|
||||
@@ -160,3 +150,19 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
||||
如果您需要使用其他身份验证服务提供商,可以提交
|
||||
[功能请求](https://github.com/lobehub/lobe-chat/issues/new/choose) 或 Pull Request。
|
||||
</Callout>
|
||||
|
||||
## Clerk
|
||||
|
||||
### `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Clerk 应用程序的 Publishable key。您可以在[这里](https://dashboard.clerk.com)访问,并导航到 API Keys 以查看。
|
||||
- 默认值:`-`
|
||||
- 示例: `pk_test_Zmxvd4luZy1wdW1hLTIyLmNsXXJrTmFjY291bnRzLmRldiQ` (测试环境) / `pk_live_Y2xlcdsubG9iZWh1Yi1cbmMuY24k` (生产环境)
|
||||
|
||||
### `CLERK_SECRET_KEY`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Clerk 应用程序的 Secret key。您可以在[这里](https://dashboard.clerk.com)访问,并导航到 API Keys 以查看。
|
||||
- 默认值:`-`
|
||||
- 示例: `sk_test_513Ma0P7IAWM1XMv4waxZjRYRajWTaCfJLjpEO3SD2` (测试环境) / `sk_live_eMMlHjwJvZFUfczFljSKqZdwQtLvmczmsJSNmdrpeZ`(生产环境)
|
||||
|
||||
@@ -36,14 +36,7 @@ LobeChat provides some additional configuration options during deployment, which
|
||||
|
||||
When using the `random` mode, a random API Key will be selected from the available multiple API Keys.
|
||||
|
||||
When using the `turn` mode, the API Keys will be retrieved in a round-robin manner according to the specified order.
|
||||
|
||||
### `ENABLE_OAUTH_SSO`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Enable Single Sign-On (SSO) for LobeChat. Set to `1` to enable SSO. For more information, see [Authentication Services](#authentication-services).
|
||||
- Default: -
|
||||
- Example: `1`
|
||||
When using the `turn` mode, the API Keys will be retrieved in a polling manner according to the specified order.
|
||||
|
||||
### `NEXT_PUBLIC_BASE_PATH`
|
||||
|
||||
@@ -57,7 +50,7 @@ When using the `turn` mode, the API Keys will be retrieved in a round-robin mann
|
||||
- Type: Optional
|
||||
- Description: Used to configure the default settings for the LobeChat default agent. It supports various data types and structures, including key-value pairs, nested fields, array values, and more.
|
||||
- Default: -
|
||||
- Example: `'model=gpt-4-1106-preview;params.max_tokens=300;plugins=search-engine,lobe-image-designer`
|
||||
- Example: `'model=gpt-4-1106-preview;params.max_tokens=300;plugins=search-engine,lobe-image-designer'`
|
||||
|
||||
The `DEFAULT_AGENT_CONFIG` is used to configure the default settings for the LobeChat default agent. It supports various data types and structures, including key-value pairs, nested fields, array values, and more. The table below provides detailed information on the configuration options, examples, and corresponding explanations for the `DEFAULT_AGENT_CONFIG` environment variable:
|
||||
|
||||
@@ -68,8 +61,8 @@ The `DEFAULT_AGENT_CONFIG` is used to configure the default settings for the Lob
|
||||
| Array | `plugins=search-engine,lobe-image-designer` | Enable the `search-engine` and `lobe-image-designer` plugins. |
|
||||
| Chinese Comma | `plugins=search-engine,lobe-image-designer` | Same as above, demonstrating support for Chinese comma separation. |
|
||||
| Multiple Configurations | `model=glm-4;provider=zhipu` | Set the model to `glm-4` and the model provider to `zhipu`. |
|
||||
| Numeric Value | `params.max_tokens=300` | Set the maximum tokens to `300`. |
|
||||
| Boolean Value | `enableAutoCreateTopic=true` | Enable automatic topic creation. |
|
||||
| Numeric Value | `params.max_tokens=300`, `chatConfig.historyCount=5` | Set the maximum tokens to `300`, Set the number of historical messages to 5. |
|
||||
| Boolean Value | `chatConfig.enableAutoCreateTopic=true`, `chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | Enable automatic topic creation, History length compression threshold, number of historical records. |
|
||||
| Special Characters | `inputTemplate="Hello; I am a bot;"` | Set the input template to `Hello; I am a bot;`. |
|
||||
| Error Handling | `model=gpt-4;maxToken` | Ignore invalid entry `maxToken` and only parse `model=gpt-4`. |
|
||||
| Value Override | `model=gpt-4;model=gpt-4-1106-preview` | If a key is repeated, use the value that appears last; in this case, the value of `model` is `gpt-4-1106-preview`. |
|
||||
@@ -78,6 +71,15 @@ Further reading:
|
||||
|
||||
- [[RFC] 022 - Default Assistant Parameters Configuration via Environment Variables](https://github.com/lobehub/lobe-chat/discussions/913)
|
||||
|
||||
### `FEATURE_FLAGS`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Used to control LobeChat's feature functionalities. Supports multiple feature flags, using `+` to add a feature and `-` to disable a feature. Separate multiple feature flags with a comma `,` and enclose the entire value in quotes `"` to avoid parsing errors.
|
||||
- Default: `-`
|
||||
- Example: `"-welcome_suggest"`
|
||||
|
||||
For specific content, please refer to the [Feature Flags](/docs/self-hosting/advanced/feature-flags) documentation.
|
||||
|
||||
## Plugin Service
|
||||
|
||||
### `PLUGINS_INDEX_URL`
|
||||
|
||||
@@ -32,14 +32,7 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境
|
||||
|
||||
使用 `random` 模式下,将在多个 API Keys 中随机获取一个 API Key。
|
||||
|
||||
使用 `turn` 模式下,将按照填写的顺序,轮训获取得到 API Key。
|
||||
|
||||
### `ENABLE_OAUTH_SSO`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。有关详细信息,请参阅[身份验证服务](#身份验证服务)。
|
||||
- 默认值: `-`
|
||||
- 示例: `1`
|
||||
使用 `turn` 模式下,将按照填写的顺序,轮询获取得到 API Key。
|
||||
|
||||
### `NEXT_PUBLIC_BASE_PATH`
|
||||
|
||||
@@ -53,7 +46,7 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境
|
||||
- 类型:可选
|
||||
- 描述:用于配置 LobeChat 默认助理的默认配置。它支持多种数据类型和结构,包括键值对、嵌套字段、数组值等。
|
||||
- 默认值:`-`
|
||||
- 示例:`'model=gpt-4-1106-preview;params.max_tokens=300;plugins=search-engine,lobe-image-designer`
|
||||
- 示例:`'model=gpt-4-1106-preview;params.max_tokens=300;plugins=search-engine,lobe-image-designer'`
|
||||
|
||||
`DEFAULT_AGENT_CONFIG` 用于配置 LobeChat 默认助理的默认配置。它支持多种数据类型和结构,包括键值对、嵌套字段、数组值等。下表详细说明了 `DEFAULT_AGENT_CONFIG` 环境变量的配置项、示例以及相应解释:
|
||||
|
||||
@@ -64,8 +57,8 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境
|
||||
| 数组 | `plugins=search-engine,lobe-image-designer` | 启用 `search-engine` 和 `lobe-image-designer` 插件。 |
|
||||
| 中文逗号 | `plugins=search-engine,lobe-image-designer` | 同上,演示支持中文逗号分隔。 |
|
||||
| 多个配置项 | `model=glm-4;provider=zhipu` | 设置模型为 `glm-4` 且模型服务商为 `zhipu`。 |
|
||||
| 数字值 | `params.max_tokens=300` | 设置最大令牌数为 `300`。 |
|
||||
| 布尔值 | `enableAutoCreateTopic=true` | 启用自动创建主题。 |
|
||||
| 数字值 | `params.max_tokens=300`, `chatConfig.historyCount=5` | 设置最大令牌数为 `300`,设置历史消息条数为5。 |
|
||||
| 布尔值 | `chatConfig.enableAutoCreateTopic=true`,`chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | 启用自动创建主题,历史长度压缩阈值,历史记录条数。 |
|
||||
| 特殊字符 | `inputTemplate="Hello; I am a bot;"` | 设置输入模板为 `Hello; I am a bot;`。 |
|
||||
| 错误处理 | `model=gpt-4;maxToken` | 忽略无效条目 `maxToken`,仅解析出 `model=gpt-4`。 |
|
||||
| 值覆盖 | `model=gpt-4;model=gpt-4-1106-preview` | 如果键重复,使用最后一次出现的值,此处 `model` 的值为 `gpt-4-1106-preview`。 |
|
||||
@@ -74,6 +67,15 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境
|
||||
|
||||
- [[RFC] 022 - 环境变量配置默认助手参数](https://github.com/lobehub/lobe-chat/discussions/913)
|
||||
|
||||
### `FEATURE_FLAGS`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:用于控制 LobeChat 的特性功能,支持多个功能标志,使用 `+` 增加一个功能,使用 `-` 来关闭一个功能,多个功能标志之间使用英文逗号 `,` 隔开,最外层建议添加引号 `"` 以避免解析错误。
|
||||
- 默认值:`-`
|
||||
- 示例:`"-welcome_suggest"`
|
||||
|
||||
具体的内容可以参见 [特性标志](/zh/docs/self-hosting/advanced/feature-flags) 中的说明。
|
||||
|
||||
## 插件服务
|
||||
|
||||
### `PLUGINS_INDEX_URL`
|
||||
|
||||
@@ -15,6 +15,13 @@ When deploying LobeChat, a rich set of environment variables related to model se
|
||||
|
||||
## OpenAI
|
||||
|
||||
### `ENABLED_OPENAI`
|
||||
|
||||
- Type:Optional
|
||||
- Description:Enables OpenAI as a model provider by default, turns off the OpenAI service when set to `0`
|
||||
- Default:`1`
|
||||
- Example:`0`
|
||||
|
||||
### `OPENAI_API_KEY`
|
||||
|
||||
- Type: Required
|
||||
@@ -125,6 +132,13 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
|
||||
## AWS Bedrock
|
||||
|
||||
### `ENABLED_AWS_BEDROCK`
|
||||
|
||||
- Type:Optional
|
||||
- Description:Enables AWS Bedrock as a model provider by default, turns on the AWS Bedrock service when set to `1`
|
||||
- Default:`0`
|
||||
- Example:`1`
|
||||
|
||||
### `AWS_ACCESS_KEY_ID`
|
||||
|
||||
- Type: Required
|
||||
@@ -146,6 +160,15 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Default: `us-east-1`
|
||||
- Example: `us-east-1`
|
||||
|
||||
## DeepSeek AI
|
||||
|
||||
### `DEEPSEEK_API_KEY`
|
||||
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied for in the DeepSeek AI service
|
||||
- Default: -
|
||||
- Example: `sk-xxxxxx...xxxxxx`
|
||||
|
||||
## OpenRouter AI
|
||||
|
||||
### `OPENROUTER_API_KEY`
|
||||
@@ -153,7 +176,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied for in the OpenRouter AI service
|
||||
- Default: -
|
||||
- Example: `sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=`
|
||||
- Example: `sk-or-v1-xxxxxx...xxxxxx=`
|
||||
|
||||
### `OPENROUTER_MODEL_LIST`
|
||||
|
||||
@@ -169,7 +192,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied for in the TogetherAI service
|
||||
- Default: -
|
||||
- Example: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
- Example: `xxxxxx...xxxxxx`
|
||||
|
||||
### `TOGETHERAI_MODEL_LIST`
|
||||
|
||||
@@ -180,6 +203,13 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
|
||||
## Ollama
|
||||
|
||||
### `ENABLED_OLLAMA`
|
||||
|
||||
- Type:Optional
|
||||
- Description:Enables Ollama as a model provider by default, turns off the Ollama service when set to `0`
|
||||
- Default:`1`
|
||||
- Example:`0`
|
||||
|
||||
### `OLLAMA_PROXY_URL`
|
||||
|
||||
- Type: Required
|
||||
@@ -210,7 +240,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied from Perplexity AI
|
||||
- Default: -
|
||||
- Example: `pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
- Example: `pplx-xxxxxx...xxxxxx`
|
||||
|
||||
## Minimax AI
|
||||
|
||||
@@ -219,7 +249,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied for in the Minimax AI service
|
||||
- Default: -
|
||||
- Example: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
- Example: `xxxxxx...xxxxxx`
|
||||
|
||||
## Mistral AI
|
||||
|
||||
@@ -228,7 +258,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied for in the Mistral AI service
|
||||
- Default: -
|
||||
- Example: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=`
|
||||
- Example: `xxxxxx...xxxxxx=`
|
||||
|
||||
## Groq AI
|
||||
|
||||
@@ -237,7 +267,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied from Groq AI
|
||||
- Default: -
|
||||
- Example: `gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
- Example: `gsk_xxxxxx...xxxxxx`
|
||||
|
||||
## ZHIPU AI
|
||||
|
||||
@@ -255,6 +285,15 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied for in the 01.AI service
|
||||
- Default: -
|
||||
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
- Example:`xxxxxx...xxxxxx`
|
||||
|
||||
## Qwen
|
||||
|
||||
### `QWEN_API_KEY`
|
||||
|
||||
- Type: Required
|
||||
- Description: This is the DashScope API key you can obtain from Alibaba Cloud
|
||||
- Default: -
|
||||
- Example:`sk-xxxxx...xxxxx`
|
||||
|
||||
[model-list]: /docs/self-hosting/advanced/model-list
|
||||
|
||||
@@ -15,6 +15,13 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
|
||||
## OpenAI
|
||||
|
||||
### `ENABLED_OPENAI`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:默认启用 OpenAI 作为模型供应商,当设为 0 时关闭 OpenAI 服务
|
||||
- 默认值:`1`
|
||||
- 示例:`0`
|
||||
|
||||
### `OPENAI_API_KEY`
|
||||
|
||||
- 类型:必选
|
||||
@@ -123,6 +130,13 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
|
||||
## AWS Bedrock
|
||||
|
||||
### `ENABLED_AWS_BEDROCK`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:当设为 1 时启用 AWS Bedrock 服务
|
||||
- 默认值:`0`
|
||||
- 示例:`1`
|
||||
|
||||
### `AWS_ACCESS_KEY_ID`
|
||||
|
||||
- 类型:必选
|
||||
@@ -144,6 +158,15 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 默认值:`us-east-1`
|
||||
- 示例:`us-east-1`
|
||||
|
||||
## DeepSeek AI
|
||||
|
||||
### `DEEPSEEK_API_KEY`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:这是你在 DeepSeek AI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`sk-xxxxxx...xxxxxx`
|
||||
|
||||
## OpenRouter AI
|
||||
|
||||
### `OPENROUTER_API_KEY`
|
||||
@@ -151,7 +174,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在 OpenRouter AI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=`
|
||||
- 示例:`sk-or-v1-xxxxxx...xxxxxx=`
|
||||
|
||||
### `OPENROUTER_MODEL_LIST`
|
||||
|
||||
@@ -167,7 +190,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在 TogetherAI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
- 示例:`xxxxxx...xxxxxx`
|
||||
|
||||
### `TOGETHERAI_MODEL_LIST`
|
||||
|
||||
@@ -178,6 +201,13 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
|
||||
## Ollama
|
||||
|
||||
### `ENABLED_OLLAMA`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:默认启用 Ollama 作为模型供应商,当设为 0 时关闭 Ollama 服务
|
||||
- 默认值:`1`
|
||||
- 示例:`0`
|
||||
|
||||
### `OLLAMA_PROXY_URL`
|
||||
|
||||
- 类型:必选
|
||||
@@ -208,7 +238,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在 Perplexity AI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
- 示例:`pplx-xxxxxx...xxxxxx`
|
||||
|
||||
## Minimax AI
|
||||
|
||||
@@ -217,7 +247,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在 Minimax AI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
- 示例:`xxxxxx...xxxxxx`
|
||||
|
||||
## Mistral AI
|
||||
|
||||
@@ -226,7 +256,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在 Mistral AI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=`
|
||||
- 示例:`xxxxxx...xxxxxx=`
|
||||
|
||||
## Groq AI
|
||||
|
||||
@@ -235,7 +265,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在 Groq AI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
- 示例:`gsk_xxxxxx...xxxxxx`
|
||||
|
||||
## 智谱 AI
|
||||
|
||||
@@ -253,6 +283,15 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在零一万物服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
- 示例:`xxxxxx...xxxxxx`
|
||||
|
||||
[model-list]: /docs/self-hosting/advanced/model-list
|
||||
|
||||
## 通义千问
|
||||
|
||||
### `QWEN_API_KEY`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:这是你在阿里云百炼平台上获取的 DashScope API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`sk-xxxxx...xxxxx`
|
||||
|
||||
@@ -27,7 +27,7 @@ First, you need to install Ollama. For detailed steps on installing and configur
|
||||
Assuming you have already started the Ollama service locally on port `11434`. Run the following Docker command to start LobeChat locally:
|
||||
|
||||
```bash
|
||||
docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434/v1 lobehub/lobe-chat
|
||||
docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434 lobehub/lobe-chat
|
||||
```
|
||||
|
||||
Now, you can use LobeChat to converse with the local LLM.
|
||||
@@ -40,13 +40,13 @@ When you first initiate Ollama, it is configured to allow access only from the l
|
||||
|
||||
### Ollama Environment Variables
|
||||
|
||||
| Environment Variable | Description | Default Value | Additional Information |
|
||||
| -------------------- | ----------------------------------- | --------------------------------------------------- | ---------------------------------------------------- |
|
||||
| `OLLAMA_HOST` | Specifies the host and port for binding | "127.0.0.1:11434" | Use "0.0.0.0:port" to make the service accessible from any machine |
|
||||
| `OLLAMA_ORIGINS` | Comma-separated list of permitted cross-origin sources | Restricted to local access | Set to "*" to avoid CORS, please set on demand |
|
||||
| `OLLAMA_MODELS` | Path to the directory where models are located | "~/.ollama/models" or "/usr/share/ollama/.ollama/models" | Can be customized based on requirements |
|
||||
| `OLLAMA_KEEP_ALIVE` | Duration that the model stays loaded in GPU memory | "5m" | Dynamically loading and unloading models can reduce GPU load but may increase disk I/O |
|
||||
| `OLLAMA_DEBUG` | Enable additional debugging logs by setting to 1 | Typically disabled | |
|
||||
| Environment Variable | Description | Default Value | Additional Information |
|
||||
| --- | --- | --- | --- |
|
||||
| `OLLAMA_HOST` | Specifies the host and port for binding | "127.0.0.1:11434" | Use "0.0.0.0:port" to make the service accessible from any machine |
|
||||
| `OLLAMA_ORIGINS` | Comma-separated list of permitted cross-origin sources | Restricted to local access | Set to "\*" to avoid CORS, please set on demand |
|
||||
| `OLLAMA_MODELS` | Path to the directory where models are located | "~/.ollama/models" or "/usr/share/ollama/.ollama/models" | Can be customized based on requirements |
|
||||
| `OLLAMA_KEEP_ALIVE` | Duration that the model stays loaded in GPU memory | "5m" | Dynamically loading and unloading models can reduce GPU load but may increase disk I/O |
|
||||
| `OLLAMA_DEBUG` | Enable additional debugging logs by setting to 1 | Typically disabled | |
|
||||
|
||||
### Setting environment variables on Windows
|
||||
|
||||
@@ -64,10 +64,10 @@ If Ollama is run as a macOS application, environment variables should be set usi
|
||||
|
||||
1. For each environment variable, call `launchctl setenv`.
|
||||
|
||||
```bash
|
||||
launchctl setenv OLLAMA_HOST "0.0.0.0"
|
||||
launchctl setenv OLLAMA_ORIGINS "*"
|
||||
```
|
||||
```bash
|
||||
launchctl setenv OLLAMA_HOST "0.0.0.0"
|
||||
launchctl setenv OLLAMA_ORIGINS "*"
|
||||
```
|
||||
|
||||
2. Restart Ollama application.
|
||||
|
||||
@@ -77,25 +77,25 @@ If Ollama is run as a systemd service, environment variables should be set using
|
||||
|
||||
1. Edit the systemd service by calling `sudo systemctl edit ollama.service`.
|
||||
|
||||
```bash
|
||||
sudo systemctl edit ollama.service
|
||||
```
|
||||
```bash
|
||||
sudo systemctl edit ollama.service
|
||||
```
|
||||
|
||||
2. For each environment variable, add a line `Environment` under section `[Service]`:
|
||||
|
||||
```bash
|
||||
[Service]
|
||||
Environment="OLLAMA_HOST=0.0.0.0"
|
||||
Environment="OLLAMA_ORIGINS=*"
|
||||
```
|
||||
```bash
|
||||
[Service]
|
||||
Environment="OLLAMA_HOST=0.0.0.0"
|
||||
Environment="OLLAMA_ORIGINS=*"
|
||||
```
|
||||
|
||||
3. Save and exit.
|
||||
4. Reload `systemd` and restart Ollama:
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart ollama
|
||||
```
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart ollama
|
||||
```
|
||||
|
||||
### Setting environment variables on Docker
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ Ollama 是一款强大的本地运行大型语言模型(LLM)的框架,支
|
||||
假设你已经在本地 `11434` 端口启动了 Ollama 服务。运行以下 Docker 命令行,在本地启动 LobeChat:
|
||||
|
||||
```bash
|
||||
docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434/v1 lobehub/lobe-chat
|
||||
docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434 lobehub/lobe-chat
|
||||
```
|
||||
|
||||
接下来,你就可以使用 LobeChat 与本地 LLM 对话了。
|
||||
@@ -38,13 +38,13 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434
|
||||
|
||||
### Ollama 环境变量
|
||||
|
||||
| 环境变量 | 描述 | 默认值 | 附加说明 |
|
||||
| ---------- | -------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
||||
| `OLLAMA_HOST` | 绑定的主机和端口 | "127.0.0.1:11434" | 设置 0.0.0.0:端口号 可以指定所有人访问特定端口 |
|
||||
| `OLLAMA_ORIGINS` | 允许的跨域源列表,逗号分隔 | 仅本地访问 | 设置 "*" 可以避免 CORS 跨域错误,按需设置 |
|
||||
| `OLLAMA_MODELS` | 模型存放的路径 | "~/.ollama/models" 或 "/usr/share/ollama/.ollama/models" | 按需指定 |
|
||||
| `OLLAMA_KEEP_ALIVE` | 模型在显存中保持加载的持续时间 | "5m" | 按需加载和释放显存可以有效降低显卡压力,但会增加硬盘读写 |
|
||||
| `OLLAMA_DEBUG` | 设置为 1 以启用额外的调试日志 | 默认关闭 | |
|
||||
| 环境变量 | 描述 | 默认值 | 附加说明 |
|
||||
| --- | --- | --- | --- |
|
||||
| `OLLAMA_HOST` | 绑定的主机和端口 | "127.0.0.1:11434" | 设置 0.0.0.0:端口号 可以指定所有人访问特定端口 |
|
||||
| `OLLAMA_ORIGINS` | 允许的跨域源列表,逗号分隔 | 仅本地访问 | 设置 "\*" 可以避免 CORS 跨域错误,按需设置 |
|
||||
| `OLLAMA_MODELS` | 模型存放的路径 | "~/.ollama/models" 或 "/usr/share/ollama/.ollama/models" | 按需指定 |
|
||||
| `OLLAMA_KEEP_ALIVE` | 模型在显存中保持加载的持续时间 | "5m" | 按需加载和释放显存可以有效降低显卡压力,但会增加硬盘读写 |
|
||||
| `OLLAMA_DEBUG` | 设置为 1 以启用额外的调试日志 | 默认关闭 | |
|
||||
|
||||
### 在 Windows 上设置环境变量
|
||||
|
||||
@@ -62,10 +62,10 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434
|
||||
|
||||
1. 对于每个环境变量,调用 `launchctl setenv`。
|
||||
|
||||
```bash
|
||||
launchctl setenv OLLAMA_HOST "0.0.0.0"
|
||||
launchctl setenv OLLAMA_ORIGINS "*"
|
||||
```
|
||||
```bash
|
||||
launchctl setenv OLLAMA_HOST "0.0.0.0"
|
||||
launchctl setenv OLLAMA_ORIGINS "*"
|
||||
```
|
||||
|
||||
2. 重启 Ollama 应用程序。
|
||||
|
||||
@@ -75,29 +75,28 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434
|
||||
|
||||
1. 通过调用`sudo systemctl edit ollama.service`编辑 systemd 服务。
|
||||
|
||||
```bash
|
||||
sudo systemctl edit ollama.service
|
||||
```
|
||||
```bash
|
||||
sudo systemctl edit ollama.service
|
||||
```
|
||||
|
||||
2. 对于每个环境变量,在`[Service]`部分下添加`Environment`:
|
||||
|
||||
```bash
|
||||
[Service]
|
||||
Environment="OLLAMA_HOST=0.0.0.0"
|
||||
Environment="OLLAMA_ORIGINS=*"
|
||||
```
|
||||
```bash
|
||||
[Service]
|
||||
Environment="OLLAMA_HOST=0.0.0.0"
|
||||
Environment="OLLAMA_ORIGINS=*"
|
||||
```
|
||||
|
||||
3. 保存并退出。
|
||||
4. 重载`systemd`并重启 Ollama:
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart ollama
|
||||
```
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart ollama
|
||||
```
|
||||
|
||||
### 在 Docker 上设置环境变量
|
||||
|
||||
如果 Ollama 作为 Docker 容器运行,你可以将环境变量添加到 `docker run` 命令中。
|
||||
|
||||
详细配置方法可以参考 [Ollama 官方文档](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-configure-ollama-server)。
|
||||
|
||||
|
||||
@@ -67,7 +67,6 @@ services:
|
||||
OPENAI_API_KEY: sk-xxxx
|
||||
OPENAI_PROXY_URL: https://api-proxy.com/v1
|
||||
ACCESS_CODE: lobe66
|
||||
|
||||
```
|
||||
|
||||
运行以下命令启动 Lobe Chat 服务:
|
||||
@@ -92,7 +91,7 @@ output=$(docker pull lobehub/lobe-chat:latest 2>&1)
|
||||
|
||||
# Check if the pull command was executed successfully
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if the output contains a specific string
|
||||
@@ -100,7 +99,7 @@ echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest"
|
||||
|
||||
# If the image is already up to date, do nothing
|
||||
if [ $? -eq 0 ]; then
|
||||
exit 0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Detected Lobe-Chat update"
|
||||
|
||||
@@ -41,6 +41,6 @@ Vercel's assigned domain DNS may be polluted in some regions, so binding a custo
|
||||
If you have deployed your project using the one-click deployment steps mentioned above, you may find that you are always prompted with "updates available." This is because Vercel creates a new project for you by default instead of forking this project, which causes the inability to accurately detect updates.
|
||||
|
||||
<Callout>
|
||||
We recommend following the [Self-Hosting Upstream Sync](/docs/self-hosting/advanced/upstream-sync) steps to
|
||||
Redeploy.
|
||||
We recommend following the [Self-Hosting Upstream Sync](/docs/self-hosting/advanced/upstream-sync)
|
||||
steps to Redeploy.
|
||||
</Callout>
|
||||
|
||||
@@ -40,7 +40,8 @@ Vercel 分配的域名 DNS 在某些区域被污染了,绑定自定义域名
|
||||
如果你根据上述中的一键部署步骤部署了自己的项目,你可能会发现总是被提示 “有可用更新”。这是因为 Vercel 默认为你创建新项目而非 fork 本项目,这将导致无法准确检测更新。
|
||||
|
||||
<Callout>
|
||||
我们建议按照 [📘 LobeChat 自部署保持更新](/docs/self-hosting/advanced/upstream-sync) 步骤重新部署。
|
||||
我们建议按照 [📘 LobeChat 自部署保持更新](/docs/self-hosting/advanced/upstream-sync)
|
||||
步骤重新部署。
|
||||
</Callout>
|
||||
|
||||
[deploy-button-image]: https://vercel.com/button
|
||||
|
||||
@@ -35,3 +35,50 @@ You can use the subdomain provided by Zeabur, or choose to bind a custom domain.
|
||||
|
||||
[deploy-button-image]: https://zeabur.com/button.svg
|
||||
[deploy-link]: https://zeabur.com/templates/VZGGTI
|
||||
|
||||
# Deploy LobeChat with Zeabur as serverless function
|
||||
|
||||
> Note: There are still issues with [middlewares and rewrites of next.js on Zeabur](https://github.com/lobehub/lobe-chat/pull/2775?notification_referrer_id=NT_kwDOAdi2DrQxMDkyODQ4MDc2NTozMDk3OTU5OA#issuecomment-2146713899), use at your own risk!
|
||||
|
||||
Since Zeabur does NOT officially support FREE users deploy containerized service, you may wish to deploy LobeChat as a serverless function service. To deploy LobeChat as a serverless function service on Zeabur, you can follow the steps below:
|
||||
|
||||
## Zeabur Deployment Process
|
||||
|
||||
<Steps>
|
||||
|
||||
### Fork LobeChat
|
||||
|
||||
### Add Zeabur pack config file
|
||||
|
||||
Add a `zbpack.json` configuration file with the following content to the root dir of your fork:
|
||||
|
||||
```json
|
||||
{
|
||||
"ignore_dockerfile": true,
|
||||
"serverless": true
|
||||
}
|
||||
```
|
||||
|
||||
### Prepare your OpenAI API Key
|
||||
|
||||
Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key.
|
||||
|
||||
### Login to your [Zeabur dashboard](https://dash.zeabur.com)
|
||||
|
||||
If you do not already have an account, you will need to register one.
|
||||
|
||||
### Create a project and service
|
||||
|
||||
Create a project, then create a service under this project.
|
||||
|
||||
### Link your fork of LobeChat to the just created Zeabur service.
|
||||
|
||||
When adding service, choose github. This may triger a oAuth depend on varies factors like how you login to Zeabur and if you have already authorized Zeabur to access all your repos
|
||||
|
||||
### Bind a custom domain (optional)
|
||||
|
||||
You can create a subdomain provided by Zeabur, or choose to bind a custom domain. Currently, the domains provided by Zeabur have not been contaminated, and most regions can connect directly.
|
||||
|
||||
### Zeabur shall start auto build and you should be able to access it by the domain of your choice after a while.
|
||||
|
||||
</Steps>
|
||||
|
||||
@@ -34,3 +34,50 @@ tags:
|
||||
|
||||
[deploy-button-image]: https://zeabur.com/button.svg
|
||||
[deploy-link]: https://zeabur.com/templates/VZGGTI
|
||||
|
||||
# 使用 Zeabur 将 LobeChat 部署为无服务器函数
|
||||
|
||||
> **注意:** 仍然存在关于 [Zeabur 上 next.js 的中间件和重写问题](https://github.com/lobehub/lobe-chat/pull/2775?notification_referrer_id=NT_kwDOAdi2DrQxMDkyODQ4MDc2NTozMDk3OTU5OA#issuecomment-2146713899),请自担风险!
|
||||
|
||||
由于 Zeabur 并未官方支持免费用户部署容器化服务,您可能希望将 LobeChat 部署为无服务器函数服务。要在 Zeabur 上将 LobeChat 部署为无服务器函数服务,您可以按照以下步骤操作:
|
||||
|
||||
## Zeabur 部署流程
|
||||
|
||||
<Steps>
|
||||
|
||||
### Fork LobeChat
|
||||
|
||||
### 添加 Zeabur 打包配置文件
|
||||
|
||||
在您的分支的根目录下添加一个 `zbpack.json` 配置文件,内容如下:
|
||||
|
||||
```json
|
||||
{
|
||||
"ignore_dockerfile": true,
|
||||
"serverless": true
|
||||
}
|
||||
```
|
||||
|
||||
### 准备您的 OpenAI API 密钥
|
||||
|
||||
前往 [OpenAI API 密钥](https://platform.openai.com/account/api-keys) 获取您的 OpenAI API 密钥。
|
||||
|
||||
### 登录到您的 [Zeabur 仪表板](https://dash.zeabur.com)
|
||||
|
||||
如果您尚未拥有一个账号,您需要注册一个。
|
||||
|
||||
### 创建项目与服务。
|
||||
|
||||
创建一个项目,并再这个项目下新建一个服务。
|
||||
|
||||
### 将您的 LobeChat 分支链接到刚创建的 Zeabur 服务。
|
||||
|
||||
在添加服务时,选择 github。这可能会触发一个 oAuth,取决于诸如您如何登录到 Zeabur以及您是否已经授权 Zeabur 访问所有您的存储库等各种因素。
|
||||
|
||||
### 绑定自定义域名(可选)
|
||||
|
||||
您可以创建 Zeabur 提供的子域名,或选择绑定自定义域名。目前,Zeabur 提供的域名尚未受到污染,大多数地区可以直接连接。
|
||||
|
||||
### Zeabur 将开始自动构建,您应该可以在一段时间后通过您选择的域名访问它。
|
||||
|
||||
</Steps>
|
||||
|
||||
@@ -57,7 +57,7 @@ The second prompt generates longer output and better structure. The use of the t
|
||||
- **Be Clear About Your Needs:** The model's output will strive to meet your needs, so if your needs are not clear, the output may not meet expectations.
|
||||
- **Use Correct Grammar and Spelling:** The model will try to mimic your language style, so if your language style is problematic, the output may also be problematic.
|
||||
- **Provide Sufficient Contextual Information:** The model will generate output based on the contextual information you provide, so if the information is insufficient, it may not produce the desired results.
|
||||
|
||||
|
||||
</Callout>
|
||||
|
||||
After formulating effective prompts for discussing issues, you now need to refine the generated results. This may involve adjusting the output to fit constraints such as word count or combining concepts from different generated results.
|
||||
|
||||
@@ -53,7 +53,7 @@ tags:
|
||||
- **尽量明确你的需求:** 模型的输出会尽可能满足你的需求,所以如果你的需求不明确,输出可能会不如预期。
|
||||
- **使用正确的语法和拼写:** 模型会尽可能模仿你的语言风格,所以如果你的语言风格有问题,输出可能也会有问题。
|
||||
- **提供足够的上下文信息:** 模型会根据你提供的上下文信息生成输出,所以如果你提供的上下文信息不足,可能无法生成你想要的结果。
|
||||
|
||||
|
||||
</Callout>
|
||||
|
||||
在为讨论问题制定有效的提示后,您现在需要细化生成的结果。这可能涉及到调整输出以符合诸如字数等限制,或将不同生成的结果的概念组合在一起。
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
---
|
||||
title: Support Multi-User Management - Identity Verification Solutions
|
||||
description: >-
|
||||
Explore LobeChat's user authentication solutions with next-auth and Clerk for
|
||||
flexible and secure user management. Learn about features like user
|
||||
registration, session management, multi-factor authentication, and more.
|
||||
tags:
|
||||
- Multi-User Management
|
||||
- Identity Verification
|
||||
- next-auth
|
||||
- Clerk
|
||||
- User Authentication
|
||||
- Session Management
|
||||
- Multi-Factor Authentication
|
||||
- User Management
|
||||
---
|
||||
|
||||
# Support Multi-User Management
|
||||
|
||||
<Image
|
||||
alt={'Identity Verification System'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/8ce70e15-40df-451e-b700-66090fe5b8c2'}
|
||||
/>
|
||||
|
||||
In modern applications, user management and identity verification are essential functions. To meet the diverse needs of different users, LobeChat provides two main user authentication and management solutions: `next-auth` and `Clerk`. Whether you are looking for simple user registration and login or need advanced multi-factor authentication and user management, LobeChat can flexibly accommodate your requirements.
|
||||
|
||||
## next-auth: Flexible and Powerful Identity Verification Library
|
||||
|
||||
LobeChat integrates `next-auth`, a flexible and powerful identity verification library that supports various authentication methods, including OAuth, email login, and credential login. With `next-auth`, you can easily achieve the following functions:
|
||||
|
||||
- **User Registration and Login**: Support various authentication methods to meet different user needs.
|
||||
- **Session Management**: Efficiently manage user sessions to ensure security.
|
||||
- **Social Login**: Support quick login via various social platforms.
|
||||
- **Data Security**: Ensure the security and privacy of user data.
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Due to workload constraints, integration of next-auth with a server-side database has not been
|
||||
implemented yet. If you need to use a server-side database, please use Clerk.
|
||||
</Callout>
|
||||
|
||||
<Callout type={'info'}>
|
||||
For information on using Next-Auth, you can refer to [Authentication Services - Next
|
||||
Auth](/docs/self-hosting/advanced/authentication#next-auth).
|
||||
</Callout>
|
||||
|
||||
## Clerk: Modern User Management Platform
|
||||
|
||||
For users requiring advanced user management features, LobeChat also supports [Clerk](https://clerk.com), a modern user management platform. Clerk offers richer functionality to help you achieve higher security and flexibility:
|
||||
|
||||
- **Multi-Factor Authentication (MFA)**: Provides higher security protection.
|
||||
- **User Profile Management**: Conveniently manage user information and configurations.
|
||||
- **Login Activity Monitoring**: Real-time monitoring of user login activities to ensure account security.
|
||||
- **Scalability**: Supports complex user management requirements.
|
||||
|
||||
<Callout type={'info'}>
|
||||
For information on using Clerk, you can refer to [Authentication Services -
|
||||
Clerk](/docs/self-hosting/advanced/authentication#clerk) .
|
||||
</Callout>
|
||||
|
||||
<Callout type={'tip'}>
|
||||
If you need to use Clerk in conjunction with a server-side database, you can refer to the
|
||||
"Configuring Authentication Services" section in [Deploying with a Server-Side
|
||||
Database](/docs/self-hosting/advanced/server-database).
|
||||
</Callout>
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
title: 多用户管理支持
|
||||
description: LobeChat 提供了多种用户认证和管理方案,以满足不同用户的需求。
|
||||
tags:
|
||||
- LobeChat
|
||||
- 用户管理
|
||||
- next-auth
|
||||
- Clerk
|
||||
- 身份验证
|
||||
- 多因素认证
|
||||
---
|
||||
|
||||
# 身份验证系统 / 多用户管理支持
|
||||
|
||||
<Image
|
||||
alt={'身份验证系统'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/8ce70e15-40df-451e-b700-66090fe5b8c2'}
|
||||
/>
|
||||
|
||||
在现代应用中,用户管理和身份验证是至关重要的功能。为满足不同用户的多样化需求,LobeChat 提供了两种主要的用户认证和管理方案:`next-auth` 和 `Clerk`。无论您是追求简便的用户注册登录,还是需要更高级的多因素认证和用户管理,LobeChat 都可以灵活实现。
|
||||
|
||||
## next-auth:灵活且强大的身份验证库
|
||||
|
||||
LobeChat 集成了 `next-auth`,一个灵活且强大的身份验证库,支持多种身份验证方式,包括 OAuth、邮件登录、凭证登录等。通过 `next-auth`,您可以轻松实现以下功能:
|
||||
|
||||
- **用户注册和登录**:支持多种认证方式,满足不同用户的需求。
|
||||
- **会话管理**:高效管理用户会话,确保安全性。
|
||||
- **社交登录**:支持多种社交平台的快捷登录。
|
||||
- **数据安全**:保障用户数据的安全性和隐私性。
|
||||
|
||||
<Callout type={'warning'}>
|
||||
由于工作量原因,目前还没有实现 next-auth 与服务端数据库的集成,如果需要使用服务端数据库,请使用
|
||||
Clerk 。
|
||||
</Callout>
|
||||
|
||||
<Callout type={'info'}>
|
||||
关于 Next-Auth 的使用,可以查阅 [身份验证服务 - Next
|
||||
Auth](/zh/docs/self-hosting/advanced/authentication#next-auth)。
|
||||
</Callout>
|
||||
|
||||
## Clerk:现代化用户管理平台
|
||||
|
||||
对于需要更高级用户管理功能的用户,LobeChat 还支持 [Clerk](https://clerk.com) ,一个现代化的用户管理平台。Clerk 提供了更丰富的功能,帮助您实现更高的安全性和灵活性:
|
||||
|
||||
- **多因素认证 (MFA)**:提供更高的安全保障。
|
||||
- **用户配置文件管理**:便捷管理用户信息和配置。
|
||||
- **登录活动监控**:实时监控用户登录活动,确保账户安全。
|
||||
- **扩展性**:支持复杂的用户管理需求。
|
||||
|
||||
<Callout type={'info'}>
|
||||
关于 Clerk 的使用,可以查阅 [身份验证服务 -
|
||||
Clerk](/zh/docs/self-hosting/advanced/authentication#clerk)。
|
||||
</Callout>
|
||||
|
||||
<Callout type={'tip'}>
|
||||
如果需要在服务端数据库中搭配使用 Clerk 的使用,可以查阅
|
||||
[使用服务端数据库部署](/zh/docs/self-hosting/advanced/server-database)
|
||||
中的「配置身份验证服务」部分。
|
||||
</Callout>
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
title: Local / Cloud Database Solutions for LobeChat
|
||||
description: >-
|
||||
Explore the options of local and server-side databases for LobeChat, offering
|
||||
data control, privacy protection, and convenient user experiences.
|
||||
tags:
|
||||
- Local Database
|
||||
- Server-Side Database
|
||||
- Data Privacy
|
||||
- Data Control
|
||||
- CRDT Technology
|
||||
- PostgreSQL
|
||||
- Dirzzle ORM
|
||||
- Clerk Authentication
|
||||
---
|
||||
|
||||
# Local / Cloud Database
|
||||
|
||||
<Image
|
||||
alt={'Local / Cloud Database'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/c27a0234-a4e9-40e5-8bcb-42d5ce7e40f9'}
|
||||
/>
|
||||
|
||||
In modern application development, the choice of data storage solution is crucial. To meet the needs of different users, LobeChat offers flexible configurations that support both local and server-side databases. Whether you prioritize data privacy and control or seek a convenient user experience, LobeChat can provide excellent solutions for you.
|
||||
|
||||
## Local Database: Data Control and Privacy Protection
|
||||
|
||||
For users who prefer more control over their data and value privacy protection, LobeChat offers support for local databases. By using IndexedDB as the storage solution and combining it with dexie as an Object-Relational Mapping (ORM) tool, LobeChat achieves efficient data management.
|
||||
|
||||
Additionally, we have introduced Conflict-Free Replicated Data Type (CRDT) technology to ensure a seamless multi-device synchronization experience. This experimental feature aims to provide users with greater autonomy and data security.
|
||||
|
||||
<Callout type={'info'}>
|
||||
LobeChat defaults to the local database solution to reduce the onboarding cost for new users.
|
||||
</Callout>
|
||||
|
||||
Furthermore, we have attempted to introduce CRDT technology to achieve cross-device synchronization based on the local database. This experimental feature aims to provide users with greater autonomy and data security.
|
||||
|
||||
## Server-Side Database: Convenient and Efficient User Experience
|
||||
|
||||
For users who seek a convenient user experience, LobeChat supports PostgreSQL as the server-side database. By managing data with Dirzzle ORM and combining it with Clerk for authentication, LobeChat can offer users an efficient and reliable server-side data management solution.
|
||||
|
||||
### Server-Side Database Technology Stack
|
||||
|
||||
- **DB**: PostgreSQL (Neon is the default)
|
||||
- **ORM**: Dirzzle ORM
|
||||
- **Auth**: Clerk
|
||||
- **Server Router**: tRPC
|
||||
|
||||
## Deployment Solution Selection Guide
|
||||
|
||||
### 1. Local Database
|
||||
|
||||
The local database solution is suitable for users who wish to have strict control over their data. With LobeChat's support for local databases, you can securely store and manage data without relying on external servers. This solution is particularly suitable for users with high requirements for data privacy.
|
||||
|
||||
### 2. Server-Side Database
|
||||
|
||||
The server-side database solution is ideal for users who want to simplify data management processes and enjoy a convenient user experience. Through server-side databases and user authentication, LobeChat can ensure the security and efficiency of data. If you want to learn how to configure a server-side database, please refer to our [detailed documentation](/docs/self-hosting/advanced/server-database).
|
||||
|
||||
Whether you choose a local database or a server-side database, LobeChat can provide you with an excellent user experience.
|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
title: LobeChat 支持本地 / 云端数据库存储
|
||||
description: LobeChat 支持本地 / 云端数据存储,既能实现 Local First,同时支持数据云同步。
|
||||
tags:
|
||||
- LobeChat
|
||||
- IndexedDB
|
||||
- Postgres
|
||||
- Local First
|
||||
- 数据云同步
|
||||
- 数据库
|
||||
---
|
||||
|
||||
# 本地 / 云端数据存储
|
||||
|
||||
<Image
|
||||
alt={'本地 / 云端数据存储'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/c27a0234-a4e9-40e5-8bcb-42d5ce7e40f9'}
|
||||
/>
|
||||
|
||||
在现代应用开发中,数据存储方案的选择至关重要。为了满足不同用户的需求,LobeChat 提供了同时支持本地数据库和服务端数据库的灵活配置。无论您是注重数据隐私与掌控,还是追求便捷的使用体验,LobeChat 都能为您提供卓越的解决方案。
|
||||
|
||||
## 本地数据库:数据掌控与隐私保护
|
||||
|
||||
对于希望对数据有更多掌控感和隐私保护的用户,LobeChat 提供了本地数据库支持。采用 IndexedDB 作为存储解决方案,并结合 dexie 作为 ORM(对象关系映射),LobeChat 实现了高效的数据管理。
|
||||
|
||||
同时,我们引入了 CRDT(Conflict-Free Replicated Data Type)技术,确保多端同步功能的无缝体验。这一实验性功能旨在为用户提供更高的自主性和数据安全性。
|
||||
|
||||
<Callout type={'info'}>LobeChat 默认采取本地数据库方案,以降低新用户的上手成本。</Callout>
|
||||
|
||||
此外,我们尝试引入了 CRDT(Conflict-Free Replicated Data Type)技术,在本地数据库基础上实现了跨端同步。这一实验性功能旨在为用户提供更高的自主性和数据安全性。
|
||||
|
||||
## 服务端数据库:便捷与高效的使用体验
|
||||
|
||||
对于追求便捷使用体验的用户,LobeChat 支持 PostgreSQL 作为服务端数据库。通过 Dirzzle ORM 管理数据,结合 Clerk 进行身份验证,LobeChat 能够为用户提供高效、可靠的服务端数据管理方案。
|
||||
|
||||
### 服务端数据库技术栈
|
||||
|
||||
- **DB**: PostgreSQL(默认使用 Neon)
|
||||
- **ORM**: Dirzzle ORM
|
||||
- **Auth**: Clerk
|
||||
- **Server Router**: tRPC
|
||||
|
||||
## 部署方案选择指南
|
||||
|
||||
### 1. 本地数据库
|
||||
|
||||
本地数据库方案适用于那些希望对数据进行严格控制的用户。通过 LobeChat 的本地数据库支持,您可以在不依赖外部服务器的情况下,安全地存储和管理数据。这一方案特别适合对数据隐私有高要求的用户。
|
||||
|
||||
### 2. 服务端数据库
|
||||
|
||||
服务端数据库方案则适合那些希望简化数据管理流程,享受便捷使用体验的用户。通过服务端数据库与用户身份验证,LobeChat 能够确保数据的安全性与高效性。如果您希望了解如何配置服务端数据库,请参考我们的[详细文档](/zh/docs/self-hosting/advanced/server-database)。
|
||||
|
||||
无论选择本地数据库还是服务端数据库,LobeChat 都能为你提供卓越的用户体验。
|
||||
@@ -49,3 +49,8 @@ Compared to cloud-based solutions, a local LLM provides higher privacy and secur
|
||||
### Embark on Your LobeChat & Ollama AI Journey
|
||||
|
||||
Now, let's embark on this exciting journey together! Through the collaboration of LobeChat and Ollama AI, explore the endless possibilities brought by AI. Whether you are a tech enthusiast or simply curious about AI communication, LobeChat will offer you an unprecedented experience.
|
||||
|
||||
<Cards>
|
||||
<Card href={'/docs/usage/providers'} title={'Using Multiple Model Providers'} />
|
||||
<Card href={'/docs/usage/providers/ollama'} title={'Using Ollama Local Model'} />
|
||||
</Cards>
|
||||
|
||||
@@ -41,3 +41,8 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434
|
||||
### 开启您的 LobeChat & Ollama AI 之旅
|
||||
|
||||
现在,就让我们一起开启这段激动人心的旅程吧!通过 LobeChat 与 Ollama AI 的协作,探索 AI 带来的无限可能。无论您是技术爱好者,还是对 AI 交流充满好奇,LobeChat 都将为您提供一场前所未有的体验。
|
||||
|
||||
<Cards>
|
||||
<Card href={'/docs/usage/providers'} title={'使用多模型服务商'} />
|
||||
<Card href={'/docs/usage/providers/ollama'} title={'使用 Ollama 本地模型'} />
|
||||
</Cards>
|
||||
|
||||
@@ -45,6 +45,8 @@ We have implemented support for the following model service providers:
|
||||
- **01.AI (Yi Model)**: Integrated the 01.AI models, with series of APIs featuring fast inference speed, which not only shortened the processing time, but also maintained excellent model performance. [Learn more](https://01.ai/)
|
||||
- **Together.ai**: Over 100 leading open-source Chat, Language, Image, Code, and Embedding models are available through the Together Inference API. For these models you pay just for what you use. [Learn more](https://www.together.ai/)
|
||||
- **Minimax**: Integrated the Minimax models, including the MoE model **abab6**, offers a broader range of choices. [Learn more](https://www.minimaxi.com/)
|
||||
- **DeepSeek**: Integrated with the DeepSeek series models, an innovative AI startup from China, The product has been designed to provide a model that balances performance with price. [Learn more](https://www.deepseek.com/)
|
||||
- **Qwen**: Integrated with the Qwen series models, including the latest **qwen-turbo**, **qwen-plus** and **qwen-max**. [Learn more](https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction)
|
||||
|
||||
At the same time, we are also planning to support more model service providers, such as Replicate and Perplexity, to further enrich our service provider library. If you would like LobeChat to support your favorite service provider, feel free to join our [community discussion](https://github.com/lobehub/lobe-chat/discussions/1284).
|
||||
|
||||
@@ -57,3 +59,8 @@ At the same time, we are also planning to support more model service providers,
|
||||
/>
|
||||
|
||||
To meet the specific needs of users, LobeChat also supports the use of local models based on [Ollama](https://ollama.ai), allowing users to flexibly use their own or third-party models. For more details, see [Local Model Support](/docs/usage/features/local-llm).
|
||||
|
||||
<Cards>
|
||||
<Card href={'/docs/usage/providers'} title={'Using Multiple Model Providers'} />
|
||||
<Card href={'/docs/usage/providers/ollama'} title={'Using Ollama Local Model'} />
|
||||
</Cards>
|
||||
|
||||
@@ -45,6 +45,8 @@ tags:
|
||||
- **Groq**:接入了 Groq 的 AI 模型,高效处理消息序列,生成回应,胜任多轮对话及单次交互任务。[了解更多](https://groq.com/)
|
||||
- **OpenRouter**:其支持包括 **Claude 3**,**Gemma**,**Mistral**,**Llama2**和**Cohere**等模型路由,支持智能路由优化,提升使用效率,开放且灵活。[了解更多](https://openrouter.ai/)
|
||||
- **Minimax**: 接入了 Minimax 的 AI 模型,包括 MoE 模型 **abab6**,提供了更多的选择空间。[了解更多](https://www.minimaxi.com/)
|
||||
- **DeepSeek**: 接入了 DeepSeek 的 AI 模型,包括最新的 **DeepSeek-V2**,提供兼顾性能与价格的模型。[了解更多](https://www.deepseek.com/)
|
||||
- **Qwen (通义千问)**: 接入了 Qwen 的 AI 模型,包括最新的 **qwen-turbo**,**qwen-plus** 和 **qwen-max** 等模型。[了解更多](https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction)
|
||||
|
||||
同时,我们也在计划支持更多的模型服务商,如 Replicate 和 Perplexity 等,以进一步丰富我们的服务商库。如果你希望让 LobeChat 支持你喜爱的服务商,欢迎加入我们的[社区讨论](https://github.com/lobehub/lobe-chat/discussions/1284)。
|
||||
|
||||
@@ -57,3 +59,8 @@ tags:
|
||||
/>
|
||||
|
||||
为了满足特定用户的需求,LobeChat 还基于 [Ollama](https://ollama.ai) 支持了本地模型的使用,让用户能够更灵活地使用自己的或第三方的模型,详见 [本地模型支持](/docs/usage/features/local-llm)。
|
||||
|
||||
<Cards>
|
||||
<Card href={'/docs/usage/providers'} title={'使用多模型服务商'} />
|
||||
<Card href={'/docs/usage/providers/ollama'} title={'使用 Ollama 本地模型'} />
|
||||
</Cards>
|
||||
|
||||
@@ -40,7 +40,8 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
||||
## 插件生态体系
|
||||
|
||||
<Callout>
|
||||
如果你对插件开发感兴趣,请在 Wiki 中查阅我们的 [📘 插件开发指南](/docs/usage/plugins/development)。
|
||||
如果你对插件开发感兴趣,请在 Wiki 中查阅我们的 [📘
|
||||
插件开发指南](/docs/usage/plugins/development)。
|
||||
</Callout>
|
||||
|
||||
- [lobe-chat-plugins][lobe-chat-plugins]:这是 LobeChat 的插件索引。它从该仓库的 index.json 中获取插件列表并显示给用户。
|
||||
|
||||
@@ -28,7 +28,8 @@ If you are unfamiliar with the installation process of PWA, you can follow the s
|
||||
## Running on Chrome / Edge
|
||||
|
||||
<Callout type={'important'}>
|
||||
On macOS, when using a Chrome-installed PWA, it is required that Chrome be open, otherwise Chrome will automatically open and then launch the PWA app.
|
||||
On macOS, when using a Chrome-installed PWA, it is required that Chrome be open, otherwise Chrome
|
||||
will automatically open and then launch the PWA app.
|
||||
</Callout>
|
||||
|
||||
<Steps>
|
||||
@@ -62,7 +63,7 @@ Safari PWA requires macOS Ventura or later. The PWA installed by Safari does not
|
||||
</Steps>
|
||||
|
||||
<Callout type={'tip'}>
|
||||
The default installed LobeChat PWA icon has a black background, you can use <kbd>cmd</kbd> + <kbd>i</kbd> to paste the following image to replace it with a white background.
|
||||
The default installed LobeChat PWA icon has a black background, you can use <kbd>cmd</kbd> + <kbd>i</kbd> to paste the following image to replace it with a white background.
|
||||
</Callout>
|
||||
|
||||
<Image
|
||||
|
||||
@@ -28,7 +28,8 @@ tags:
|
||||
## Chrome / Edge 浏览器上运行
|
||||
|
||||
<Callout type={'important'}>
|
||||
macOS 下,使用 Chrome 安装的 PWA 时,必须要求 Chrome 是打开状态,否则会自动打开 Chrome 再打开 PWA 应用。
|
||||
macOS 下,使用 Chrome 安装的 PWA 时,必须要求 Chrome 是打开状态,否则会自动打开 Chrome 再打开 PWA
|
||||
应用。
|
||||
</Callout>
|
||||
|
||||
<Steps>
|
||||
@@ -62,7 +63,7 @@ Safari PWA 需要 macOS Ventura 或更高版本。Safari 安装的 PWA 并不要
|
||||
</Steps>
|
||||
|
||||
<Callout type={'tip'}>
|
||||
默认安装的 LobeChat PWA 图标是黑色背景的,您可以在自行使用 <kbd>cmd</kbd> + <kbd>i</kbd> 粘贴如下图片替换为白色背景的。
|
||||
默认安装的 LobeChat PWA 图标是黑色背景的,您可以在自行使用 <kbd>cmd</kbd> + <kbd>i</kbd> 粘贴如下图片替换为白色背景的。
|
||||
</Callout>
|
||||
|
||||
<Image
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: Enhancing LobeChat with Multiple Model Providers for AI Conversations
|
||||
description: >-
|
||||
Discover how LobeChat offers diverse AI conversation options by supporting
|
||||
multiple model providers, providing flexibility and a wide range of choices
|
||||
for users and developers.
|
||||
tags:
|
||||
- LobeChat
|
||||
- AI Conversations
|
||||
- Model Providers
|
||||
- Diversity
|
||||
- Flexibility
|
||||
- Google AI
|
||||
- ChatGLM
|
||||
- Moonshot AI
|
||||
- 01 AI
|
||||
- Together AI
|
||||
- Ollama
|
||||
---
|
||||
|
||||
# Using Multiple Model Providers in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Multiple Model Providers Support'}
|
||||
borderless
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/1148639c-2687-4a9c-9950-8ca8672f34b6'}
|
||||
/>
|
||||
|
||||
In the continuous development of LobeChat, we deeply understand the importance of diversity in model providers for providing AI conversation services to meet the needs of the community. Therefore, we have expanded our support to multiple model providers instead of being limited to a single one, in order to offer users a more diverse and rich selection of conversation options.
|
||||
|
||||
This approach allows LobeChat to adapt more flexibly to different user needs and provides developers with a wider range of choices.
|
||||
|
||||
## Tutorial on Using Model Providers
|
||||
|
||||
<ProviderCards locale={'en'} />
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用多模型服务商
|
||||
description: 了解 LobeChat 在多模型服务商支持方面的最新进展,包括已支持的模型服务商和计划中的扩展,以及本地模型支持的使用方式。
|
||||
tags:
|
||||
- LobeChat
|
||||
- AI 会话服务
|
||||
- 模型服务商
|
||||
- 多模型支持
|
||||
- 本地模型支持
|
||||
- AWS Bedrock
|
||||
- Google AI
|
||||
- ChatGLM
|
||||
- Moonshot AI
|
||||
- 01 AI
|
||||
- Together AI
|
||||
- Ollama
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用多模型服务商
|
||||
|
||||
<Image
|
||||
alt={'多模型服务商支持'}
|
||||
borderless
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/1148639c-2687-4a9c-9950-8ca8672f34b6'}
|
||||
/>
|
||||
|
||||
在 LobeChat 的不断发展过程中,我们深刻理解到在提供 AI 会话服务时模型服务商的多样性对于满足社区需求的重要性。因此,我们不再局限于单一的模型服务商,而是拓展了对多种模型服务商的支持,以便为用户提供更为丰富和多样化的会话选择。
|
||||
|
||||
通过这种方式,LobeChat 能够更灵活地适应不同用户的需求,同时也为开发者提供了更为广泛的选择空间。
|
||||
|
||||
## 模型服务商使用教程
|
||||
|
||||
<ProviderCards locale={'zh'} />
|
||||
@@ -0,0 +1,85 @@
|
||||
---
|
||||
title: Using Zero One AI API Key in LobeChat
|
||||
description: >-
|
||||
Learn how to integrate and use Zero One AI in LobeChat with step-by-step
|
||||
instructions. Obtain an API key, configure Zero One AI, and start
|
||||
conversations with AI models.
|
||||
tags:
|
||||
- 01.AI
|
||||
- Zero One AI
|
||||
- Web UI
|
||||
- API key
|
||||
- AI models
|
||||
---
|
||||
|
||||
# Using Zero One AI in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Using Zero One AI in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/4485fbc3-c309-4c4e-83ee-cb82392307a1'}
|
||||
/>
|
||||
|
||||
[Zero One AI](https://www.01.ai/) is a global company dedicated to AI 2.0 large model technology and applications. Its billion-parameter Yi-Large closed-source model, when evaluated on Stanford University's English ranking AlpacaEval 2.0, is on par with GPT-4.
|
||||
|
||||
This document will guide you on how to use Zero One AI in LobeChat:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Step 1: Obtain Zero One AI API Key
|
||||
|
||||
- Register and log in to the [Zero One AI Large Model Open Platform](https://platform.lingyiwanwu.com/)
|
||||
- Go to the `Dashboard` and access the `API Key Management` menu
|
||||
- A system-generated API key has been created for you automatically, or you can create a new one on this interface
|
||||
|
||||
<Image
|
||||
alt={'Create Zero One AI API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/72f165f4-d529-4f01-a3ac-163c66e5ea73'}
|
||||
/>
|
||||
|
||||
- Account verification is required for first-time use
|
||||
|
||||
<Image
|
||||
alt={'Complete Account Verification'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/e6058456-8f9d-40c1-9ae5-1e9d5eeb9476'}
|
||||
/>
|
||||
|
||||
- Click on the created API key
|
||||
- Copy and save the API key in the pop-up dialog box
|
||||
|
||||
<Image
|
||||
alt={'Save API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f892fe64-c734-4944-91ff-9916a41bd1c9'}
|
||||
/>
|
||||
|
||||
### Step 2: Configure Zero One AI in LobeChat
|
||||
|
||||
- Access the `Settings` interface in LobeChat
|
||||
- Find the setting for `Zero One AI` under `Language Model`
|
||||
|
||||
<Image
|
||||
alt={'Enter API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f539d104-6d64-4cc7-8781-3b36b00d32d0'}
|
||||
/>
|
||||
|
||||
- Open Zero One AI and enter the obtained API key
|
||||
- Choose a 01.AI model for your AI assistant to start the conversation
|
||||
|
||||
<Image
|
||||
alt={'Select 01.AI Model and Start Conversation'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/8bf73498-4649-4c4d-a95b-b68447599781'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
During usage, you may need to pay the API service provider. Please refer to Zero One AI's relevant
|
||||
fee policies.
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
You can now use the models provided by Zero One AI for conversations in LobeChat.
|
||||
@@ -0,0 +1,85 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用 01.AI 零一万物 API Key
|
||||
description: >-
|
||||
学习如何在 LobeChat 中配置并使用 01.AI 零一万物提供的 AI 模型进行对话。获取 API 密钥、填入设置项、选择模型,开始与 AI
|
||||
助手交流。
|
||||
tags:
|
||||
- LobeChat
|
||||
- 01.AI
|
||||
- Zero One AI
|
||||
- 零一万物
|
||||
- Web UI
|
||||
- API密钥
|
||||
- 配置指南
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用零一万物
|
||||
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用零一万物'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/4485fbc3-c309-4c4e-83ee-cb82392307a1'}
|
||||
/>
|
||||
|
||||
[零一万物](https://www.01.ai/)是一家致力于AI 2.0大模型技术和应用的全球公司,其发布的千亿参数的Yi-Large闭源模型,在斯坦福大学的英语排行AlpacaEval 2.0上,与GPT-4互有第一。
|
||||
|
||||
本文档将指导你如何在 LobeChat 中使用零一万物:
|
||||
|
||||
<Steps>
|
||||
|
||||
### 步骤一:获取零一万物 API 密钥
|
||||
|
||||
- 注册并登录 [零一万物大模型开放平台](https://platform.lingyiwanwu.com/)
|
||||
- 进入`工作台`并访问`API Key管理`菜单
|
||||
- 系统已为你自动创建了一个 API 密钥,你也可以在此界面创建新的 API 密钥
|
||||
|
||||
<Image
|
||||
alt={'创建零一万物 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/72f165f4-d529-4f01-a3ac-163c66e5ea73'}
|
||||
/>
|
||||
|
||||
- 初次使用时需要完成账号认证
|
||||
|
||||
<Image
|
||||
alt={'完成账号认证'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/e6058456-8f9d-40c1-9ae5-1e9d5eeb9476'}
|
||||
/>
|
||||
|
||||
- 点击创建好的 API 密钥
|
||||
- 在弹出的对话框中复制并保存 API 密钥
|
||||
|
||||
<Image
|
||||
alt={'保存 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f892fe64-c734-4944-91ff-9916a41bd1c9'}
|
||||
/>
|
||||
|
||||
### 步骤二:在LobeChat 中配置零一万物
|
||||
|
||||
- 访问 LobeChat 的`设置`界面
|
||||
- 在`语言模型`下找到`零一万物`的设置项
|
||||
|
||||
<Image
|
||||
alt={'填入 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f539d104-6d64-4cc7-8781-3b36b00d32d0'}
|
||||
/>
|
||||
|
||||
- 打开零一万物并填入获得的 API 密钥
|
||||
- 为你的 AI 助手选择一个 01.AI 的模型即可开始对话
|
||||
|
||||
<Image
|
||||
alt={'选择01.AI模型并开始对话'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/8bf73498-4649-4c4d-a95b-b68447599781'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
在使用过程中你可能需要向 API 服务提供商付费,请参考零一万物的相关费用政策。
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
至此你已经可以在 LobeChat 中使用零一万物提供的模型进行对话了。
|
||||
@@ -0,0 +1,78 @@
|
||||
---
|
||||
title: Using Anthropic Claude API Key in LobeChat
|
||||
description: >-
|
||||
Learn how to integrate Anthropic Claude API in LobeChat to enhance your AI
|
||||
assistant capabilities. Support Claude 3.5 sonnet / Claude 3 Opus / Claude 3
|
||||
haiku
|
||||
tags:
|
||||
- Anthropic Claude
|
||||
- API Key
|
||||
- AI assistant
|
||||
- Web UI
|
||||
---
|
||||
|
||||
# Using Anthropic Claude in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Using Anthropic Claude in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/620b956b-dcb2-442a-8bb1-9aa22681dfa4'}
|
||||
/>
|
||||
|
||||
The Anthropic Claude API is now available for everyone to use. This document will guide you on how to use [Anthropic Claude](https://www.anthropic.com/api) in LobeChat:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Step 1: Obtain Anthropic Claude API Key
|
||||
|
||||
- Create an [Anthropic Claude API](https://www.anthropic.com/api) account.
|
||||
- Get your [API key](https://console.anthropic.com/settings/keys).
|
||||
|
||||
<Image
|
||||
alt={'Create API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/15e09e71-5899-4805-9c5e-1f7c57be04ae'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
The Claude API currently offers $5 of free credits, but it is only available in certain specific
|
||||
countries/regions. You can go to Dashboard > Claim to see if it is applicable to your
|
||||
country/region.
|
||||
</Callout>
|
||||
|
||||
- Set up your billing for the API key to work on [https://console.anthropic.com/settings/plans](https://console.anthropic.com/settings/plans) (choose the "Build" plan so you can add credits and only pay for usage).
|
||||
|
||||
<Image
|
||||
alt={'Set Up Your Billing'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/385f663f-cae2-4383-9bb0-52c45e5d7d7a'}
|
||||
/>
|
||||
|
||||
### Step 2: Configure Anthropic Claude in LobeChat
|
||||
|
||||
- Access the `Settings` interface in LobeChat.
|
||||
- Find the setting for `Anthropic Claude` under `Language Models`.
|
||||
|
||||
<Image
|
||||
alt={'Enter API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ff9c3eb8-412b-4275-80be-177ae7b7acbc'}
|
||||
/>
|
||||
|
||||
- Enter the obtained API key.
|
||||
- Choose an Anthropic Claude model for your AI assistant to start the conversation.
|
||||
|
||||
<Image
|
||||
alt={'Select Anthropic Claude Model and Start Conversation'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/6cdc5c0e-0508-44ed-a283-03f6b538ed8a'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
During usage, you may need to pay the API service provider. Please refer to Anthropic Claude's
|
||||
relevant pricing policies.
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
You can now engage in conversations using the models provided by Anthropic Claude in LobeChat.
|
||||
@@ -0,0 +1,75 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用 Anthropic Claude API Key
|
||||
description: >-
|
||||
学习如何在 LobeChat 中配置和使用 Anthropic Claude API, Claude 3.5 sonnet / Claude 3 Opus
|
||||
/ Claude 3 haiku
|
||||
tags:
|
||||
- Anthropic Claude
|
||||
- API
|
||||
- WebUI
|
||||
- AI助手
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用 Anthropic Claude
|
||||
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用 Anthropic Claude'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/620b956b-dcb2-442a-8bb1-9aa22681dfa4'}
|
||||
/>
|
||||
|
||||
Anthropic Claude API 现在可供所有人使用, 本文档将指导你如何在 LobeChat 中使用 [Anthropic Claude](https://www.anthropic.com/api):
|
||||
|
||||
<Steps>
|
||||
|
||||
### 步骤一:获取 Anthropic Claude API 密钥
|
||||
|
||||
- 创建一个 [Anthropic Claude API](https://www.anthropic.com/api) 帐户
|
||||
- 获取您的 [API 密钥](https://console.anthropic.com/settings/keys)
|
||||
|
||||
<Image
|
||||
alt={'创建 API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/15e09e71-5899-4805-9c5e-1f7c57be04ae'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Claude API 现在提供 5 美元的免费积分,但是,它仅适用于某些特定国家/地区,您可以转到 Dashboard >
|
||||
Claim 查看它是否适用于您所在的国家/地区。
|
||||
</Callout>
|
||||
|
||||
- 设置您的账单,让 API 密钥在 https://console.anthropic.com/settings/plans 上工作(选择“生成”计划,以便您可以添加积分并仅为使用量付费)
|
||||
|
||||
<Image
|
||||
alt={'设置您的账单'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/385f663f-cae2-4383-9bb0-52c45e5d7d7a'}
|
||||
/>
|
||||
|
||||
### 步骤二:在 LobeChat 中配置 Anthropic Claude
|
||||
|
||||
- 访问 LobeChat 的`设置`界面
|
||||
- 在`语言模型`下找到`Anthropic Claude`的设置项
|
||||
|
||||
<Image
|
||||
alt={'填入 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ff9c3eb8-412b-4275-80be-177ae7b7acbc'}
|
||||
/>
|
||||
|
||||
- 填入获得的 API 密钥
|
||||
- 为你的 AI 助手选择一个 Anthropic Claude 的模型即可开始对话
|
||||
|
||||
<Image
|
||||
alt={'选择 Anthropic Claude 模型并开始对话'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/6cdc5c0e-0508-44ed-a283-03f6b538ed8a'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
在使用过程中你可能需要向 API 服务提供商付费,请参考 Anthropic Claude 的相关费用政策。
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
至此你已经可以在 LobeChat 中使用 Anthropic Claude 提供的模型进行对话了。
|
||||
@@ -0,0 +1,88 @@
|
||||
---
|
||||
title: Using Azure OpenAI API Key in LobeChat
|
||||
description: >-
|
||||
Learn how to integrate and configure Azure OpenAI in LobeChat to enhance your
|
||||
AI assistant capabilities. Follow these steps to obtain the API key, configure
|
||||
the settings, and start engaging in conversations.
|
||||
tags:
|
||||
- Azure OpenAI
|
||||
- AI assistant
|
||||
- API key
|
||||
- Configuration
|
||||
- Conversation models
|
||||
---
|
||||
|
||||
# Using Azure OpenAI in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Azure OpenAI in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/5efa34c2-6523-43e6-9ade-70ab5d802e13'}
|
||||
/>
|
||||
|
||||
This document will guide you on how to use [Azure OpenAI](https://oai.azure.com/) in LobeChat:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Step 1: Obtain Azure OpenAI API Key
|
||||
|
||||
- If you haven't registered yet, you need to create an [Azure OpenAI account](https://oai.azure.com/).
|
||||
|
||||
<Image
|
||||
alt={'Create an Azure OpenAI account'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/a77b0fb2-87d7-4527-a804-2f7ad3634aa5'}
|
||||
/>
|
||||
|
||||
- After registration, go to the `Deployments` page and create a new deployment with your selected model.
|
||||
|
||||

|
||||
|
||||
<Image
|
||||
alt={'Create a new deployment with your selected model'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/4fae3e6f-e680-4471-93c4-987c19d7170a'}
|
||||
/>
|
||||
|
||||
- Navigate to the `Chat` page and click on `View Code` to obtain your endpoint and key.
|
||||
|
||||
<Image
|
||||
alt={'Go to the Chat page'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ac10d9dd-a977-43fb-8397-b2bbdee6a1a1'}
|
||||
/>
|
||||
|
||||
<Image
|
||||
alt={'Get the endpoint and key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ab94a7b5-6bc4-41e0-97bc-724ee8e315db'}
|
||||
/>
|
||||
|
||||
### Step 2: Configure Azure OpenAI in LobeChat
|
||||
|
||||
- Access the `Settings` interface in LobeChat.
|
||||
- Find the setting for `Azure OpenAI` under `Language Model`.
|
||||
|
||||
<Image
|
||||
alt={'Enter the API key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/63d9f6d4-5b78-4c65-8cd1-ff8b7f143406'}
|
||||
/>
|
||||
|
||||
- Enter the API key you obtained.
|
||||
- Choose an Azure OpenAI model for your AI assistant to start the conversation.
|
||||
|
||||
<Image
|
||||
alt={'Select Azure OpenAI model and start the conversation'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ddb44517-8696-4492-acd9-25b590f6069c'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
During usage, you may need to pay the API service provider. Please refer to Azure OpenAI's
|
||||
relevant pricing policies.
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
Now you can engage in conversations using the models provided by Azure OpenAI in LobeChat.
|
||||
@@ -0,0 +1,79 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用 Azure OpenAI API Key
|
||||
description: 学习如何在 LobeChat 中配置和使用 Azure OpenAI 模型进行对话,包括获取 API 密钥和选择模型。
|
||||
tags:
|
||||
- Azure OpenAI
|
||||
- API Key
|
||||
- Web UI
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用 Azure OpenAI
|
||||
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用 Azure OpenAI'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/5efa34c2-6523-43e6-9ade-70ab5d802e13'}
|
||||
/>
|
||||
|
||||
本文档将指导你如何在 LobeChat 中使用 [Azure OpenAI](https://oai.azure.com/):
|
||||
|
||||
<Steps>
|
||||
|
||||
### 步骤一:获取 Azure OpenAI API 密钥
|
||||
|
||||
- 如果尚未注册,则必须注册 [Azure OpenAI 帐户](https://oai.azure.com/)。
|
||||
|
||||
<Image
|
||||
alt={'注册 Azure OpenAI 帐户'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/a77b0fb2-87d7-4527-a804-2f7ad3634aa5'}
|
||||
/>
|
||||
|
||||
- 注册完毕后,转到 `Deployments` 页面,然后使用您选择的模型创建新部署。
|
||||
|
||||
<Image
|
||||
alt={'选择的模型创建新部署'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/4fae3e6f-e680-4471-93c4-987c19d7170a'}
|
||||
/>
|
||||
|
||||
- 转到 `Chat` 页面,然后单击 `View Code` 以获取您的终结点和密钥。
|
||||
|
||||
<Image
|
||||
alt={'转到 Chat 页面'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ac10d9dd-a977-43fb-8397-b2bbdee6a1a1'}
|
||||
/>
|
||||
<Image
|
||||
alt={'获取终结点和密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ab94a7b5-6bc4-41e0-97bc-724ee8e315db'}
|
||||
/>
|
||||
|
||||
### 步骤二:在 LobeChat 中配置 Azure OpenAI
|
||||
|
||||
- 访问 LobeChat 的`设置`界面
|
||||
- 在`语言模型`下找到`Azure OpenAI`的设置项
|
||||
|
||||
<Image
|
||||
alt={'填入 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/63d9f6d4-5b78-4c65-8cd1-ff8b7f143406'}
|
||||
/>
|
||||
|
||||
- 填入获得的 API 密钥
|
||||
- 为你的 AI 助手选择一个 Azure OpenAI 的模型即可开始对话
|
||||
|
||||
<Image
|
||||
alt={'选择 Azure OpenAI 模型并开始对话'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ddb44517-8696-4492-acd9-25b590f6069c'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
在使用过程中你可能需要向 API 服务提供商付费,请参考 Azure OpenAI 的相关费用政策。
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
至此你已经可以在 LobeChat 中使用 Azure OpenAI 提供的模型进行对话了。
|
||||
@@ -0,0 +1,139 @@
|
||||
---
|
||||
title: Using Amazon Bedrock API Key in LobeChat
|
||||
description: >-
|
||||
Learn how to integrate Amazon Bedrock models into LobeChat for AI-powered
|
||||
conversations. Follow these steps to grant access, obtain API keys, and
|
||||
configure Amazon Bedrock.
|
||||
tags:
|
||||
- Amazon Bedrock
|
||||
- Claude 3.5 sonnect
|
||||
- API keys
|
||||
- Claude 3 Opus
|
||||
- Web UI
|
||||
---
|
||||
|
||||
# Using Amazon Bedrock in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Using Amazon Bedrock in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/74768b36-28ca-4ec3-a42d-b32abe2c7057'}
|
||||
/>
|
||||
|
||||
Amazon Bedrock is a fully managed foundational model API service that allows users to access models from leading AI companies (such as AI21 Labs, Anthropic, Cohere, Meta, Stability AI) and Amazon's own foundational models.
|
||||
|
||||
This document will guide you on how to use Amazon Bedrock in LobeChat:
|
||||
|
||||
<Steps>
|
||||
### Step 1: Grant Access to Amazon Bedrock Models in AWS
|
||||
|
||||
- Access and log in to the [AWS Console](https://console.aws.amazon.com/)
|
||||
- Search for `bedrock` and enter the `Amazon Bedrock` service
|
||||
|
||||
<Image
|
||||
alt={'Enter Amazon Bedrock service'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/4e0e87d1-4970-45c5-a9ef-287098f6a198'}
|
||||
/>
|
||||
|
||||
- Select `Models access` from the left menu
|
||||
|
||||
<Image
|
||||
alt={'Access Amazon Bedrock model permissions'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/fd06c0aa-4bd3-4f4e-bf2b-38374dfe775d'}
|
||||
/>
|
||||
|
||||
- Open model access permissions based on your needs
|
||||
|
||||
<Image
|
||||
alt={'Open model access permissions'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/b695f26a-5bcd-477c-af08-bf03adb717c2'}
|
||||
/>
|
||||
|
||||
<Callout type={'info'}>Some models may require additional information from you</Callout>
|
||||
|
||||
### Step 2: Obtain API Access Keys
|
||||
|
||||
- Continue searching for IAM in the AWS console and enter the IAM service
|
||||
|
||||
<Image
|
||||
alt={'Enter IAM service'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f9a5a394-c8f8-4567-9d51-cf84811418ca'}
|
||||
/>
|
||||
|
||||
- In the `Users` menu, create a new IAM user
|
||||
|
||||
<Image
|
||||
alt={'Create a new IAM user'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/750b5cd1-f16a-4330-b899-c27b28b1e837'}
|
||||
/>
|
||||
|
||||
- Enter the user name in the pop-up dialog box
|
||||
|
||||
<Image
|
||||
alt={'Enter user name'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/22ce5a72-bc46-41f3-b402-bda6dee90184'}
|
||||
/>
|
||||
|
||||
- Add permissions for this user or join an existing user group to ensure access to Amazon Bedrock
|
||||
|
||||
<Image
|
||||
alt={'Add permissions for the user'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/94836b32-7fc5-45ca-8556-7a23f53b15f9'}
|
||||
/>
|
||||
|
||||
- Create an access key for the added user
|
||||
|
||||
<Image
|
||||
alt={'Create an access key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/ac2ed716-d270-43f6-856b-3ff81265f4e6'}
|
||||
/>
|
||||
|
||||
- Copy and securely store the access key and secret access key, as they will be needed later
|
||||
|
||||
<Image
|
||||
alt={'Enter IAM service'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/3c64b747-f6f1-4ed2-84bc-bfa8e5d90966'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Please securely store the keys as they will only be shown once. If you lose them accidentally, you
|
||||
will need to create a new access key.
|
||||
</Callout>
|
||||
|
||||
### Step 3: Configure Amazon Bedrock in LobeChat
|
||||
|
||||
- Access the `Settings` interface in LobeChat
|
||||
- Find the setting for `Amazon Bedrock` under `Language Models` and open it
|
||||
|
||||
<Image
|
||||
alt={'Enter Amazon Bedrock keys in LobeChat'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/7468594b-3355-4cb9-85bc-c9dace137653'}
|
||||
/>
|
||||
|
||||
- Open Amazon Bedrock and enter the obtained access key and secret access key
|
||||
- Choose an Amazon Bedrock model for your assistant to start the conversation
|
||||
|
||||
<Image
|
||||
alt={'Select and use Amazon Bedrock model'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/164b34b5-671e-418d-b34a-3b70f1156d06'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
You may incur charges while using the API service, please refer to Amazon Bedrock's pricing
|
||||
policy.
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
You can now engage in conversations using the models provided by Amazon Bedrock in LobeChat.
|
||||
@@ -0,0 +1,134 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用 Amazon Bedrock API Key
|
||||
description: 学习如何在 LobeChat 中配置和使用 Amazon Bedrock,一个完全托管的基础模型API服务,以便开始对话。
|
||||
tags:
|
||||
- Amazon Bedrock
|
||||
- Claude 3.5 sonnect
|
||||
- API keys
|
||||
- Claude 3 Opus
|
||||
- Web UI
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用 Amazon Bedrock
|
||||
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用 Amazon Bedrock'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/74768b36-28ca-4ec3-a42d-b32abe2c7057'}
|
||||
/>
|
||||
|
||||
Amazon Bedrock 是一个完全托管的基础模型API服务,允许用户通过API访问来自领先AI公司(如AI21 Labs、Anthropic、Cohere、Meta、Stability AI)和Amazon自家的基础模型。
|
||||
|
||||
本文档将指导你如何在 LobeChat 中使用 Amazon Bedrock:
|
||||
|
||||
<Steps>
|
||||
### 步骤一:在 AWS 中打开 Amazon Bedrock 模型的访问权限
|
||||
|
||||
- 访问并登录 [AWS Console](https://console.aws.amazon.com/)
|
||||
- 搜索 beckrock 并进入 `Amazon Bedrock` 服务
|
||||
|
||||
<Image
|
||||
alt={'进入 Amazon Bedrock 服务'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/4e0e87d1-4970-45c5-a9ef-287098f6a198'}
|
||||
/>
|
||||
|
||||
- 在左侧菜单中选择 `Models acess`
|
||||
|
||||
<Image
|
||||
alt={'进入 Amazon Bedrock 模型访问权限'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/fd06c0aa-4bd3-4f4e-bf2b-38374dfe775d'}
|
||||
/>
|
||||
|
||||
- 根据你所需要的模型,打开模型访问权限
|
||||
|
||||
<Image
|
||||
alt={'打开模型访问权限'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/b695f26a-5bcd-477c-af08-bf03adb717c2'}
|
||||
/>
|
||||
|
||||
<Callout type={'info'}>某些模型可能需要你提供额外的信息</Callout>
|
||||
|
||||
### 步骤二:获取 API 访问密钥
|
||||
|
||||
- 继续在 AWS console 中搜索 IAM,进入 IAM 服务
|
||||
|
||||
<Image
|
||||
alt={'进入 IAM 服务'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f9a5a394-c8f8-4567-9d51-cf84811418ca'}
|
||||
/>
|
||||
|
||||
- 在 `用户` 菜单中,创建一个新的 IAM 用户
|
||||
|
||||
<Image
|
||||
alt={'创建一个新的 IAM 用户'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/750b5cd1-f16a-4330-b899-c27b28b1e837'}
|
||||
/>
|
||||
|
||||
- 在弹出的对话框中,输入用户名称
|
||||
|
||||
<Image
|
||||
alt={'输入用户名称'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/22ce5a72-bc46-41f3-b402-bda6dee90184'}
|
||||
/>
|
||||
|
||||
- 为这个用户添加权限,或者加入一个已有的用户组,确保用户拥有 Amazon Bedrock 的访问权限
|
||||
|
||||
<Image
|
||||
alt={'为用户添加权限'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/94836b32-7fc5-45ca-8556-7a23f53b15f9'}
|
||||
/>
|
||||
|
||||
- 为已添加的用户创建访问密钥
|
||||
|
||||
<Image
|
||||
alt={'创建访问密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/ac2ed716-d270-43f6-856b-3ff81265f4e6'}
|
||||
/>
|
||||
|
||||
- 复制并妥善保存访问密钥以及秘密访问密钥,后续将会用到
|
||||
|
||||
<Image
|
||||
alt={'进入 IAM 服务'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/3c64b747-f6f1-4ed2-84bc-bfa8e5d90966'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
请安全地存储密钥,因为它只会出现一次。如果您意外丢失它,您将需要创建一个新访问密钥。
|
||||
</Callout>
|
||||
|
||||
### 步骤三:在 LobeChat 中配置 Amazon Bedrock
|
||||
|
||||
- 访问LobeChat的`设置`界面
|
||||
- 在`语言模型`下找到`Amazon Bedrock`的设置项并打开
|
||||
|
||||
<Image
|
||||
alt={'LobeChat 中填写 Amazon Bedrock 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/7468594b-3355-4cb9-85bc-c9dace137653'}
|
||||
/>
|
||||
|
||||
- 打开 Amazon Bedrock 并填入获得的访问密钥与秘密访问密钥
|
||||
- 为你的助手选择一个 Amazone Bedrock 的模型即可开始对话
|
||||
|
||||
<Image
|
||||
alt={' 选择并使用 Amazon Bedrock 模型 '}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/164b34b5-671e-418d-b34a-3b70f1156d06'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
在使用过程中你可能需要向 API 服务提供商付费,请参考 Amazon Bedrock 的费用政策。
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
至此你已经可以在 LobeChat 中使用 Amazone Bedrock 提供的模型进行对话了。
|
||||
@@ -0,0 +1,90 @@
|
||||
---
|
||||
title: Using DeepSeek API Key in LobeChat
|
||||
description: >-
|
||||
Learn how to use DeepSeek-V2 in LobeChat, obtain API keys. Get started with
|
||||
DeepSeek integration now!
|
||||
tags:
|
||||
- DeepSeek
|
||||
- LobeChat
|
||||
- DeepSeek-V2
|
||||
- API Key
|
||||
- Web UI
|
||||
---
|
||||
|
||||
# Using DeepSeek in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Using DeepSeek in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/b4d12904-9d5d-46de-bd66-901eeb9c8e52'}
|
||||
/>
|
||||
|
||||
[DeepSeek](https://www.deepseek.com/) is an advanced open-source Large Language Model (LLM). The latest version, DeepSeek-V2, has made significant optimizations in architecture and performance, reducing training costs by 42.5% and inference costs by 93.3%.
|
||||
|
||||
This document will guide you on how to use DeepSeek in LobeChat:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Step 1: Obtain DeepSeek API Key
|
||||
|
||||
- First, you need to register and log in to the [DeepSeek](https://platform.deepseek.com/) open platform.
|
||||
|
||||
<Callout type={'info'}>New users will receive a free quota of 500M Tokens</Callout>
|
||||
|
||||
- Go to the `API keys` menu and click on `Create API Key`.
|
||||
|
||||
<Image
|
||||
alt={'Create Deepseek API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/5707b392-1ee6-4db6-95cb-9d6c902747d2'}
|
||||
/>
|
||||
|
||||
- Enter the API key name in the pop-up dialog box.
|
||||
|
||||
<Image
|
||||
alt={'Enter Deepseek API Name'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/c1d1d816-6339-41a6-9bc9-e2c3b2762291'}
|
||||
/>
|
||||
|
||||
- Copy the generated API key and save it securely.
|
||||
|
||||
<Image
|
||||
alt={'Save Deepseek API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/198217a6-84fa-441c-bcbe-8cded1106d6c'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Please store the key securely as it will only appear once. If you accidentally lose it, you will
|
||||
need to create a new key.
|
||||
</Callout>
|
||||
|
||||
### Step 2: Configure DeepSeek in LobeChat
|
||||
|
||||
- Access the `App Settings` interface in LobeChat.
|
||||
- Find the setting for `DeepSeek` under `Language Models`.
|
||||
|
||||
<Image
|
||||
alt={'Enter Deepseek API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/bae262d6-0d49-47f3-bc9c-356cf6f3f34e'}
|
||||
/>
|
||||
|
||||
- Open DeepSeek and enter the obtained API key.
|
||||
- Choose a DeepSeek model for your assistant to start the conversation.
|
||||
|
||||
<Image
|
||||
alt={'Select Deepseek Model'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/84568505-6efe-4518-8888-682ccdd92197'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
You may need to pay the API service provider during usage, please refer to DeepSeek's relevant
|
||||
pricing policies.
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
You can now engage in conversations using the models provided by Deepseek in LobeChat.
|
||||
@@ -0,0 +1,85 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用 DeepSeek API Key
|
||||
description: 学习如何在 LobeChat 中配置和使用 DeepSeek 语言模型,获取 API 密钥并开始对话。
|
||||
tags:
|
||||
- LobeChat
|
||||
- DeepSeek
|
||||
- API密钥
|
||||
- Web UI
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用 DeepSeek
|
||||
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用 DeepSeek'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/b4d12904-9d5d-46de-bd66-901eeb9c8e52'}
|
||||
/>
|
||||
|
||||
[DeepSeek](https://www.deepseek.com/) 是一款先进的开源大型语言模型(LLM)。最新版本 DeepSeek-V2 在架构和性能上进行了显著优化,同时训练成本降低了42.5%,推理成本降低了93.3%。
|
||||
|
||||
本文档将指导你如何在 LobeChat 中使用 DeepSeek:
|
||||
|
||||
<Steps>
|
||||
|
||||
### 步骤一:获取 DeepSeek API 密钥
|
||||
|
||||
- 首先,你需要注册并登录 [DeepSeek](https://platform.deepseek.com/) 开放平台
|
||||
|
||||
<Callout type={'info'}>当前新用户将会获赠 500M Tokens 的免费额度</Callout>
|
||||
|
||||
- 进入 `API keys` 菜单,并点击 `创建 API Key`
|
||||
|
||||
<Image
|
||||
alt={'创建 Deepseek API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/5707b392-1ee6-4db6-95cb-9d6c902747d2'}
|
||||
/>
|
||||
|
||||
- 在弹出的对话框中输入 API 密钥名称
|
||||
|
||||
<Image
|
||||
alt={'填写 Deepseek API 名称'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/c1d1d816-6339-41a6-9bc9-e2c3b2762291'}
|
||||
/>
|
||||
|
||||
- 复制得到的 API 密钥并妥善保存
|
||||
|
||||
<Image
|
||||
alt={'保存 Deepseek API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/198217a6-84fa-441c-bcbe-8cded1106d6c'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
请安全地存储密钥,因为它只会出现一次。如果你意外丢失它,您将需要创建一个新密钥。
|
||||
</Callout>
|
||||
|
||||
### 步骤二:在 LobeChat 中配置 DeepSeek
|
||||
|
||||
- 访问 LobeChat 的 `应用设置`界面
|
||||
- 在 `语言模型` 下找到 `DeepSeek` 的设置项
|
||||
|
||||
<Image
|
||||
alt={'填写 Deepseek API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/bae262d6-0d49-47f3-bc9c-356cf6f3f34e'}
|
||||
/>
|
||||
|
||||
- 打开 DeepSeek 并填入获取的 API 密钥
|
||||
- 为你的助手选择一个 DeepSeek 模型即可开始对话
|
||||
|
||||
<Image
|
||||
alt={'选择 Deepseek 模型'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/84568505-6efe-4518-8888-682ccdd92197'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
在使用过程中你可能需要向 API 服务提供商付费,请参考 DeepSeek 的相关费用政策。
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
至此你已经可以在 LobeChat 中使用 Deepseek 提供的模型进行对话了。
|
||||
@@ -0,0 +1,82 @@
|
||||
---
|
||||
title: Using Google Gemini API Key in LobeChat
|
||||
description: >-
|
||||
Learn how to integrate and utilize Google Gemini AI in LobeChat to enhance
|
||||
your conversational experience. Follow these steps to configure Google Gemini
|
||||
and start leveraging its powerful capabilities.
|
||||
tags:
|
||||
- Google Gemini
|
||||
- AI integration
|
||||
- Google AI Studio
|
||||
- Web UI
|
||||
---
|
||||
|
||||
# Using Google Gemini in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Using Google Gemini in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/9a8dc1d4-152b-415f-a7cd-8f0c8fbb9913'}
|
||||
/>
|
||||
|
||||
Gemini AI is a set of large language models (LLMs) created by Google AI, known for its cutting-edge advancements in multimodal understanding and processing. It is essentially a powerful artificial intelligence tool capable of handling various tasks involving different types of data, not just text.
|
||||
|
||||
This document will guide you on how to use Google Gemini in LobeChat:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Step 1: Obtain Google API Key
|
||||
|
||||
- Visit and log in to [Google AI Studio](https://aistudio.google.com/)
|
||||
- Navigate to `Get API Key` in the menu and click on `Create API Key`
|
||||
|
||||
<Image
|
||||
alt={'Generate Google Gemini Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/ba3595e3-d9cb-4d0d-b414-8306b16df186'}
|
||||
/>
|
||||
|
||||
- Select a project and create an API key, or create one in a new project
|
||||
|
||||
<Image
|
||||
alt={'Enter API Key Name'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/fa725e49-4c17-4055-82bc-98a31e73fa54'}
|
||||
/>
|
||||
|
||||
- Copy the API key from the pop-up dialog
|
||||
|
||||
<Image
|
||||
alt={'Copy API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/28d89add-cb18-4b86-9807-f2a5ed65ceba'}
|
||||
/>
|
||||
|
||||
### Step 2: Configure OpenAI in LobeChat
|
||||
|
||||
- Go to the `Settings` interface in LobeChat
|
||||
- Find the setting for `Google Gemini` under `Language Models`
|
||||
|
||||
<Image
|
||||
alt={'Enter Google Gemini API Key in LobeChat'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/11442ce4-a615-49c4-937a-ca2ae93dd27c'}
|
||||
/>
|
||||
|
||||
- Enable Google Gemini and enter the obtained API key
|
||||
- Choose a Gemini model for your assistant to start the conversation
|
||||
|
||||
<Image
|
||||
alt={'Select and Use Gemini Model'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/ef9ed1b8-6828-4dd6-b86b-bb0b4fa40619'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
During usage, you may need to pay the API service provider, please refer to Google Gemini's
|
||||
pricing policy.
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
Congratulations! You can now use Google Gemini in LobeChat.
|
||||
@@ -0,0 +1,78 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用 Google Gemini API Key
|
||||
description: 本文将指导你如何在 LobeChat 中配置并使用 Google Gemini,一个由 Google AI 创建的强大语言模型。
|
||||
tags:
|
||||
- Google Gemini
|
||||
- Google AI
|
||||
- API 密钥
|
||||
- Web UI
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用 Google Gemini
|
||||
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用 Google Gemini'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/9a8dc1d4-152b-415f-a7cd-8f0c8fbb9913'}
|
||||
/>
|
||||
|
||||
Gemini AI是由 Google AI 创建的一组大型语言模型(LLM),以其在多模式理解和处理方面的尖端进步而闻名。它本质上是一个强大的人工智能工具,可以处理涉及不同类型数据的各种任务,而不仅仅是文本。
|
||||
|
||||
本文档将指导你如何在 LobeChat 中使用 Google Gemini:
|
||||
|
||||
<Steps>
|
||||
|
||||
### 步骤一:获取 Google 的 API 密钥
|
||||
|
||||
- 访问并登录 [Google AI Studio](https://aistudio.google.com/)
|
||||
- 在 `获取 API 密钥` 菜单中 `创建 API 密钥`
|
||||
|
||||
<Image
|
||||
alt={'生成 Google Gemini 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/ba3595e3-d9cb-4d0d-b414-8306b16df186'}
|
||||
/>
|
||||
|
||||
- 选择一个项目并创建 API 密钥,或者在新项目中创建 API 密钥
|
||||
|
||||
<Image
|
||||
alt={'输入 API 密钥名称'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/fa725e49-4c17-4055-82bc-98a31e73fa54'}
|
||||
/>
|
||||
|
||||
- 在弹出的对话框中复制 API 密钥
|
||||
|
||||
<Image
|
||||
alt={'复制 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/28d89add-cb18-4b86-9807-f2a5ed65ceba'}
|
||||
/>
|
||||
|
||||
### 步骤二:在 LobeChat 中配置OpenAI
|
||||
|
||||
- 访问LobeChat的`设置`界面
|
||||
- 在`语言模型`下找到`Google Gemini`的设置项
|
||||
|
||||
<Image
|
||||
alt={'LobeChat 中填写 Google Gemini API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/11442ce4-a615-49c4-937a-ca2ae93dd27c'}
|
||||
/>
|
||||
|
||||
- 打开 Google Gemini 并填入获得的 API 密钥
|
||||
- 为你的助手选择一个 Gemini 的模型即可开始对话
|
||||
|
||||
<Image
|
||||
alt={' 选择并使用 Gemini 模型 '}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/ef9ed1b8-6828-4dd6-b86b-bb0b4fa40619'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
在使用过程中你可能需要向 API 服务提供商付费,请参考 Google Gemini 的费用政策。
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
至此,你已经可以在 LobeChat 中使用 Google Gemini 啦。
|
||||
@@ -1,27 +1,23 @@
|
||||
---
|
||||
title: Using Groq in LobeChat
|
||||
title: Using Groq API Key in LobeChat
|
||||
description: >-
|
||||
Integrate Groq's LPU Inference Engine with LobeChat to accelerate large
|
||||
language models. Learn how to obtain GroqCloud API keys and configure Groq in
|
||||
LobeChat for optimal performance.
|
||||
Learn how to obtain GroqCloud API keys and configure Groq in LobeChat for
|
||||
optimal performance.
|
||||
tags:
|
||||
- Groq
|
||||
- LobeChat
|
||||
- AI solutions
|
||||
- LPU Inference Engine
|
||||
- GroqCloud
|
||||
- LLAMA3
|
||||
- Qwen2
|
||||
- API keys
|
||||
- Language Model
|
||||
- Web UI
|
||||
---
|
||||
|
||||
import { Callout, Steps } from 'nextra/components';
|
||||
|
||||
# Using Groq in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Using Groq in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/d0d08d98-a8d2-4b97-97c0-24a4f01d7eac'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/1d840e27-fa74-4e71-b777-330bf41d6dff'}
|
||||
/>
|
||||
|
||||
Groq's [LPU Inference Engine](https://wow.groq.com/news_press/groq-lpu-inference-engine-leads-in-first-independent-llm-benchmark/) has excelled in the latest independent Large Language Model (LLM) benchmark, redefining the standard for AI solutions with its remarkable speed and efficiency. By integrating LobeChat with Groq Cloud, you can now easily leverage Groq's technology to accelerate the operation of large language models in LobeChat.
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用 Groq
|
||||
description: >-
|
||||
通过 LobeChat 与 Groq Cloud 的集成,利用 Groq 的技术加速大语言模型的运行。了解如何获取 GroqCloud API Key,并在
|
||||
LobeChat 中配置 Groq,体验 Groq 强大的性能。
|
||||
title: 在 LobeChat 中使用 Groq API Key
|
||||
description: 了解如何获取 GroqCloud API Key,并在 LobeChat 中配置 Groq,体验 Groq 强大的性能。
|
||||
tags:
|
||||
- Groq
|
||||
- LobeChat
|
||||
- 大语言模型
|
||||
- AI 解决方案
|
||||
- LLAMA3
|
||||
- Qwen2
|
||||
- API keys
|
||||
- Web UI
|
||||
- API Key
|
||||
- GroqCloud
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用 Groq
|
||||
@@ -17,7 +14,7 @@ tags:
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用 Groq'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/d0d08d98-a8d2-4b97-97c0-24a4f01d7eac'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/1d840e27-fa74-4e71-b777-330bf41d6dff'}
|
||||
/>
|
||||
|
||||
Groq 的 [LPU 推理引擎](https://wow.groq.com/news_press/groq-lpu-inference-engine-leads-in-first-independent-llm-benchmark/) 在最新的独立大语言模型(LLM)基准测试中表现卓越,以其惊人的速度和效率重新定义了 AI 解决方案的标准。通过 LobeChat 与 Groq Cloud 的集成,你现在可以轻松地利用 Groq 的技术,在 LobeChat 中加速大语言模型的运行。
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
title: Using Minimax API Key in LobeChat
|
||||
description: >-
|
||||
Learn how to use MiniMax in LobeChat to enhance AI conversations. Obtain
|
||||
MiniMax API key, configure MiniMax in LobeChat settings, and select a model
|
||||
for your AI assistant.
|
||||
tags:
|
||||
- MiniMax
|
||||
- Web UI
|
||||
- API Key
|
||||
- MiniMax Models
|
||||
---
|
||||
|
||||
# Using Minimax in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Using Minimax in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/703f170b-c03b-4c71-b57d-c2357596bdfb'}
|
||||
/>
|
||||
|
||||
[MiniMax](https://www.minimaxi.com/) is a general artificial intelligence technology company founded in 2021, dedicated to co-creating intelligence with users. MiniMax has independently developed universal large models of different modalities, including trillion-parameter MoE text large models, speech large models, and image large models. They have also launched applications like Hai Luo AI.
|
||||
|
||||
This document will guide you on how to use Minimax in LobeChat:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Step 1: Obtain MiniMax API Key
|
||||
|
||||
- Register and log in to the [MiniMax Open Platform](https://www.minimaxi.com/platform)
|
||||
- In `Account Management`, locate the `API Key` menu and create a new key
|
||||
|
||||
<Image
|
||||
alt={'Create MiniMax API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f6e46f1c-0ac9-42ae-8e83-ddb0cc6c5bf8'}
|
||||
/>
|
||||
|
||||
- Enter a name for the API key and create it
|
||||
|
||||
<Image
|
||||
alt={'Enter API Key Name'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/cbc23ca9-1188-4b85-8ef0-e75ac7d74b92'}
|
||||
/>
|
||||
|
||||
- Copy the API key from the pop-up dialog box and save it securely
|
||||
|
||||
<Image
|
||||
alt={'Save API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/fb0f7574-c2f5-40d6-8613-3749e85ce881'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Please store the key securely as it will only appear once. If you accidentally lose it, you will
|
||||
need to create a new key.
|
||||
</Callout>
|
||||
|
||||
### Step 2: Configure MiniMax in LobeChat
|
||||
|
||||
- Go to the `Settings` interface of LobeChat
|
||||
- Find the setting for `MiniMax` under `Language Model`
|
||||
|
||||
<Image
|
||||
alt={'Enter API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/b839e04e-0cef-46a3-bb84-0484a3f51c69'}
|
||||
/>
|
||||
|
||||
- Open Minimax and enter the obtained API key
|
||||
- Choose a MiniMax model for your AI assistant to start the conversation
|
||||
|
||||
<Image
|
||||
alt={'Select MiniMax Model and Start Conversation'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f7d59c7a-abd0-4ebd-8c72-ca10c47a0f1a'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
During usage, you may need to pay the API service provider, please refer to MiniMax's relevant
|
||||
pricing policies.
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
You can now use the models provided by MiniMax to have conversations in LobeChat.
|
||||
@@ -0,0 +1,84 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用 Minimax API Key
|
||||
description: >-
|
||||
学习如何在 LobeChat 中配置并使用 MiniMax 智能模型进行对话。获取 MiniMax API 密钥、配置步骤详解,开始与 MiniMax
|
||||
模型交互。
|
||||
tags:
|
||||
- LobeChat
|
||||
- MiniMax
|
||||
- API密钥
|
||||
- Web UI
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用 Minimax
|
||||
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用 Minimax'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/703f170b-c03b-4c71-b57d-c2357596bdfb'}
|
||||
/>
|
||||
|
||||
[MiniMax](https://www.minimaxi.com/) 是 2021 年成立的通用人工智能科技公司,致力于与用户共创智能。MiniMax 自主研发了不同模态的通用大模型,其中包括万亿参数的 MoE 文本大模型、语音大模型以及图像大模型。并推出了海螺 AI 等应用。
|
||||
|
||||
本文档将指导你如何在 LobeChat 中使用 Minimax:
|
||||
|
||||
<Steps>
|
||||
|
||||
### 步骤一:获取 MiniMax API 密钥
|
||||
|
||||
- 注册并登录 [MiniMax 开放平台](https://www.minimaxi.com/platform)
|
||||
- 在 `账户管理` 中找到 `接口密钥` 菜单,并创建新的密钥
|
||||
|
||||
<Image
|
||||
alt={'创建 MiniMax API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f6e46f1c-0ac9-42ae-8e83-ddb0cc6c5bf8'}
|
||||
/>
|
||||
|
||||
- 填写一个 API 密钥的名称并创建
|
||||
|
||||
<Image
|
||||
alt={'填写 API 密钥名称'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/cbc23ca9-1188-4b85-8ef0-e75ac7d74b92'}
|
||||
/>
|
||||
|
||||
- 在弹出的对话框中复制 API 密钥,并妥善保存
|
||||
|
||||
<Image
|
||||
alt={'保存 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/fb0f7574-c2f5-40d6-8613-3749e85ce881'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
请安全地存储密钥,因为它只会出现一次。如果您意外丢失它,您将需要创建一个新密钥。
|
||||
</Callout>
|
||||
|
||||
### 步骤二:在LobeChat 中配置 MiniMax
|
||||
|
||||
- 访问 LobeChat 的`设置`界面
|
||||
- 在`语言模型`下找到`MiniMax`的设置项
|
||||
|
||||
<Image
|
||||
alt={'填入 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/b839e04e-0cef-46a3-bb84-0484a3f51c69'}
|
||||
/>
|
||||
|
||||
- 打开 Minimax 并填入获得的 API 密钥
|
||||
- 为你的 AI 助手选择一个 MiniMax 的模型即可开始对话
|
||||
|
||||
<Image
|
||||
alt={'选择 MiniMax 模型并开始对话'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f7d59c7a-abd0-4ebd-8c72-ca10c47a0f1a'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
在使用过程中你可能需要向 API 服务提供商付费,请参考 MiniMax 的相关费用政策。
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
至此你已经可以在 LobeChat 中使用 MiniMax 提供的模型进行对话了。
|
||||
@@ -0,0 +1,69 @@
|
||||
---
|
||||
title: Using Mistral AI API Key in LobeChat
|
||||
description: >-
|
||||
Learn how to integrate Mistral AI into LobeChat for enhanced conversational
|
||||
experiences. Follow the steps to configure Mistral AI and start using its
|
||||
models.
|
||||
tags:
|
||||
- Mistral AI
|
||||
- Web UI
|
||||
- API key
|
||||
---
|
||||
|
||||
# Using Mistral AI in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Using Mistral AI in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/a3f9f63a-48f8-4567-b960-7f3636c0d4ed'}
|
||||
/>
|
||||
|
||||
The Mistral AI API is now available for everyone to use. This document will guide you on how to use [Mistral AI](https://mistral.ai/) in LobeChat:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Step 1: Obtain Mistral AI API Key
|
||||
|
||||
- Create a [Mistral AI](https://mistral.ai/) account
|
||||
- Obtain your [API key](https://console.mistral.ai/user/api-keys/)
|
||||
|
||||
<Image
|
||||
alt={'Obtain your API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/79faa59a-dfc0-4365-a679-5fc12c12bc70'}
|
||||
/>
|
||||
|
||||
### Step 2: Configure Mistral AI in LobeChat
|
||||
|
||||
- Go to the `Settings` interface in LobeChat
|
||||
- Find the setting for `Mistral AI` under `Language Model`
|
||||
|
||||
<Image
|
||||
alt={'Enter API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ba8e688a-e0c1-4567-9013-94205f83fc60'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
If you are using mistral.ai, your account must have a valid subscription for the API key to work
|
||||
properly. Newly created API keys may take 2-3 minutes to become active. If the "Test" button
|
||||
fails, please retry after 2-3 minutes.
|
||||
</Callout>
|
||||
|
||||
- Enter the obtained API key
|
||||
- Choose a Mistral AI model for your AI assistant to start the conversation
|
||||
|
||||
<Image
|
||||
alt={'Select Mistral AI Model and Start Conversation'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/82cf4f5c-be5c-4126-a475-3a03468a9c39'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
During usage, you may need to pay the API service provider, please refer to Mistral AI's relevant
|
||||
pricing policies.
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
You can now engage in conversations using the models provided by Mistral AI in LobeChat.
|
||||
@@ -0,0 +1,64 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用 Mistral AI API Key
|
||||
description: 学习如何在 LobeChat 中配置并使用 Mistral AI,包括获取 API 密钥和选择适合的 AI 模型进行对话。
|
||||
tags:
|
||||
- Web UI
|
||||
- Mistral AI
|
||||
- API Key
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用 Mistral AI
|
||||
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用 Mistral AI'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/a3f9f63a-48f8-4567-b960-7f3636c0d4ed'}
|
||||
/>
|
||||
|
||||
Mistral AI API 现在可供所有人使用, 本文档将指导你如何在 LobeChat 中使用 [Mistral AI](https://mistral.ai/):
|
||||
|
||||
<Steps>
|
||||
|
||||
### 步骤一:获取 Mistral AI API 密钥
|
||||
|
||||
- 创建一个 [Mistral AI](https://mistral.ai/) 帐户
|
||||
- 获取您的 [API 密钥](https://console.mistral.ai/user/api-keys/)
|
||||
|
||||
<Image
|
||||
alt={'创建 API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/79faa59a-dfc0-4365-a679-5fc12c12bc70'}
|
||||
/>
|
||||
|
||||
### 步骤二:在 LobeChat 中配置 Mistral AI
|
||||
|
||||
- 访问 LobeChat 的`设置`界面
|
||||
- 在`语言模型`下找到`Mistral AI`的设置项
|
||||
|
||||
<Image
|
||||
alt={'填入 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ba8e688a-e0c1-4567-9013-94205f83fc60'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
如果您使用的是 mistral.ai,则您的帐户必须具有有效的订阅才能使 API 密钥正常工作。新创建的 API
|
||||
密钥需要 2-3 分钟才能开始工作。如果单击“测试”按钮但失败,请在 2-3 分钟后重试。
|
||||
</Callout>
|
||||
|
||||
- 填入获得的 API 密钥
|
||||
- 为你的 AI 助手选择一个 Mistral AI 的模型即可开始对话
|
||||
|
||||
<Image
|
||||
alt={'选择 Mistral AI 模型并开始对话'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/82cf4f5c-be5c-4126-a475-3a03468a9c39'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
在使用过程中你可能需要向 API 服务提供商付费,请参考 Mistral AI 的相关费用政策。
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
至此你已经可以在 LobeChat 中使用 Mistral AI 提供的模型进行对话了。
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
title: Using Moonshot AI API Key in LobeChat
|
||||
description: >-
|
||||
Learn how to integrate Moonshot AI into LobeChat for AI-powered conversations.
|
||||
Follow the steps to get the API key, configure Moonshot AI, and start engaging
|
||||
with AI models.
|
||||
tags:
|
||||
- Moonshot AI
|
||||
- Web UI
|
||||
- API Key
|
||||
---
|
||||
|
||||
# Using Moonshot AI in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Using Moonshot AI in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/21b94782-875b-4dee-a572-3c5843f3e1e3'}
|
||||
/>
|
||||
|
||||
The Moonshot AI API is now available for everyone to use. This document will guide you on how to use [Moonshot AI](https://www.moonshot.cn/) in LobeChat:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Step 1: Get Moonshot AI API Key
|
||||
|
||||
- Apply for your [API key](https://platform.moonshot.cn/console/api-keys)
|
||||
|
||||
<Image
|
||||
alt={'Apply for API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/4e56e080-9b8c-42e1-87e1-11123dbb9067'}
|
||||
/>
|
||||
|
||||
### Step 2: Configure Moonshot AI in LobeChat
|
||||
|
||||
- Visit the `Settings` interface in LobeChat
|
||||
- Find the setting for `Moonshot AI` under `Language Models`
|
||||
|
||||
<Image
|
||||
alt={'Enter API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/e1b5f84f-015e-437c-98cc-a3431fa3b077'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
If you are using mistral.ai, your account must have a valid subscription for the API key to work
|
||||
properly. Newly created API keys may take 2-3 minutes to become active. If the "Test" button
|
||||
fails, please retry after 2-3 minutes.
|
||||
</Callout>
|
||||
|
||||
- Enter the API key you obtained
|
||||
- Choose a Moonshot AI model for your AI assistant to start the conversation
|
||||
|
||||
<Image
|
||||
alt={'Select Moonshot AI model and start conversation'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/eb7273f8-f0ed-4b9b-884e-96d29c406cb7'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
During usage, you may need to pay the API service provider according to Moonshot AI's related
|
||||
pricing policies.
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
You can now engage in conversations using the models provided by Moonshot AI in LobeChat.
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用 Moonshot(月之暗面) AI API Key
|
||||
description: 学习如何在 LobeChat 中配置和使用 Moonshot AI,包括获取 API 密钥和选择适合的 AI 模型进行对话。
|
||||
tags:
|
||||
- Moonshot AI
|
||||
- Web UI
|
||||
- API Key
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用 Moonshot AI
|
||||
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用 Moonshot AI'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/21b94782-875b-4dee-a572-3c5843f3e1e3'}
|
||||
/>
|
||||
|
||||
Moonshot AI API 现在可供所有人使用, 本文档将指导你如何在 LobeChat 中使用 [Moonshot AI](https://www.moonshot.cn/):
|
||||
|
||||
<Steps>
|
||||
|
||||
### 步骤一:获取 Moonshot AI API 密钥
|
||||
|
||||
- 申请您的 [API 密钥](https://platform.moonshot.cn/console/api-keys)
|
||||
|
||||
<Image
|
||||
alt={'申请 API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/4e56e080-9b8c-42e1-87e1-11123dbb9067'}
|
||||
/>
|
||||
|
||||
### 步骤二:在 LobeChat 中配置 Moonshot AI
|
||||
|
||||
- 访问 LobeChat 的`设置`界面
|
||||
- 在`语言模型`下找到`Moonshot AI`的设置项
|
||||
|
||||
<Image
|
||||
alt={'填入 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/e1b5f84f-015e-437c-98cc-a3431fa3b077'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
如果您使用的是 mistral.ai,则您的帐户必须具有有效的订阅才能使 API 密钥正常工作。新创建的 API
|
||||
密钥需要 2-3 分钟才能开始工作。如果单击“测试”按钮但失败,请在 2-3 分钟后重试。
|
||||
</Callout>
|
||||
|
||||
- 填入获得的 API 密钥
|
||||
- 为你的 AI 助手选择一个 Moonshot AI 的模型即可开始对话
|
||||
|
||||
<Image
|
||||
alt={'选择 Moonshot AI 模型并开始对话'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/eb7273f8-f0ed-4b9b-884e-96d29c406cb7'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
在使用过程中你可能需要向 API 服务提供商付费,请参考 Moonshot AI 的相关费用政策。
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
至此你已经可以在 LobeChat 中使用 Moonshot AI 提供的模型进行对话了。
|
||||
@@ -5,9 +5,10 @@ description: >-
|
||||
cutting-edge AI usage.
|
||||
tags:
|
||||
- Ollama
|
||||
- LobeChat
|
||||
- Local LLM
|
||||
- Ollama WebUI
|
||||
- Web UI
|
||||
- API Key
|
||||
---
|
||||
|
||||
# Using Ollama in LobeChat
|
||||
@@ -16,7 +17,7 @@ tags:
|
||||
alt={'Using Ollama in LobeChat'}
|
||||
borderless
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/a2a091b8-ac45-4679-b5e0-21d711e17fef'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/f579b39b-e771-402c-a1d1-620e57a10c75'}
|
||||
/>
|
||||
|
||||
Ollama is a powerful framework for running large language models (LLMs) locally, supporting various language models including Llama 2, Mistral, and more. Now, LobeChat supports integration with Ollama, meaning you can easily enhance your application by using the language models provided by Ollama in LobeChat.
|
||||
|
||||
@@ -3,7 +3,8 @@ title: 在 LobeChat 中使用 Ollama
|
||||
description: 了解如何在 LobeChat 中使用 Ollama ,在你的本地运行大型语言模型,获得最前沿的 AI 使用体验。
|
||||
tags:
|
||||
- Ollama
|
||||
- LobeChat
|
||||
- Web UI
|
||||
- API Key
|
||||
- Local LLM
|
||||
- Ollama WebUI
|
||||
---
|
||||
@@ -14,7 +15,7 @@ tags:
|
||||
alt={'在 LobeChat 中使用 Ollama'}
|
||||
borderless
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/a2a091b8-ac45-4679-b5e0-21d711e17fef'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/f579b39b-e771-402c-a1d1-620e57a10c75'}
|
||||
/>
|
||||
|
||||
Ollama 是一款强大的本地运行大型语言模型(LLM)的框架,支持多种语言模型,包括 Llama 2, Mistral 等。现在,LobeChat 已经支持与 Ollama 的集成,这意味着你可以在 LobeChat 中轻松使用 Ollama 提供的语言模型来增强你的应用。
|
||||
|
||||
@@ -17,7 +17,7 @@ tags:
|
||||
<Image
|
||||
alt={'Using Gemma in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/e636cb41-5b7f-4949-a236-1cc1633bd223'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/65d2dd2a-fdcf-4f3f-a6af-4ed5164a510d'}
|
||||
/>
|
||||
|
||||
[Gemma](https://blog.google/technology/developers/gemma-open-models/) is an open-source large language model (LLM) from Google, designed to provide a more general and flexible model for various natural language processing tasks. Now, with the integration of LobeChat and [Ollama](https://ollama.com/), you can easily use Google Gemma in LobeChat.
|
||||
|
||||
@@ -17,7 +17,7 @@ tags:
|
||||
alt={'在 LobeChat 中使用 Gemma'}
|
||||
cover
|
||||
rounded
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/e636cb41-5b7f-4949-a236-1cc1633bd223'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/65d2dd2a-fdcf-4f3f-a6af-4ed5164a510d'}
|
||||
/>
|
||||
|
||||
[Gemma](https://blog.google/technology/developers/gemma-open-models/) 是 Google 开源的一款大语言模型(LLM),旨在提供一个更加通用、灵活的模型用于各种自然语言处理任务。现在,通过 LobeChat 与 [Ollama](https://ollama.com/) 的集成,你可以轻松地在 LobeChat 中使用 Google Gemma。
|
||||
|
||||
@@ -14,7 +14,7 @@ tags:
|
||||
<Image
|
||||
alt={'Using Qwen in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/7a5fd01a-9fed-49c1-93a3-422269213f19'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/b4a01219-e7b1-48a0-888c-f0271b18e3a6'}
|
||||
/>
|
||||
|
||||
[Qwen](https://github.com/QwenLM/Qwen1.5) is a large language model (LLM) open-sourced by Alibaba Cloud. It is officially defined as a constantly evolving AI large model, and it achieves more accurate Chinese recognition capabilities through more training set content.
|
||||
|
||||
@@ -14,7 +14,7 @@ tags:
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用 Qwen'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/7a5fd01a-9fed-49c1-93a3-422269213f19'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/b4a01219-e7b1-48a0-888c-f0271b18e3a6'}
|
||||
/>
|
||||
|
||||
[通义千问](https://github.com/QwenLM/Qwen1.5) 是阿里云开源的一款大语言模型(LLM),官方定义是一个不断进化的 AI 大模型,并通过更多的训练集内容达到更精准的中文识别能力。
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user