* ✨ feat: add build-in web search support for Wenxin
* 🐛 fix: fix web_search calling issue
* ✨ feat: add support wenxin `search_results` stream
* ✨ feat: add `search_info` stream support for Hunyuan
* 🔨 chore: minor logic
* 🔨 chore: add unit test
* 🐛 fix: try to fix ci error
* 🐛 fix: fix ci error
* Add unit tests for applyUrlRules function to cover various scenarios and edge cases.
* Add unit tests for applyUrlRules function to cover various URL transformation scenarios.
---------
Co-authored-by: gru-agent[bot] <185149714+gru-agent[bot]@users.noreply.github.com>
* add claude3.7 and bedrock
* add descriptions
* add reasoning to claude 3.7
* add claude 3.7 to bedrock
* added abilities
* retrieve deleted claude 3.5 v1 to bedrock
* reorderd abilities and added max output
* fix lint
---------
Co-authored-by: arvinxx <arvinx@foxmail.com>
* 💄 style: add `kimi-latest` for Moonshot
* 💄 style: update model list
* 💄 style: update model desc and cachedInput
* 💄 style: fix no model enabled
* 💄 style: update check model
* ✨ feat: Add configurable PDF processing method with Unstructured
* 🔧 fix: Update import path for env utility in ContentChunk module
* feat: add USE_UNSTRUCTURED_FOR_PDF environment variable to knowledge config
* Delete src/server/utils/env.ts
* feat: implement ChunkingRuleParser for file type and service mapping
* refactor: remove USE_UNSTRUCTURED_FOR_PDF from knowledge environment configuration
* test: add unit tests for ChunkingRuleParser functionality
* refactor: remove isUsingUnstructured method from ContentChunk class
* refactor: update ChunkingService type and clean up ContentChunk rules
* refactor: simplify ChunkingRuleParser and update ContentChunk module
* refactor: update ContentChunk module import for ChunkingService
* ♻️ refactor: refactor model fetch behavior
* 🐛 fix: fix gemini thinking model set functionCall tag
* 🐛 fix: fix Spark fc tag missing
* ✨ feat: add model fetch support for Tencent Cloud
* ♻️ refactor: refactor import `LOBE_DEFAULT_MODEL_LIST` with async method - Part 1
* ♻️ refactor: refactor import LOBE_DEFAULT_MODEL_LIST with async method - Part 2
* 🔨 chore: add vision, reasoning, fc default value
* ♻️ refactor: improve knownModel matching
* 🐛 fix: fix ci error
* Add unit tests for aiProviderRouter functionality in aiProvider.test.ts
* Add export for aiProviderProcedure in aiProvider.ts.
* Update aiProvider.ts
* ✨ feat: Support include_reasoning for OpenRouter provider's models. Solves #5766
* ✨ feat: Support display OpenRouter's "reasoning" output by transforming
its "reasoning" to be consistent with most other platforms: reasoning outputs wrapped by <think> XML tag.
* Revert openrouter stream transformer: Capture reasoning content inside openai stream processor
* Address PR comments: r1 does not support functional calling
* add unittest for openrouter reasoning stream handling
* fix: ensure that reasoning_content is a non-empty string when dealing with Aliyun Bailian
* fix: improve handling of reasoning_content and content in OpenAI stream transformation
* test: add openai reasoning test in aliyun bailian api
* make rewrite with local
* try longitude
* refactor the isMobile condition
* support use longitude as theme detector
* improve dockerfile
* improve geo
* improve geo
* improve geo
* vercel functions
* clean log
* skip api request at first
* turn back status in rewrite
This upgrade includes two changes:
For users deploying with Vercel using next-auth, it is necessary to add the environment variable `NEXT_PUBLIC_ENABLE_NEXT_AUTH=1` to ensure Next Auth is enabled; other users are not affected.
For users using clerk in self-built images, it is necessary to additionally configure `NEXT_PUBLIC_ENABLE_NEXT_AUTH=0` to disable Next Auth
Other standard deployment scenarios (using Clerk in Vercel and using next-auth in Docker) are not affected
For More detail, refer to https://github.com/lobehub/lobe-chat/issues/5804
本次升级存在两个变更:
- 针对使用 Vercel 部署中使用 next-auth 的用户,需要额外添加 `NEXT_PUBLIC_ENABLE_NEXT_AUTH=1` 环境变量来确保开启 Next Auth
- 针对使用自构建镜像中使用 clerk 的用户,需要额外配置 `NEXT_PUBLIC_ENABLE_NEXT_AUTH=0` 环境变量来关闭 Next Auth
其他标准部署场景(Vercel 中使用 Clerk 与 Docker 中使用 next-auth )不受影响
变更详情原因查看 https://github.com/lobehub/lobe-chat/issues/5804
* ✨ feat: Enhance LobeArtifact processing and rehype plugin
- Add test cases for artifact processing with adjacent lobeThinking tags
- Modify utils to insert empty line between lobeThinking and lobeArtifact
- Implement rehype plugin for transforming LobeArtifact tags in markdown
* ✨ feat: Improve LobeArtifact processing with advanced code block removal
- Add comprehensive test cases for artifact processing with various code block scenarios
- Enhance utils to handle fenced code blocks within and around lobeArtifact tags
- Support removing code blocks for HTML and other artifact types
* ✨ feat: Enhance LobeArtifact code block removal tests
- Add comprehensive test cases for processWithArtifact function
- Cover scenarios with HTML and tool_code code blocks
- Test handling of code blocks with content before and after
- Verify processing of artifacts with and without surrounding code blocks
* ✨ feat: Improve LobeArtifact code block processing regex
- Enhance regex in processWithArtifact to handle more complex code block scenarios
- Support better extraction of content before, within, and after code blocks
- Improve handling of artifacts with surrounding text and multiple tags
* ✨ feat: Add artifact processing and selector tests
- Enhance `processWithArtifact` with debug logging and improved code block handling
- Add comprehensive test cases for artifact-related selectors in chat store
- Implement tests for message content, artifact code extraction, and tag closure detection
* ✨ feat: Improve artifact code block extraction in selectors
- Add support for removing markdown code block wrapping in artifact content
- Update `artifactCode` selector to handle HTML and other code block scenarios
- Enhance test coverage for artifact code extraction with markdown-wrapped content
* 🔇 refactor: Remove debug console logs from processWithArtifact
- Clean up unnecessary console.log statements in artifact processing utility
- Improve code readability and performance by removing debug logging
- Maintain existing logic for artifact tag and code block processing
---------
Co-authored-by: yale <yale@example.com>
* 🐛 fix: fix pnpm cannot be installed via corepack due to key id mismatch
* 🔨 chore: workaround need update corepack to latest
* 🔨 chore: drop `jq` deps, use `sed` instead
* 💄 style: fix model fetch match tag error & add model fetch support for Hunyuan
* 💄 style: add `qvq-72b-preview` vision model
* 💄 style: add vision tag
* 💄 style: update Hunyuan model list
* 🐛 fix: fix Hunyuan model fetch ci error
* 💄 style: remove fc tag for Hunyuan vision model
* 🐛 fix: fix ci error
* 🔨 chore: support non-pglite mode
* 🐛 fix: improve validation for provider and model in parseFilesConfig
* 🐛 fix: update embeddings configuration test to reflect changes in model parsing
* 🐛 fix: update configuration keys from queryModel to queryMode and enhance parsing tests
* 🐛 fix: enhance error handling for invalid environment variable formats in parseFilesConfig
* feat: 添加嵌入模型配置支持,更新相关文档和测试
* feat: 重构文件配置,更新默认设置和相关测试
* ♻ Code Refactoring
- Update the file configuration and standardize the model naming to camel case.
* fix provider url
* improve fetch model list issue
* fix builtin model sort and displayName
* fix user enabled models
* fix model name
* fix model displayName name
* Update deepseek.ts
Update Deepseek V3 and description from deepseek official WeChat
Pricing has not been updated yet; it needs to be updated in 45 days
* Update deepseek.ts
Update deepseek price
- **[HuggingFace](https://lobechat.com/discover/provider/huggingface)**: HuggingFace Inference API は、数千のモデルをさまざまなタスクに対して探索するための迅速かつ無料の方法を提供します。新しいアプリケーションのプロトタイプを作成している場合でも、機械学習の機能を試している場合でも、この API は複数の分野の高性能モデルに即座にアクセスできるようにします。
- **[GitHub](https://lobechat.com/discover/provider/github)**: GitHub モデルを使用することで、開発者は AI エンジニアになり、業界をリードする AI モデルを使って構築できます。
<details><summary><kbd>See more providers (+26)</kbd></summary>
- **[Novita](https://lobechat.com/discover/provider/novita)**: Novita AI は、さまざまな大規模言語モデルと AI 画像生成の API サービスを提供するプラットフォームであり、柔軟で信頼性が高く、コスト効率に優れています。Llama3、Mistral などの最新のオープンソースモデルをサポートし、生成的 AI アプリケーションの開発に向けた包括的でユーザーフレンドリーかつ自動スケーリングの API ソリューションを提供し、AI スタートアップの急成長を支援します。
- **[Together AI](https://lobechat.com/discover/provider/togetherai)**: Together AI は、革新的な AI モデルを通じて先進的な性能を実現することに取り組んでおり、迅速なスケーリングサポートや直感的な展開プロセスを含む広範なカスタマイズ能力を提供し、企業のさまざまなニーズに応えています。
- **[Upstage](https://lobechat.com/discover/provider/upstage)**: Upstage は、さまざまなビジネスニーズに応じた AI モデルの開発に特化しており、Solar LLM や文書 AI を含み、人造一般知能(AGI)の実現を目指しています。Chat API を通じてシンプルな対話エージェントを作成し、機能呼び出し、翻訳、埋め込み、特定分野のアプリケーションをサポートします。
- **[Wenxin](https://lobechat.com/discover/provider/wenxin)**: 企業向けのワンストップ大規模モデルと AI ネイティブアプリケーションの開発およびサービスプラットフォームで、最も包括的で使いやすい生成的人工知能モデルの開発とアプリケーション開発の全プロセスツールチェーンを提供します。
- **[Spark](https://lobechat.com/discover/provider/spark)**: 科大訊飛星火大モデルは、多分野、多言語の強力な AI 能力を提供し、先進的な自然言語処理技術を利用して、スマートハードウェア、スマート医療、スマート金融などのさまざまな垂直シーンに適した革新的なアプリケーションを構築します。
- **[ZhiPu](https://lobechat.com/discover/provider/zhipu)**: 智谱 AI は、多モーダルおよび言語モデルのオープンプラットフォームを提供し、テキスト処理、画像理解、プログラミング支援など、幅広い AI アプリケーションシーンをサポートしています。
- **[01.AI](https://lobechat.com/discover/provider/zeroone)**: 01.AI は、AI 2.0 時代の人工知能技術に特化し、「人 + 人工知能」の革新と応用を推進し、超強力なモデルと先進的な AI 技術を用いて人類の生産性を向上させ、技術の力を実現します。
- **[InternLM](https://lobechat.com/discover/provider/internlm)**: 大規模モデルの研究と開発ツールチェーンに特化したオープンソース組織です。すべての AI 開発者に対して、高効率で使いやすいオープンプラットフォームを提供し、最先端の大規模モデルとアルゴリズム技術を身近に感じられるようにします。
- **[SiliconCloud](https://lobechat.com/discover/provider/siliconcloud)**: SiliconFlow は、AGI を加速させ、人類に利益をもたらすことを目指し、使いやすくコスト効率の高い GenAI スタックを通じて大規模 AI の効率を向上させることに取り組んでいます。
- **[Higress](https://lobechat.com/discover/provider/higress)**: Higress は、阿里内部で Tengine のリロードが長期接続のビジネスに悪影響を及ぼすことや、gRPC/Dubbo の負荷分散能力が不足している問題を解決するために生まれた、クラウドネイティブな API ゲートウェイです。
- **[Gitee AI](https://lobechat.com/discover/provider/giteeai)**: Gitee AI の Serverless API は、AI 開発者に開梱即使用の大モデル推論 API サービスを提供する。
</details>
> 📊 Total providers: [<kbd>**36**</kbd>](https://lobechat.com/discover/providers)
| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)<br/><sup>By **portfoliometa** on **2024-12-22**</sup> | 株を分析し、包括的なリアルタイムの投資データと分析を取得します。<br/>`stock` |
| [Google CSE](https://lobechat.com/discover/plugin/google-cse)<br/><sup>By **vsnthdev** on **2024-12-02**</sup> | 公式の CSE API を通じて Google を検索します。<br/>`ウェブ``検索` |
| [話す](https://lobechat.com/discover/plugin/speak)<br/><sup>By **speak** on **2024-12-02**</sup> | Speak は、AI パワードの言語チューターで、他の言語で何でも言う方法を学ぶことができます。<br/>`教育``言語` |
- [`12` Support Local / Remote Database](#12-support-local--remote-database)
- [`13` Support Multi-User Management](#13-support-multi-user-management)
- [`14` Progressive Web App (PWA)](#14-progressive-web-app-pwa)
- [`15` Mobile Device Adaptation](#15-mobile-device-adaptation)
- [`16` Custom Themes](#16-custom-themes)
- [`*` What's more](#-whats-more)
- [⚡️ Performance](#️-performance)
- [🛳 Self Hosting](#-self-hosting)
@@ -111,9 +114,48 @@ Whether for users or professional developers, LobeHub will be your AI Agent play
## ✨ Features
[![][image-feat-cot]][docs-feat-cot]
### `1` [Chain of Thought][docs-feat-cot]
Experience AI reasoning like never before. Watch as complex problems unfold step by step through our innovative Chain of Thought (CoT) visualization. This breakthrough feature provides unprecedented transparency into AI's decision-making process, allowing you to observe how conclusions are reached in real-time.
By breaking down complex reasoning into clear, logical steps, you can better understand and validate the AI's problem-solving approach. Whether you're debugging, learning, or simply curious about AI reasoning, CoT visualization transforms abstract thinking into an engaging, interactive experience.
Introducing a more natural and flexible way to chat with AI. With Branch Conversations, your discussions can flow in multiple directions, just like human conversations do. Create new conversation branches from any message, giving you the freedom to explore different paths while preserving the original context.
Choose between two powerful modes:
- **Continuation Mode:** Seamlessly extend your current discussion while maintaining valuable context
- **Standalone Mode:** Start fresh with a new topic based on any previous message
This groundbreaking feature transforms linear conversations into dynamic, tree-like structures, enabling deeper exploration of ideas and more productive interactions.
[![][back-to-top]](#readme-top)
[![][image-feat-artifacts]][docs-feat-artifacts]
### `3` [Artifacts Support][docs-feat-artifacts]
Experience the power of Claude Artifacts, now integrated into LobeChat. This revolutionary feature expands the boundaries of AI-human interaction, enabling real-time creation and visualization of diverse content formats.
Create and visualize with unprecedented flexibility:
- Generate and display dynamic SVG graphics
- Build and render interactive HTML pages in real-time
- Produce professional documents in multiple formats
LobeChat supports file upload and knowledge base functionality. You can upload various types of files including documents, images, audio, and video, as well as create knowledge bases, making it convenient for users to manage and search for files. Additionally, you can utilize files and knowledge base features during conversations, enabling a richer dialogue experience.
@@ -131,7 +173,7 @@ LobeChat supports file upload and knowledge base functionality. You can upload v
[![][image-feat-privoder]][docs-feat-provider]
### `2` [Multi-Model Service Provider Support][docs-feat-provider]
### `5` [Multi-Model Service Provider Support][docs-feat-provider]
In the continuous development of LobeChat, we deeply understand the importance of diversity in model service providers for meeting the needs of the community when providing AI conversation services. Therefore, we have expanded our support to multiple model service providers, rather than being limited to a single one, in order to offer users a more diverse and rich selection of conversations.
@@ -154,9 +196,10 @@ We have implemented support for the following model service providers:
- **[Cloudflare Workers AI](https://lobechat.com/discover/provider/cloudflare)**: Run serverless GPU-powered machine learning models on Cloudflare's global network.
- **[GitHub](https://lobechat.com/discover/provider/github)**: With GitHub Models, developers can become AI engineers and leverage the industry's leading AI models.
<details><summary><kbd>See more providers (+26)</kbd></summary>
<details><summary><kbd>See more providers (+27)</kbd></summary>
- **[Novita](https://lobechat.com/discover/provider/novita)**: Novita AI is a platform providing a variety of large language models and AI image generation API services, flexible, reliable, and cost-effective. It supports the latest open-source models like Llama3 and Mistral, offering a comprehensive, user-friendly, and auto-scaling API solution for generative AI application development, suitable for the rapid growth of AI startups.
- **[PPIO](https://lobechat.com/discover/provider/ppio)**: PPIO supports stable and cost-efficient open-source LLM APIs, such as DeepSeek, Llama, Qwen etc.
- **[Together AI](https://lobechat.com/discover/provider/togetherai)**: Together AI is dedicated to achieving leading performance through innovative AI models, offering extensive customization capabilities, including rapid scaling support and intuitive deployment processes to meet various enterprise needs.
- **[Fireworks AI](https://lobechat.com/discover/provider/fireworksai)**: Fireworks AI is a leading provider of advanced language model services, focusing on functional calling and multimodal processing. Its latest model, Firefunction V2, is based on Llama-3, optimized for function calling, conversation, and instruction following. The visual language model FireLLaVA-13B supports mixed input of images and text. Other notable models include the Llama series and Mixtral series, providing efficient multilingual instruction following and generation support.
- **[Groq](https://lobechat.com/discover/provider/groq)**: Groq's LPU inference engine has excelled in the latest independent large language model (LLM) benchmarks, redefining the standards for AI solutions with its remarkable speed and efficiency. Groq represents instant inference speed, demonstrating strong performance in cloud-based deployments.
@@ -168,24 +211,24 @@ We have implemented support for the following model service providers:
- **[Qwen](https://lobechat.com/discover/provider/qwen)**: Tongyi Qianwen is a large-scale language model independently developed by Alibaba Cloud, featuring strong natural language understanding and generation capabilities. It can answer various questions, create written content, express opinions, and write code, playing a role in multiple fields.
- **[Wenxin](https://lobechat.com/discover/provider/wenxin)**: An enterprise-level one-stop platform for large model and AI-native application development and services, providing the most comprehensive and user-friendly toolchain for the entire process of generative artificial intelligence model development and application development.
- **[Hunyuan](https://lobechat.com/discover/provider/hunyuan)**: A large language model developed by Tencent, equipped with powerful Chinese creative capabilities, logical reasoning abilities in complex contexts, and reliable task execution skills.
- **[Spark](https://lobechat.com/discover/provider/spark)**: iFlytek's Spark model provides powerful AI capabilities across multiple domains and languages, utilizing advanced natural language processing technology to build innovative applications suitable for smart hardware, smart healthcare, smart finance, and other vertical scenarios.
- **[ZhiPu](https://lobechat.com/discover/provider/zhipu)**: Zhipu AI offers an open platform for multimodal and language models, supporting a wide range of AI application scenarios, including text processing, image understanding, and programming assistance.
- **[SiliconCloud](https://lobechat.com/discover/provider/siliconcloud)**: SiliconFlow is dedicated to accelerating AGI for the benefit of humanity, enhancing large-scale AI efficiency through an easy-to-use and cost-effective GenAI stack.
- **[01.AI](https://lobechat.com/discover/provider/zeroone)**: 01.AI focuses on AI 2.0 era technologies, vigorously promoting the innovation and application of 'human + artificial intelligence', using powerful models and advanced AI technologies to enhance human productivity and achieve technological empowerment.
- **[Spark](https://lobechat.com/discover/provider/spark)**: iFlytek's Spark model provides powerful AI capabilities across multiple domains and languages, utilizing advanced natural language processing technology to build innovative applications suitable for smart hardware, smart healthcare, smart finance, and other vertical scenarios.
- **[SenseNova](https://lobechat.com/discover/provider/sensenova)**: SenseNova, backed by SenseTime's robust infrastructure, offers efficient and user-friendly full-stack large model services.
- **[Stepfun](https://lobechat.com/discover/provider/stepfun)**: StepFun's large model possesses industry-leading multimodal and complex reasoning capabilities, supporting ultra-long text understanding and powerful autonomous scheduling search engine functions.
- **[Moonshot](https://lobechat.com/discover/provider/moonshot)**: Moonshot is an open-source platform launched by Beijing Dark Side Technology Co., Ltd., providing various natural language processing models with a wide range of applications, including but not limited to content creation, academic research, intelligent recommendations, and medical diagnosis, supporting long text processing and complex generation tasks.
- **[Baichuan](https://lobechat.com/discover/provider/baichuan)**: Baichuan Intelligence is a company focused on the research and development of large AI models, with its models excelling in domestic knowledge encyclopedias, long text processing, and generative creation tasks in Chinese, surpassing mainstream foreign models. Baichuan Intelligence also possesses industry-leading multimodal capabilities, performing excellently in multiple authoritative evaluations. Its models include Baichuan 4, Baichuan 3 Turbo, and Baichuan 3 Turbo 128k, each optimized for different application scenarios, providing cost-effective solutions.
- **[Minimax](https://lobechat.com/discover/provider/minimax)**: MiniMax is a general artificial intelligence technology company established in 2021, dedicated to co-creating intelligence with users. MiniMax has independently developed general large models of different modalities, including trillion-parameter MoE text models, voice models, and image models, and has launched applications such as Conch AI.
- **[360 AI](https://lobechat.com/discover/provider/ai360)**: 360 AI is an AI model and service platform launched by 360 Company, offering various advanced natural language processing models, including 360GPT2 Pro, 360GPT Pro, 360GPT Turbo, and 360GPT Turbo Responsibility 8K. These models combine large-scale parameters and multimodal capabilities, widely applied in text generation, semantic understanding, dialogue systems, and code generation. With flexible pricing strategies, 360 AI meets diverse user needs, supports developer integration, and promotes the innovation and development of intelligent applications.
- **[Taichu](https://lobechat.com/discover/provider/taichu)**: The Institute of Automation, Chinese Academy of Sciences, and Wuhan Artificial Intelligence Research Institute have launched a new generation of multimodal large models, supporting comprehensive question-answering tasks such as multi-turn Q\&A, text creation, image generation, 3D understanding, and signal analysis, with stronger cognitive, understanding, and creative abilities, providing a new interactive experience.
- **[InternLM](https://lobechat.com/discover/provider/internlm)**: An open-source organization dedicated to the research and development of large model toolchains. It provides an efficient and user-friendly open-source platform for all AI developers, making cutting-edge large models and algorithm technologies easily accessible.
- **[SiliconCloud](https://lobechat.com/discover/provider/siliconcloud)**: SiliconFlow is dedicated to accelerating AGI for the benefit of humanity, enhancing large-scale AI efficiency through an easy-to-use and cost-effective GenAI stack.
- **[Higress](https://lobechat.com/discover/provider/higress)**: Higress is a cloud-native API gateway that was developed internally at Alibaba to address the issues of Tengine reload affecting long-lived connections and the insufficient load balancing capabilities for gRPC/Dubbo.
- **[Gitee AI](https://lobechat.com/discover/provider/giteeai)**: Gitee AI's Serverless API provides AI developers with an out of the box large model inference API service.
- **[Taichu](https://lobechat.com/discover/provider/taichu)**: The Institute of Automation, Chinese Academy of Sciences, and Wuhan Artificial Intelligence Research Institute have launched a new generation of multimodal large models, supporting comprehensive question-answering tasks such as multi-turn Q\&A, text creation, image generation, 3D understanding, and signal analysis, with stronger cognitive, understanding, and creative abilities, providing a new interactive experience.
- **[360 AI](https://lobechat.com/discover/provider/ai360)**: 360 AI is an AI model and service platform launched by 360 Company, offering various advanced natural language processing models, including 360GPT2 Pro, 360GPT Pro, 360GPT Turbo, and 360GPT Turbo Responsibility 8K. These models combine large-scale parameters and multimodal capabilities, widely applied in text generation, semantic understanding, dialogue systems, and code generation. With flexible pricing strategies, 360 AI meets diverse user needs, supports developer integration, and promotes the innovation and development of intelligent applications.
</details>
> 📊 Total providers: [<kbd>**36**</kbd>](https://lobechat.com/discover/providers)
> 📊 Total providers: [<kbd>**37**</kbd>](https://lobechat.com/discover/providers)
<!-- PROVIDER LIST -->
@@ -199,7 +242,7 @@ At the same time, we are also planning to support more model service providers.
[![][image-feat-local]][docs-feat-local]
### `3` [Local Large Language Model (LLM) Support][docs-feat-local]
### `6` [Local Large Language Model (LLM) Support][docs-feat-local]
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.
@@ -215,7 +258,7 @@ To meet the specific needs of users, LobeChat also supports the use of local mod
LobeChat supports Text-to-Speech (TTS) and Speech-to-Text (STT) technologies, enabling our application to convert text messages into clear voice outputs,
allowing users to interact with our conversational agent as if they were talking to a real person. Users can choose from a variety of voices to pair with the agent.
@@ -250,7 +293,7 @@ Users can choose the voice that suits their personal preferences or specific sce
[![][image-feat-t2i]][docs-feat-t2i]
### `6` [Text to Image Generation][docs-feat-t2i]
### `9` [Text to Image Generation][docs-feat-t2i]
With support for the latest text-to-image generation technology, LobeChat now allows users to invoke image creation tools directly within conversations with the agent. By leveraging the capabilities of AI tools such as [`DALL-E 3`](https://openai.com/dall-e-3), [`MidJourney`](https://www.midjourney.com/), and [`Pollinations`](https://pollinations.ai/), the agents are now equipped to transform your ideas into images.
@@ -264,7 +307,7 @@ This enables a more private and immersive creative process, allowing for the sea
[![][image-feat-plugin]][docs-feat-plugin]
### `7` [Plugin System (Function Calling)][docs-feat-plugin]
### `10` [Plugin System (Function Calling)][docs-feat-plugin]
The plugin ecosystem of LobeChat is an important extension of its core functionality, greatly enhancing the practicality and flexibility of the LobeChat assistant.
@@ -280,14 +323,14 @@ In addition, these plugins are not limited to news aggregation, but can also ext
| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)<br/><sup>By **portfoliometa** on **2024-12-22**</sup> | Analyze stocks and get comprehensive real-time investment data and analytics.<br/>`stock` |
| [Google CSE](https://lobechat.com/discover/plugin/google-cse)<br/><sup>By **vsnthdev** on **2024-12-02**</sup> | Searches Google through their official CSE API.<br/>`web``search` |
| [Speak](https://lobechat.com/discover/plugin/speak)<br/><sup>By **speak** on **2024-12-02**</sup> | Learn how to say anything in another language with Speak, your AI-powered language tutor.<br/>`education``language` |
| [Tongyi wanxiang Image Generator](https://lobechat.com/discover/plugin/alps-tongyi-image)<br/><sup>By **YoungTx** on **2024-08-09**</sup> | This plugin uses Alibaba's Tongyi Wanxiang model to generate images based on text prompts.<br/>`image``tongyi``wanxiang` |
| [Web](https://lobechat.com/discover/plugin/web)<br/><sup>By **Proghit** on **2025-01-24**</sup> | Smart web search that reads and analyzes pages to deliver comprehensive answers from Google results.<br/>`web``search` |
| [MintbaseSearch](https://lobechat.com/discover/plugin/mintbasesearch)<br/><sup>By **mintbase** on **2024-12-31**</sup> | Find any NFT data on the NEAR Protocol.<br/>`crypto``nft` |
| [Bing_websearch](https://lobechat.com/discover/plugin/Bingsearch-identifier)<br/><sup>By **FineHow** on **2024-12-22**</sup> | Search for information from the internet base BingApi<br/>`bingsearch` |
| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)<br/><sup>By **portfoliometa** on **2024-12-22**</sup> | Analyze stocks and get comprehensive real-time investment data and analytics.<br/>`stock` |
> 📊 Total plugins: [<kbd>**48**</kbd>](https://lobechat.com/discover/plugins)
> 📊 Total plugins: [<kbd>**47**</kbd>](https://lobechat.com/discover/plugins)
<!-- PLUGIN LIST -->
@@ -299,7 +342,7 @@ In addition, these plugins are not limited to news aggregation, but can also ext
[![][image-feat-agent]][docs-feat-agent]
### `8` [Agent Market (GPTs)][docs-feat-agent]
### `11` [Agent Market (GPTs)][docs-feat-agent]
In LobeChat Agent Marketplace, creators can discover a vibrant and innovative community that brings together a multitude of well-designed agents,
which not only play an important role in work scenarios but also offer great convenience in learning processes.
@@ -319,14 +362,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
| [System Instruction Expert](https://lobechat.com/discover/assistant/instructer)<br/><sup>By **[yuyun2000](https://github.com/yuyun2000)** on **2024-12-04**</sup> | Skilled in refining and generating efficient system instructions<br/>`system-instructions``writing``detail-optimization``user-needs` |
| [Japanese Memory Helper](https://lobechat.com/discover/assistant/japan-language-helper)<br/><sup>By **[sharkbear212](https://github.com/sharkbear212)** on **2024-12-04**</sup> | Specializes in Japanese Hiragana, Katakana, vocabulary, and memory techniques for explanations and phrases<br/>`explanation``memory-techniques``japanese-teaching` |
| [Poetry Card Designer](https://lobechat.com/discover/assistant/poetry-card-designer)<br/><sup>By **[lianxin255](https://github.com/lianxin255)** on **2024-12-03**</sup> | Skilled in designing poetry cards to enhance artistic sense and appeal<br/>`poetry-card-design``card``creativity``artistic-expression` |
| [Daily Doctor](https://lobechat.com/discover/assistant/yunchat-docter)<br/><sup>By **[yuyun2000](https://github.com/yuyun2000)** on **2024-11-30**</sup> | Specializes in surgical diagnosis and personalized health management<br/>`general-medicine``surgery``health-consultation``personalized-treatment``medical-education` |
| [Xiao Zhi French Translation Assistant](https://lobechat.com/discover/assistant/xiao-zhi-french-translation-asst-v-1)<br/><sup>By **[WeR-Best](https://github.com/WeR-Best)** on **2025-02-10**</sup> | A friendly, professional, and empathetic AI assistant for French translation<br/>`ai-assistant``french-translation``cross-cultural-communication``creativity` |
| [Language Charm Learning Mentor](https://lobechat.com/discover/assistant/bad-language-helper)<br/><sup>By **[Guducat](https://github.com/Guducat)** on **2025-02-06**</sup> | Specializes in teaching the charm of language and witty responses<br/>`language-learning``dialogue-examples` |
| [Astrology Researcher](https://lobechat.com/discover/assistant/fate-researcher)<br/><sup>By **[Jack980506](https://github.com/Jack980506)** on **2025-02-06**</sup> | Expert in BaZi astrology<br/>`astrology``ba-zi``traditional-culture` |
> 📊 Total agents: [<kbd>**453**</kbd> ](https://lobechat.com/discover/assistants)
> 📊 Total agents: [<kbd>**487**</kbd> ](https://lobechat.com/discover/assistants)
<!-- AGENT LIST -->
@@ -338,7 +381,7 @@ Our marketplace is not just a showcase platform but also a collaborative space.
[![][image-feat-database]][docs-feat-database]
### `9` [Support Local / Remote Database][docs-feat-database]
### `12` [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:
@@ -355,7 +398,7 @@ Regardless of which database you choose, LobeChat can provide you with an excell
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.
@@ -412,7 +455,7 @@ We have carried out a series of optimization designs for mobile devices to enhan
[![][image-feat-theme]][docs-feat-theme]
### `13` [Custom Themes][docs-feat-theme]
### `16` [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.
@@ -518,25 +561,22 @@ If you have deployed your own project following the one-click deployment steps i
We provide a Docker image for deploying the LobeChat service on your own private device. Use the following command to start the LobeChat service:
1. create a folder to for storage files
```fish
$ docker run -d-p3210:3210\
-eOPENAI_API_KEY=sk-xxxx \
-eACCESS_CODE=lobe66 \
--name lobe-chat \
lobehub/lobe-chat
$ mkdir lobe-chat-db &&cd lobe-chat-db
```
> \[!TIP]
>
> If you need to use the OpenAI service through a proxy, you can configure the proxy address using the `OPENAI_PROXY_URL` environment variable:
2. init the LobeChat infrastructure
```fish
$ docker run -d-p3210:3210\
-eOPENAI_API_KEY=sk-xxxx \
-eOPENAI_PROXY_URL=https://api-proxy.com/v1 \
-eACCESS_CODE=lobe66 \
--name lobe-chat \
lobehub/lobe-chat
bash<(curl-fsSL https://lobe.li/setup.sh)
```
3. Start the LobeChat service
```fish
docker compose up -d
```
> \[!NOTE]
@@ -629,7 +669,7 @@ If you would like to learn more details, please feel free to look at our [📘 D
## 🤝 Contributing
Contributions of all types are more than welcome; if you are interested in contributing code, feel free to check out our GitHub [Issues][github-issues-link] and [Projects][github-project-link] to get stuck in to show us what you’re made of.
Contributions of all types are more than welcome; if you are interested in contributing code, feel free to check out our GitHub [Issues][github-issues-link] and [Projects][github-project-link] to get stuck in to show us what you're made of.
> \[!TIP]
>
@@ -745,24 +785,27 @@ This project is [Apache 2.0](./LICENSE) licensed.
- **[Anthropic](https://lobechat.com/discover/provider/anthropic)**: Anthropic 是一家专注于人工智能研究和开发的公司,提供了一系列先进的语言模型,如 Claude 3.5 Sonnet、Claude 3 Sonnet、Claude 3 Opus 和 Claude 3 Haiku。这些模型在智能、速度和成本之间取得了理想的平衡,适用于从企业级工作负载到快速响应的各种应用场景。Claude 3.5 Sonnet 作为其最新模型,在多项评估中表现优异,同时保持了较高的性价比。
- **[Bedrock](https://lobechat.com/discover/provider/bedrock)**: Bedrock 是亚马逊 AWS 提供的一项服务,专注于为企业提供先进的 AI 语言模型和视觉模型。其模型家族包括 Anthropic 的 Claude 系列、Meta 的 Llama 3.1 系列等,涵盖从轻量级到高性能的多种选择,支持文本生成、对话、图像处理等多种任务,适用于不同规模和需求的企业应用。
- **[Google](https://lobechat.com/discover/provider/google)**: Google 的 Gemini 系列是其最先进、通用的 AI 模型,由 Google DeepMind 打造,专为多模态设计,支持文本、代码、图像、音频和视频的无缝理解与处理。适用于从数据中心到移动设备的多种环境,极大提升了 AI 模型的效率与应用广泛性。
- **[HuggingFace](https://lobechat.com/discover/provider/huggingface)**: HuggingFace Inference API 提供了一种快速且免费的方式,让您可以探索成千上万种模型,适用于各种任务。无论您是在为新应用程序进行原型设计,还是在尝试机器学习的功能,这个 API 都能让您即时访问多个领域的高性能模型。
- **[OpenRouter](https://lobechat.com/discover/provider/openrouter)**: OpenRouter 是一个提供多种前沿大模型接口的服务平台,支持 OpenAI、Anthropic、LLaMA 及更多,适合多样化的开发和应用需求。用户可根据自身需求灵活选择最优的模型和价格,助力 AI 体验的提升。
- **[GitHub](https://lobechat.com/discover/provider/github)**: 通过 GitHub 模型,开发人员可以成为 AI 工程师,并使用行业领先的 AI 模型进行构建。
<details><summary><kbd>See more providers (+26)</kbd></summary>
<details><summary><kbd>See more providers (+27)</kbd></summary>
- **[Novita](https://lobechat.com/discover/provider/novita)**: Novita AI 是一个提供多种大语言模型与 AI 图像生成的 API 服务的平台,灵活、可靠且具有成本效益。它支持 Llama3、Mistral 等最新的开源模型,并为生成式 AI 应用开发提供了全面、用户友好且自动扩展的 API 解决方案,适合 AI 初创公司的快速发展。
- **[PPIO](https://lobechat.com/discover/provider/ppio)**: PPIO 派欧云提供稳定、高性价比的开源模型 API 服务,支持 DeepSeek 全系列、Llama、Qwen 等行业领先大模型。
- **[Together AI](https://lobechat.com/discover/provider/togetherai)**: Together AI 致力于通过创新的 AI 模型实现领先的性能,提供广泛的自定义能力,包括快速扩展支持和直观的部署流程,满足企业的各种需求。
| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)<br/><sup>By **portfoliometa** on **2024-12-22**</sup> | 分析股票并获取全面的实时投资数据和分析。<br/>`股票` |
| [谷歌自定义搜索引擎](https://lobechat.com/discover/plugin/google-cse)<br/><sup>By **vsnthdev** on **2024-12-02**</sup> | 通过他们的官方自定义搜索引擎 API 搜索谷歌。<br/>`网络``搜索` |
| [Speak](https://lobechat.com/discover/plugin/speak)<br/><sup>By **speak** on **2024-12-02**</sup> | 使用 Speak,您的 AI 语言导师,学习如何用另一种语言说任何事情。<br/>`教育``语言` |
| [通义万象图像生成器](https://lobechat.com/discover/plugin/alps-tongyi-image)<br/><sup>By **YoungTx** on **2024-08-09**</sup> | 此插件使用阿里巴巴的通义万象模型根据文本提示生成图像。<br/>`图像``通义``万象` |
| [Cron 表达式助手](https://lobechat.com/discover/assistant/crontab-generate)<br/><sup>By **[edgesider](https://github.com/edgesider)** on **2025-02-17**</sup> | Crontab 表达式生成<br/>`crontab``时间表达``触发时间``生成器``技术辅助` |
| [小智法语翻译助手](https://lobechat.com/discover/assistant/xiao-zhi-french-translation-asst-v-1)<br/><sup>By **[WeR-Best](https://github.com/WeR-Best)** on **2025-02-10**</sup> | 友好、专业、富有同理心的法语翻译 AI 助手<br/>`ai助手``法语翻译``跨文化交流``创造力` |
| [语言魅力学习导师](https://lobechat.com/discover/assistant/bad-language-helper)<br/><sup>By **[Guducat](https://github.com/Guducat)** on **2025-02-06**</sup> | 擅长教学语言的魅力与花样回复<br/>`语言学习``对话示例` |
| [命理研究员](https://lobechat.com/discover/assistant/fate-researcher)<br/><sup>By **[Jack980506](https://github.com/Jack980506)** on **2025-02-06**</sup> | 精通八字命<br/>`命理学``八字``传统文化` |
> 📊 Total agents: [<kbd>**453**</kbd> ](https://lobechat.com/discover/assistants)
> 📊 Total agents: [<kbd>**487**</kbd> ](https://lobechat.com/discover/assistants)
# If the language is not supported, default to English
# Function to show messages
show_message(){
localkey="$1"
case$key in
choose_language)
echo"Please choose a language / 请选择语言:"
echo"(0) English"
echo"(1) 简体中文"
;;
downloading)
case$LANGUAGE in
zh_CN)
echo"正在下载文件..."
;;
*)
echo"Downloading files..."
;;
esac
;;
extracted_success)
case$LANGUAGE in
zh_CN)
echo" 解压成功到目录:"
;;
*)
echo" extracted successfully to directory: "
;;
esac
;;
extracted_failed)
case$LANGUAGE in
zh_CN)
echo" 解压失败。"
;;
*)
echo" extraction failed."
;;
esac
;;
file_not_exists)
case$LANGUAGE in
zh_CN)
echo" 不存在。"
;;
*)
echo" does not exist."
;;
esac
;;
security_secrect_regenerate)
case$LANGUAGE in
zh_CN)
echo"重新生成安全密钥..."
;;
*)
echo"Regenerate security secrets..."
;;
esac
;;
security_secrect_regenerate_failed)
case$LANGUAGE in
zh_CN)
echo"无法重新生成安全密钥:"
;;
*)
echo"Failed to regenerate security secrets: "
;;
esac
;;
host_regenerate)
case$LANGUAGE in
zh_CN)
echo"✔️ 已更新部署模式配置"
;;
*)
echo"✔️ Updated deployment mode configuration"
;;
esac
;;
host_regenerate_failed)
case$LANGUAGE in
zh_CN)
echo"无法重新生成服务器域名:"
;;
*)
echo"Failed to regenerate server host: "
;;
esac
;;
security_secrect_regenerate_report)
case$LANGUAGE in
zh_CN)
echo"安全密钥生成结果如下:"
;;
*)
echo"Security secret generation results are as follows:"
;;
esac
;;
tips_download_failed)
case$LANGUAGE in
zh_CN)
echo"$2 下载失败,请检查网络连接。"
;;
*)
echo"$2 Download failed, please check the network connection."
;;
esac
;;
tips_already_installed)
case$LANGUAGE in
zh_CN)
echo"检测到您已经运行过 LobeChat Database,本安装程序只能完成初始化配置,并不能重复安装。如果你需要重新安装,请删除 data 和 s3_data 文件夹。"
;;
*)
echo"It is detected that you have run LobeChat Database. This installation program can only complete the initialization configuration and cannot be reinstalled. If you need to reinstall, please delete the data and s3_data folders."
;;
esac
;;
tips_run_command)
case$LANGUAGE in
zh_CN)
echo"您已经完成了所有配置。请运行以下命令启动LobeChat:"
;;
*)
echo"You have completed all configurations. Please run this command to start LobeChat:"
;;
esac
;;
tips_show_documentation)
case$LANGUAGE in
zh_CN)
echo"完整的环境变量在'.env'中可以在文档中找到:"
;;
*)
echo"Full environment variables in the '.env' can be found at the documentation on "
echo"Failed to initialize the database. To avoid your data being initialized repeatedly, run the following command to unmount the initial configuration file of Casdoor when you first start successfully:"
echo"(0) Domain mode (no need to specify the port when accessing), you need to use the reverse proxy service LobeChat, MinIO, Casdoor, and assign a domain name respectively;"
echo"(1) Port mode (need to specify the port when accessing, such as using IP access, or domain name + port access), you need to open the specified port;"
echo"(2) Local mode (for local testing only)"
echo"If you are confused about these contents, you can choose to deploy in local mode first, and then modify according to the document guide later."
title: LobeChat Supports User Data Statistics and Activity Sharing
description: >-
LobeChat now supports multi-dimensional user data statistics and activity
sharing
tags:
- LobeChat
- User Statistics
- Activity Sharing
- AI Data
---
# User Data Statistics and Activity Sharing 💯
Want to know about your activity performance on LobeChat?
Now, you can comprehensively understand your AI data through the statistics feature, and even generate personal activity sharing images to share your LobeChat activity with friends.
## 📊 Data Statistics
- **Statistics**: Number of Assistants / Topics / Messages / Total Word Count
- **Rankings**:
- Model Usage Rate `Top 10`
- Assistant Usage Rate `Top 10`
- Topic Content Volume `Top 10`
- **Heat Map**: Activity distribution over the past year
- **User Activity Sharing**: Generate personal activity sharing images
## 👉 How to Use
1. Requires `PgLite` or `Database` mode
2. Click on your profile picture to enter "Account" - "Data Statistics" page
title: LobeChat Launches New AI Provider Management System
description: >-
LobeChat has revamped its AI Provider Management System, now supporting custom
AI providers and models.
tags:
- LobeChat
- AI Provider
- Provider Management
- Multimodal
---
# New AI Provider Management System 🎉
We are excited to announce that LobeChat has launched a brand new AI Provider Management System, now available in both the open-source version and the Cloud version ([lobechat.com](https://lobechat.com)):
## 🚀 Key Updates
- 🔮 **Custom AI Providers**: You can now add, remove, or edit AI providers as needed.
- ⚡️ **Custom Model and Capability Configuration**: Easily add your own models to meet personalized requirements.
- 🌈 **Multimodal Support**: The new AI Provider Management System fully supports various modalities, including language, images, voice, and more. Stay tuned for video and music generation features!
## 📢 Feedback and Support
If you have any suggestions or thoughts about the new AI Provider Management System, feel free to engage with us in GitHub Discussions.
LobeChat Integrates DeepSeek R1, Bringing a Revolutionary Chain of Thought
Experience
description: >-
LobeChat v1.49.12 fully supports the DeepSeek R1 model, providing users with
an unprecedented interactive experience in the chain of thought.
tags:
- LobeChat
- DeepSeek
- Chain of Thought
---
# Perfect Integration of DeepSeek R1 and it's Deep Thinking Experience 🎉
After nearly 10 days of meticulous refinement, LobeChat has fully integrated the DeepSeek R1 model in version v1.49.12, offering users a revolutionary interactive experience in the chain of thought!
## 🚀 Major Updates
- 🤯 **Comprehensive Support for DeepSeek R1**: Now fully integrated in both the Community and Cloud versions ([lobechat.com](https://lobechat.com)).
- 🧠 **Real-Time Chain of Thought Display**: Transparently presents the AI's reasoning process, making the resolution of complex issues clear and visible.
- ⚡️ **Deep Thinking Experience**: Utilizing Chain of Thought technology, it provides more insightful AI conversations.
- 💫 **Intuitive Problem Analysis**: Makes the analysis of complex issues clear and easy to understand.
## 🌟 How to Use
1. Upgrade to LobeChat v1.49.12 or visit [lobechat.com](https://lobechat.com).
2. Select the DeepSeek R1 model in the settings.
3. Experience a whole new level of intelligent conversation!
## 📢 Feedback and Support
If you encounter any issues while using the application or have suggestions for new features, feel free to engage with us through GitHub Discussions. Let's work together to create a better LobeChat!
@@ -27,28 +27,30 @@ By setting the environment variables `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CL
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. |
| `NEXTAUTH_URL` | Required | 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,microsoft-entra-id,authentik`. |
| `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | Required | This is used to enable the NextAuth service. Set it to `1` toenable it; changing this setting requires recompiling the application. Users deploying with the `lobehub/lobe-chat-database` image have this configuration added by default. |
| `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. |
| `NEXTAUTH_URL` | Required | 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,microsoft-entra-id,authentik`. |
Currently supported identity verification services include:
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.
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.
## Get Environment Variables
<Steps>
### Add Public and Private Key Environment Variables
### Add Public and Private Key Environment Variables
Add `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variables. You can click on the "API Keys" in the menu and copy the corresponding values to get these environment variables.
Add `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variables. You can click on the "API Keys" in the menu and copy the corresponding values to get these 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
alt={'Find the corresponding public and private key environment variables in Clerk'}
Since we let Clerk fully handle user authentication and management, we need Clerk to notify our application and store the changes in the user lifecycle (create, update, delete). We achieve this by using the Webhook provided by Clerk.
Since we let Clerk fully handle user authentication and management, we need Clerk to notify our application and store the changes in the user lifecycle (create, update, delete). We achieve this by 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 information changes.
We need to add an endpoint in Clerk's Webhooks to inform Clerk to send notifications to this endpoint when a user's information changes.
<Image alt={'Add Webhooks endpoint in Clerk'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/f50f47fb-5e8e-4930-bf4e-8cf6f5b8afb9'} />
Fill in your project URL in the endpoint, such as `https://your-project.com/api/webhooks/clerk`. Then, subscribe to events by checking the three user events (`user.created`, `user.deleted`, `user.updated`), and click create.
Fill in your project URL in the endpoint, such as `https://your-project.com/api/webhooks/clerk`. Then, subscribe to events by checking the three user events (`user.created`, `user.deleted`, `user.updated`), and click create.
<Callout type={'warning'}>
The `https://` in the URL is essential to maintain the integrity of the URL.
</Callout>
<Callout type={'warning'}>
<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'} />
The `https://` in the URL is essential to maintain the integrity of the URL.
### Add Webhook Secret to Environment Variables
</Callout>
After creating, you can find the secret of this Webhook in the bottom right corner:
<Image
alt={'Configure URL and user events when adding Clerk Webhooks'}
在 endppint 中填写你的项目 URL,如 `https://your-project.com/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。
在 endppint 中填写你的项目 URL,如 `https://your-project.com/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。
Register and log in to [Auth0][auth0-client-page], click on the "Applications" in the left navigation bar to switch to the application management interface, and click "Create Application" in the upper right corner to create an application.
Register and log in to [Auth0][auth0-client-page], click on the "Applications" in the left navigation bar to switch to the application management interface, and click "Create Application" in the upper right corner to create an application.
After successful creation, click on the corresponding application to enter the application details page, switch to the "Settings" tab, and you can see the corresponding configuration information.
After successful creation, click on the corresponding application to enter the application details page, switch to the "Settings" tab, and you can see the corresponding configuration information.
You can fill in or modify Allowed Callback URLs after deployment, but make sure the filled URL is
consistent with the deployed URL.
</Callout>
<Callout type={'important'}>
You can fill in or modify Allowed Callback URLs after deployment, but make sure the filled URL is
consistent with the deployed URL.
</Callout>
### Add Users
### Add Users
Click on the "Users Management" in the left navigation bar to enter the user management interface, where you can create users for your organization to log in to LobeChat.
Click on the "Users Management" in the left navigation bar to enter the user management interface, where you can create users for your organization to log in to LobeChat.
When deploying LobeChat, you need to configure the following environment variables:
When deploying LobeChat, you need to configure the following environment variables:
| Environment Variable | Type | Description |
| --- | --- | --- |
| `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` | Required | Select the single sign-on provider for LoboChat. Use `auth0` for Auth0. |
| `AUTH_AUTH0_ID` | Required | Client ID of the Auth0 application |
| `AUTH_AUTH0_SECRET` | Required | Client Secret of the Auth0 application |
| `AUTH_AUTH0_ISSUER` | Required | Domain of the Auth0 application, `https://example.auth0.com` |
| `NEXTAUTH_URL` | Required | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` |
| `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` | Required | Select the single sign-on provider for LoboChat. Use `auth0` for Auth0. |
| `AUTH_AUTH0_ID` | Required | Client ID of the Auth0 application |
| `AUTH_AUTH0_SECRET` | Required | Client Secret of the Auth0 application |
| `AUTH_AUTH0_ISSUER` | Required | Domain of the Auth0 application, `https://example.auth0.com` |
| `NEXTAUTH_URL` | Required | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` |
<Callout type={'tip'}>
You can refer to the related variable details at [📘Environment Variables](/docs/self-hosting/environment-variable#auth0).
</Callout>
</Callout>
</Steps>
<Callout>
@@ -102,19 +81,13 @@ If your enterprise or organization already has a unified identity authentication
Auth0 supports single sign-on services such as Azure Active Directory, Slack, Google Workspace, Office 365, Zoom, and more. For a detailed list of supported services, please refer to [this link][auth0-sso-integrations].
<Image
alt="Connecting to an Existing Single Sign-On Service"
<Image alt="Connecting to an Existing Single Sign-On Service" src="https://github.com/lobehub/lobe-chat/assets/30863298/9891347e-a338-4aa9-8714-f16c8dbcfcec" />
### Configuring Social Login
If your enterprise or organization needs to support external user logins, you can configure social login services in Authentication -> Social.
<Image alt="Connecting to an Existing Single Sign-On Service" src="https://github.com/lobehub/lobe-chat/assets/30863298/9891347e-a338-4aa9-8714-f16c8dbcfcec" />
### 配置社交登录
如果你的企业或组织需要支持外部人员登录,可以在 Authentication -> Social 中,配置社交登录服务。
We assume you are already familiar with using Authelia. Let's say your LobeChat instance is deployed at https://lobe.example.com/. Note that currently only localhost supports HTTP access; other domains need to enable TLS, otherwise Authelia will actively interrupt authentication by default.
We assume you are already familiar with using Authelia. Let's say your LobeChat instance is deployed at [https://lobe.example.com/](https://lobe.example.com/). Note that currently only localhost supports HTTP access; other domains need to enable TLS, otherwise Authelia will actively interrupt authentication by default.
Now, let's open and edit the configuration file of your Authelia instance:
Now, let's open and edit the configuration file of your Authelia instance:
Add a new lobe-chat item under identity_providers -> oidc:
Add a new lobe-chat item under `identity_providers` -> `oidc`:
```yaml
identity_providers:
oidc:
...
## The other portions of the mandatory OpenID Connect 1.0 configuration go here.
## See: https://www.authelia.com/c/oidc
- id: lobe-chat
description: LobeChat
secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng' # The digest of 'insecure_secret'.
## The other portions of the mandatory OpenID Connect 1.0 configuration go here.
## See: https://www.authelia.com/c/oidc
- id: lobe-chat
description: LobeChat
secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng' # The digest of 'insecure_secret'.
Make sure to replace secret and redirect_urls with your own values. Note! The secret configured in Authelia is ciphertext, i.e., a salted hash value. Its corresponding plaintext needs to be filled in LobeChat later.
Make sure to replace secret and `redirect_urls` with your own values. Note! The secret configured in Authelia is ciphertext, i.e., a salted hash value. Its corresponding plaintext needs to be filled in LobeChat later.
Save the configuration file and restart the Authelia service. Now we have completed the Authelia configuration.
Save the configuration file and restart the Authelia service. Now we have completed the Authelia configuration.
### Configure Environment Variables
### Configure Environment Variables
When deploying LobeChat, you need to configure the following environment variables:
When deploying LobeChat, you need to configure the following environment variables:
| Environment Variable | Type | Description |
| --- | --- | --- |
| `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. |
| `AUTH_AUTHELIA_ID` | Required | The id just configured in Authelia, example value is lobe-chat |
| `AUTH_AUTHELIA_SECRET` | Required | The plaintext corresponding to the secret just configured in Authelia, example value is insecure_secret |
| `AUTH_AUTHELIA_ISSUER` | Required | Your Authelia URL, for example https://sso.example.com |
| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth verification. It only needs to be set when the default generated redirect address is incorrect. https://chat.example.com/api/auth |
| `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. |
| `AUTH_AUTHELIA_ID` | Required | The id just configured in Authelia, example value is lobe-chat |
| `AUTH_AUTHELIA_SECRET` | Required | The plaintext corresponding to the secret just configured in Authelia, example value is `insecure_secret` |
| `AUTH_AUTHELIA_ISSUER` | Required | Your Authelia URL, for example [https://sso.example.com](https://sso.example.com) |
| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth verification. It only needs to be set when the default generated redirect address is incorrect. [https://chat.example.com/api/auth](https://chat.example.com/api/auth) |
<Callout type={'tip'}>
Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Authelia) for details about the variables.
</Callout>
<Callout type={'tip'}>
Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Authelia) for details about the variables.
## The other portions of the mandatory OpenID Connect 1.0 configuration go here.
## See: https://www.authelia.com/c/oidc
- id: lobe-chat
description: LobeChat
secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng' # The digest of 'insecure_secret'.
## The other portions of the mandatory OpenID Connect 1.0 configuration go here.
## See: https://www.authelia.com/c/oidc
- id: lobe-chat
description: LobeChat
secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng' # The digest of 'insecure_secret'.
After the creation is successful, click **Applications** on the left -> **Create**, fill in the name and Slug, select the provider created in the previous step, and click **Create**.
After the creation is successful, click **Applications** on the left -> **Create**, fill in the name and Slug, select the provider created in the previous step, and click **Create**.
After the application provider is created, click the corresponding provider to enter the details page, click **Edit**, and save the `Client ID` and `Client Secret`.
After the application provider is created, click the corresponding provider to enter the details page, click **Edit**, and save the `Client ID` and `Client Secret`.
Copy the URL of `OpenID Configuration Issuer` and save it.
Copy the URL of `OpenID Configuration Issuer` and save it.
### Configure Environment Variables
### Configure Environment Variables
When deploying LobeChat, you need to configure the following environment variables:
When deploying LobeChat, you need to configure the following environment variables:
| Environment Variable | Type | Description |
| --- | --- | --- |
| `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. |
| `AUTH_AUTHENTIK_ID` | Required | The Client ID from the Authentik application provider details page |
| `AUTH_AUTHENTIK_SECRET` | Required | The Client Secret from the Authentik application provider details page |
| `AUTH_AUTHENTIK_ISSUER` | Required | The OpenID Configuration Issuer from the Authentik application provider details page |
| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It only needs to be set when the default generated redirect address is incorrect. `https://example.com/api/auth` |
| `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. |
| `AUTH_AUTHENTIK_ID` | Required | The Client ID from the Authentik application provider details page |
| `AUTH_AUTHENTIK_SECRET` | Required | The Client Secret from the Authentik application provider details page |
| `AUTH_AUTHENTIK_ISSUER` | Required | The OpenID Configuration Issuer from the Authentik application provider details page |
| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It only needs to be set when the default generated redirect address is incorrect. `https://example.com/api/auth` |
<Callout type={'tip'}>
Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Authentik) for details about the variables.
@@ -33,93 +33,122 @@ If you are deploying using a public network, the following assumptions apply:
- You privately deploy Casdoor, and its domain is `https://lobe-auth-api.example.com`.
<Steps>
### Create a Casdoor Application
### Create a Casdoor Application
Access your privately deployed Casdoor WebUI (default is `http://localhost:8000/`) to enter the console. The default account is `admin`, and the password is `123`.
Access your privately deployed Casdoor WebUI (default is `http://localhost:8000/`) to enter the console. The default account is `admin`, and the password is `123`.
Go to `Authentication` -> `Applications`, create a `LobeChat` application or directly modify the built-in `built-in` application. You can explore other fields, but you must configure at least the following fields:
Go to `Authentication` -> `Applications`, create a `LobeChat` application or directly modify the built-in `built-in` application. You can explore other fields, but you must configure at least the following fields:
- Name, Display Name: `LobeChat`
- Redirect URLs:
- Local Development Environment: `http://localhost:3210/api/auth/callback/casdoor`
- Local Network IP Deployment: `http://LOBECHAT_IP:3210/api/auth/callback/casdoor`
- Public Network Environment: `https://lobe.example.com/api/auth/callback/casdoor`
- Name, Display Name: `LobeChat`
- Redirect URLs:
- Local Development Environment: `http://localhost:3210/api/auth/callback/casdoor`
- Local Network IP Deployment: `http://LOBECHAT_IP:3210/api/auth/callback/casdoor`
- Public Network Environment: `https://lobe.example.com/api/auth/callback/casdoor`
There are also some optional fields that can enhance user experience:
There are also some optional fields that can enhance user experience:
Set the obtained `Client ID` and `Client Secret` as `AUTH_CASDOOR_ID` and `AUTH_CASDOOR_SECRET` in the LobeChat environment variables.
Configure `AUTH_CASDOOR_ISSUER` in the LobeChat environment variables as follows:
- `http://localhost:8000/` if you are in a local development environment.
- `http://CASDOOR_IP:8000/` if you are privately deploying Casdoor in a local network.
- `https://lobe-auth-api.example.com/` if you are deploying Casdoor in a public network environment.
</style>
```
When deploying LobeChat, you need to configure the following environment variables:
Then, copy the `Client ID` and `Client Secret` and save them.
| Environment Variable | Type | Description |
| --- | --- | --- |
| `NEXT_AUTH_SECRET` | Required | A key for encrypting Auth.js session tokens. You can generate a key using the command: `openssl rand -base64 32`. |
| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LobeChat. Fill in `casdoor` for using Casdoor. |
| `AUTH_CASDOOR_ID` | Required | The client ID from the Casdoor application details page. |
| `AUTH_CASDOOR_SECRET` | Required | The client secret from the Casdoor application details page. |
| `AUTH_CASDOOR_ISSUER` | Required | The OpenID Connect issuer for the Casdoor provider. |
| `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js during OAuth verification and needs to be set only if the default generated redirect address is incorrect. `https://lobe.example.com/api/auth` |
### Disable User Registration
<Callout type={'tip'}>
Visit [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#casdoor) for
details on related variables.
</Callout>
Go to `Identity` -> `Applications`, select the `LobeChat` application, and set `Allow Register` to `false`.
<Callout type={'warning'}>
Disabling user registration is necessary to prevent users from registering through the Casdoor login page.
</Callout>
### Configure Webhook (Optional)
> Available on Casdoor `>=1.843.0`.
Configure the Casdoor webhook so that LobeChat can receive notifications when user information is updated.
Go to `Admin` -> `Webhooks`, add a webhook, and fill in the following fields:
> The secret is generated by yourself, you can visit [https://generate-secret.vercel.app/10](https://generate-secret.vercel.app/10) to generate a 10 bit secret.
- Event: `update-user`
Save and Exit, then copy the Webhook secret and fill it in the environment variable \`CASDOOR\_WEBHOOK\_SECRET.
### Configure Environment Variables
Set the obtained `Client ID` and `Client Secret` as `AUTH_CASDOOR_ID` and `AUTH_CASDOOR_SECRET` in the LobeChat environment variables.
Configure `AUTH_CASDOOR_ISSUER` in the LobeChat environment variables as follows:
- `http://localhost:8000/` if you are in a local development environment.
- `http://CASDOOR_IP:8000/` if you are privately deploying Casdoor in a local network.
- `https://lobe-auth-api.example.com/` if you are deploying Casdoor in a public network environment.
When deploying LobeChat, you need to configure the following environment variables:
| `NEXT_AUTH_SECRET` | Required | A key for encrypting Auth.js session tokens. You can generate a key using the command: `openssl rand -base64 32`. |
| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LobeChat. Fill in `casdoor` for using Casdoor. |
| `AUTH_CASDOOR_ID` | Required | The client ID from the Casdoor application details page. |
| `AUTH_CASDOOR_SECRET` | Required | The client secret from the Casdoor application details page. |
| `AUTH_CASDOOR_ISSUER` | Required | The OpenID Connect issuer for the Casdoor provider. |
| `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js during OAuth verification and needs to be set only if the default generated redirect address is incorrect. `https://lobe.example.com/api/auth` |
| `CASDOOR_WEBHOOK_SECRET` | Optional | A key used to verify whether the request sent by Casdoor is legal. |
<Callout type={'tip'}>
Visit [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#casdoor) for
### Creating an Application in Cloudflare Zero Trust
### Creating an Application in Cloudflare Zero Trust
We assume you are already familiar with using the Cloudflare Zero Trust platform and that your LobeChat instance is deployed at `https://chat.example.com`.
We assume you are already familiar with using the Cloudflare Zero Trust platform and that your LobeChat instance is deployed at `https://chat.example.com`.
First, we need to visit `https://one.dash.cloudflare.com/` and navigate to `Access - Applications`.
First, we need to visit `https://one.dash.cloudflare.com/` and navigate to `Access - Applications`.
At this point, you have successfully created a SaaS application named `LobeChat SSO` in Cloudflare Zero Trust.
At this point, you have successfully created a SaaS application named `LobeChat SSO` in Cloudflare Zero Trust.
Next, we need to enter `https://chat.example.com/api/auth/callback/cloudflare-zero-trust` in the `Redirect URLs` field (note that `chat.example.com` should be replaced with your instance's address).
Next, we need to enter `https://chat.example.com/api/auth/callback/cloudflare-zero-trust` in the `Redirect URLs` field (note that `chat.example.com` should be replaced with your instance's address).
Finally, scroll down the page and record the following three values: `Client secret`, `Client ID`, and `Issuer`. You will need these for setting the environment variables when deploying LobeChat.
Finally, scroll down the page and record the following three values: `Client secret`, `Client ID`, and `Issuer`. You will need these for setting the environment variables when deploying LobeChat.
When deploying LobeChat, you need to configure the following environment variables:
When deploying LobeChat, you need to configure the following environment variables:
| Environment Variable | Type | Description |
| --- | --- | --- |
| `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 `cloudflare-zero-trust` for Cloudflare Zero Trust. |
| `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | Required | The Client ID from the Cloudflare Zero Trust application provider details page |
| `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | Required | The Client Secret from the Cloudflare Zero Trust application provider details page |
| `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | Required | The OpenID Configuration Issuer from the Cloudflare Zero Trust application provider details page |
| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It only needs to be set when the default generated redirect address is incorrect. `https://example.com/api/auth` |
| `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 `cloudflare-zero-trust` for Cloudflare Zero Trust. |
| `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | Required | The Client ID from the Cloudflare Zero Trust application provider details page |
| `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | Required | The Client Secret from the Cloudflare Zero Trust application provider details page |
| `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | Required | The OpenID Configuration Issuer from the Cloudflare Zero Trust application provider details page |
| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It only needs to be set when the default generated redirect address is incorrect. `https://example.com/api/auth` |
<Callout type={'tip'}>
Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Cloudflare%20Zero%20Trust) for details about the variables.
Set whether it is accessible publicly or only accessible to yourself.
Click "Create Github App".
<Image alt="Set whether it is accessible publicly or only accessible to yourself" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/995780cb-9096-4a36-ab17-d422703ab970" />
After successful creation, click "Generate a new client secret" to create a client secret.
After successful creation, save the `Client ID` and `Client Secret`.
### Configure Environment Variables
<Image alt="Create a new client secret" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/c6108133-a918-48b0-ab1a-e3fa607572a4" />
When deploying LobeChat, you need to configure the following environment variables:
### Configure Environment Variables
| Environment Variable | Type | Description |
| --- | --- | --- |
| `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. |
| `AUTH_GITHUB_ID` | Required | Client ID in the Github App details page. |
| `AUTH_GITHUB_SECRET` | Required | Client Secret in the Github App details page. |
| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` |
When deploying LobeChat, you need to configure the following environment variables:
<Callout type={'tip'}>
Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#github) for detailed
| `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. |
| `AUTH_GITHUB_ID` | Required | Client ID in the Github App details page. |
| `AUTH_GITHUB_SECRET` | Required | Client Secret in the Github App details page. |
| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` |
<Callout type={'tip'}>
Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#github) for detailed
@@ -31,52 +31,55 @@ If you are using Logto Cloud, assume its endpoint domain is `https://example.log
<Steps>
### Create Logto Application
Access your privately deployed Logto WebUI or [Logto Cloud](http://cloud.logto.io/) to enter the console, and create a `Next.js (App Router)` application under `Applications` with any name.
Access your privately deployed Logto WebUI or [Logto Cloud](http://cloud.logto.io/) to enter the console, and create a `Next.js (App Router)` application under `Applications` with any name.
### Configure Logto
### Configure Logto
Set the `Redirect URI` to `https://lobe.example.com/api/auth/callback/logto` and the `Post sign-out redirect URI` to `https://lobe.example.com/`.
Set the `Redirect URI` to `https://lobe.example.com/api/auth/callback/logto` and the `Post sign-out redirect URI` to `https://lobe.example.com/`.
Set `CORS allowed origins` to `https://lobe.example.com`.
Set `CORS allowed origins` to `https://lobe.example.com`.
- `https://lobe-auth-api.example.com/oidc` if you are using a privately deployed Logto
- `https://example.logto.app/oidc` if you are using Logto Cloud
After successful creation, copy the Webhook's `Signing Key` and fill it in the `LOGTO_WEBHOOK_SIGNING_KEY` environment variable.
When deploying LobeChat, you need to configure the following environment variables:
### Configure Environment Variables
| Environment Variable | Type | Description |
| --- | --- | --- |
| `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can generate a key using the command: `openssl rand -base64 32` |
| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LobeChat. For Logto, enter `logto`. |
| `AUTH_LOGTO_ID` | Required | The Client ID from the Logto App details page |
| `AUTH_LOGTO_SECRET` | Required | The Client Secret from the Logto App details page |
| `AUTH_LOGTO_ISSUER` | Required | OpenID Connect issuer of the Logto provider |
| `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js during OAuth verification, needed only if the default generated redirect address is incorrect. `https://lobe.example.com/api/auth` |
| `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can generate a key using the command: `openssl rand -base64 32` |
| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LobeChat. For Logto, enter `logto`. |
| `AUTH_LOGTO_ID` | Required | The Client ID from the Logto App details page |
| `AUTH_LOGTO_SECRET` | Required | The Client Secret from the Logto App details page |
| `AUTH_LOGTO_ISSUER` | Required | OpenID Connect issuer of the Logto provider |
| `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js during OAuth verification, needed only if the default generated redirect address is incorrect. `https://lobe.example.com/api/auth` |
| `LOGTO_WEBHOOK_SIGNING_KEY` | Optional | The key used to verify the legality of Webhook requests sent by Logto. |
<Callout type={'tip'}>
Visit [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#logto) for details on related variables.
</Callout>
</Callout>
</Steps>
### Troubleshooting
@@ -84,22 +87,22 @@ When deploying LobeChat, you need to configure the following environment variabl
If you encounter issues during the Logto deployment process, refer to the following common problems:
- `Only roles with the xxx attribute may create roles`:
Check your database user's permissions and ensure that the user in your Logto database has the `admin` role to create roles.
Check your database user's permissions and ensure that the user in your Logto database has the `admin` role to create roles.
- Error executing `logto db seed` on third-party databases like `Neon`:
Try using the `logto db seed --encrypt-base-role` command.
Try using the `logto db seed --encrypt-base-role` command.
- Database seeding failed:
Try skipping the seeding process with the `--skip-seed` parameter.
Try skipping the seeding process with the `--skip-seed` parameter.
- `Error: role xxx already exists`:
Delete the existing role in the database.
Delete the existing role in the database.
- Database migration failed after a version upgrade:
Try using the command `npx @logto/cli db alteration deploy $version` (e.g., `npx @logto/cli db alteration deploy 1.22.0`).
Try using the command `npx @logto/cli db alteration deploy $version` (e.g., `npx @logto/cli db alteration deploy 1.22.0`).
- I am using Docker deployment and want a one-click upgrade:
Execute the custom command in the container: `sh -c "npm run cli db seed -- --swe --encrypt-base-role" && npx @logto/cli db alteration deploy $version && npm start`
Execute the custom command in the container: `sh -c "npm run cli db seed -- --swe --encrypt-base-role" && npx @logto/cli db alteration deploy $version && npm start`
<Callout type={'info'}>
After successful deployment, users will be able to authenticate via Logto and use LobeChat.
In your [Microsoft Azure Portal][microsoft-azure-portal], go to Microsoft Entra ID -> App registrations -> New registration to create a new application.
In your [Microsoft Azure Portal][microsoft-azure-portal], go to Microsoft Entra ID -> App registrations -> New registration to create a new application.
Fill in the desired application name to be displayed to organizational users, choose the account types you wish to support, and if only internal users are supported, select `Accounts in this organizational directory only (Default Directory only - Single tenant)`.
Fill in the desired application name to be displayed to organizational users, choose the account types you wish to support, and if only internal users are supported, select `Accounts in this organizational directory only (Default Directory only - Single tenant)`.
In the `Redirect URI (optional)` section, for the application type, select `Web`, and in the Callback URL, enter:
In the `Redirect URI (optional)` section, for the application type, select `Web`, and in the Callback URL, enter:
After successfully creating the application, click on the corresponding application to enter the application details page, and switch to the "Overview" tab to view the corresponding configuration information.
After successfully creating the application, click on the corresponding application to enter the application details page, and switch to the "Overview" tab to view the corresponding configuration information.
Go to "Certificates & secrets", select the "Client secrets" tab, click on "New client secret", fill in the description, select the expiration time, and click on "Add" to create a new client secret.
Go to "Certificates & secrets", select the "Client secrets" tab, click on "New client secret", fill in the description, select the expiration time, and click on "Add" to create a new client secret.
Please make sure to save your client secret as this is your only chance to view it.
</Callout>
<Callout type={'important'}>
Please make sure to save your client secret as this is your only chance to view it.
</Callout>
### Add Users
### Add Users
Go back to the "Microsoft Entra ID" interface, enter "Users", click on "New user", fill in the user information, and click on "Create" to create a user for using LobeChat.
Go back to the "Microsoft Entra ID" interface, enter "Users", click on "New user", fill in the user information, and click on "Create" to create a user for using LobeChat.
### Configure Environment Variables
### Configure Environment Variables
When deploying LobeChat, you need to configure the following environment variables:
When deploying LobeChat, you need to configure the following environment variables:
| Environment Variable | Type | Description |
| --- | --- | --- |
| `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 `microsoft-entra-id` for Microsoft Entra ID. |
| `AUTH_MICROSOFT_ENTRA_ID_ID` | Required | Client ID of the Microsoft Entra ID application. |
| `AUTH_MICROSOFT_ENTRA_ID_SECRET` | Required | Client Secret of the Microsoft Entra ID application. |
| `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | Required | Tenant ID of the Microsoft Entra ID application. |
| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It is only necessary to set it when the default generated redirect address is incorrect. `https://example.com/api/auth` |
<Callout type={'tip'}>
You can refer to [📘 environment
variables](/docs/self-hosting/environment-variable#microsoft-entra-id) for details on related
| `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 `microsoft-entra-id` for Microsoft Entra ID. |
| `AUTH_MICROSOFT_ENTRA_ID_ID` | Required | Client ID of the Microsoft Entra ID application. |
| `AUTH_MICROSOFT_ENTRA_ID_SECRET` | Required | Client Secret of the Microsoft Entra ID application. |
| `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | Required | Tenant ID of the Microsoft Entra ID application. |
| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It is only necessary to set it when the default generated redirect address is incorrect. `https://example.com/api/auth` |
<Callout type={'tip'}>
You can refer to [📘 environment
variables](/docs/self-hosting/environment-variable#microsoft-entra-id) for details on related
title: Configure Wechat Authentication Service in LobeChat
description: >-
Learn how to configure Wechat authentication service in LobeChat, including
creating a new Wechat App, setting permissions, and environment variables.
tags:
- Wechat Authentication
- Wechat App
- Environment Variable Configuration
- Single Sign-On
- LobeChat
---
# Configure Wechat Authentication Service
## Wechat Configuration Process
<Steps>
### Create a Wechat Application
Click [here](https://open.weixin.qq.com/cgi-bin/index) and then click "Management Center", "Website Application", and "Create Website Application" in sequence.
Fill in the information as required by the official website prompts and submit for review.
After successful creation, click "Application Details" to obtain the AppID and AppSecret.
### Configure Environment Variables
When deploying LobeChat, you need to configure the following environment variables:
| `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. |
| `WECHAT_CLIENT_ID` | Required | Client ID from the Wechat website application details page |
| `WECHAT_CLIENT_SECRET` | Required | Client Secret from the Wechat website application details page |
| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` |
<Callout type={'tip'}>
Go to [📘 Environment Variables](/en/docs/self-hosting/environment-variables/auth#wechat) for more details about related variables.
</Callout>
</Steps>
<Callout type={'info'}>
After successful deployment, users will be able to authenticate through the WeChat Open Platform
Log in to the console of your ZITADEL instance using an account with at least a [`Project Owner` role](https://zitadel.com/docs/guides/manage/console/managers#roles), navigate to (or [create](https://zitadel.com/docs/guides/manage/console/projects#create-a-project)) the project you'd like to host your application in, and click the **New** button to create an application.
Log in to the console of your ZITADEL instance using an account with at least a [`Project Owner` role](https://zitadel.com/docs/guides/manage/console/managers#roles), navigate to (or [create](https://zitadel.com/docs/guides/manage/console/projects#create-a-project)) the project you'd like to host your application in, and click the **New** button to create an application.
When deploying LobeChat, you need to configure the following environment variables:
When deploying LobeChat, you need to configure the following environment variables:
| Environment Variable | Type | Description |
| --- | --- | --- |
| `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` | Required | Select the single sign-on provider for LoboChat. Use `zitadel` for ZITADEL. |
| `AUTH_ZITADEL_ID` | Required | Client ID (`ClientId` as shown in ZITADEL) of the ZITADEL application |
| `AUTH_ZITADEL_SECRET` | Required | Client Secret (`ClientSecret` as shown in ZITADEL) of the ZITADEL application |
| `AUTH_ZITADEL_ISSUER` | Required | Issuer URL of the ZITADEL application |
| `NEXTAUTH_URL` | Required | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` |
| `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` | Required | Select the single sign-on provider for LoboChat. Use `zitadel` for ZITADEL. |
| `AUTH_ZITADEL_ID` | Required | Client ID (`ClientId` as shown in ZITADEL) of the ZITADEL application |
| `AUTH_ZITADEL_SECRET` | Required | Client Secret (`ClientSecret` as shown in ZITADEL) of the ZITADEL application |
| `AUTH_ZITADEL_ISSUER` | Required | Issuer URL of the ZITADEL application |
| `NEXTAUTH_URL` | Required | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` |
<Callout type={'tip'}>
You can refer to the related variable details at [📘Environment Variables](/docs/self-hosting/environment-variables/auth#zitadel).
Explore LobeChat's file upload and knowledge base management features with
core components.
tags:
- LobeChat
- File Upload
- Knowledge Base
- PostgreSQL
- OpenAI Embedding
---
# Knowledge Base / File Upload
LobeChat supports file upload and knowledge base management. This feature relies on the following core technical components. Understanding these components will help you successfully deploy and maintain the knowledge base system.
@@ -32,9 +45,7 @@ S3 (or S3-compatible storage services) is used for storing uploaded files.
OpenAI's Embedding service is used to convert text into vector representations.
<Callout type={'info'}>
LobeChat currently uses OpenAI's `text-embedding-3-small` model by default. Ensure your API Key has access to this model.
LobeChat currently uses OpenAI's `text-embedding-3-small` model by default. Ensure your API Key has access to this model.
</Callout>
- **Purpose**: Generate vector representations for semantic search
@@ -51,3 +62,13 @@ Unstructured.io is a powerful document processing tool.
- **Note**: Evaluate processing needs based on document complexity
By correctly configuring and integrating these core components, you can build a powerful and efficient knowledge base system for LobeChat. Each component plays a crucial role in the overall architecture, supporting advanced document management and intelligent retrieval functions.
### 5. Custom Embedding
- **Purpose**: Use different Embedding generate vector representations for semantic search
- **Options**: support model provider list: zhipu/github/openai/bedrock/ollama
- **Deployment Tip**: Used to configure the default Embedding model
@@ -17,7 +17,7 @@ LobeChat supports customizing the model list during deployment. This configurati
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:
The first value in angle brackets is designated as the `maxToken` for this model. The second value and beyond are the model's extension capabilities, separated by colons `:`, and the order is not important.
@@ -39,12 +39,16 @@ Examples are as follows:
- `chatglm-6b=ChatGLM 6B<4096>`: ChatGLM 6B, maximum context of 4k, no advanced capabilities;
- `spark-v3.5=讯飞星火 v3.5<8192:fc>`: Xunfei Spark 3.5 model, maximum context of 8k, supports Function Call;
- `gemini-1.5-flash-latest=Gemini 1.5 Flash<16000:vision>`: Google Vision model, maximum context of 16k, supports image recognition;
- `o3-mini=OpenAI o3-mini<200000:reasoning:fc>`: OpenAI o3-mini model, maximum context of 200k, supports reasoning and Function Call;
- `qwen-max-latest=Qwen Max<32768:search:fc>`: Qwen 2.5 Max model, maximum context of 32k, supports web search and Function Call;
- `gpt-4-all=ChatGPT Plus<128000:fc:vision:file>`, hacked version of ChatGPT Plus web, context of 128k, supports image recognition, Function Call, file upload.
Enhance your LobeChat applications with open-source observability and tracing
using Langfuse. Automatically capture detailed traces and metrics for every
request to optimize and debug your chats.
tags:
- Observability
- Tracing
- Langfuse
---
# Monitor your LobeChat application with Langfuse
## What is Langfuse?
[Langfuse](https://langfuse.com/) an **open-source LLM Observability platform**. By enabling the Langfuse integration, you can trace your application data to develop, monitor, and improve the use of LobeChat, including:
Get your Langfuse API key by signing up for [Langfuse Cloud](https://cloud.langfuse.com) or [self-hosting](https://langfuse.com/docs/deployment/self-host) Langfuse.
### Set up LobeChat
There are multiple ways to [self-host LobeChat](https://lobehub.com/docs/self-hosting/start). For this example, we will use the Docker Desktop deployment.
<Tabs items={["Environment Variables", "Example in Docker Desktop"]}>
<Tab>
Before deploying LobeChat, set the following four environment variables with the Langfuse API keys you created in the previous step.
```sh
ENABLE_LANGFUSE = '1'
LANGFUSE_SECRET_KEY = 'sk-lf...'
LANGFUSE_PUBLIC_KEY = 'pk-lf...'
LANGFUSE_HOST = 'https://cloud.langfuse.com'
```
</Tab>
<Tab>
Before running the Docker container, set the environment variables in the Docker Desktop with the Langfuse API keys you created in the previous step.
<Image alt={'Environment Variables in Docker Desktop'} src={'https://langfuse.com/images/docs/lobechat-docker-desktop-env.png'} />
</Tab>
</Tabs>
### Activate Analytics in Settings
Once you have LobeChat running, navigate to the **About** tab in the **Settings** and activate analytics. This is necessary for traces to be sent to Langfuse.
All conversations in the chat are automatically traced and sent to Langfuse. You can view the traces in the [Traces section](https://langfuse.com/docs/tracing) in the Langfuse UI.
<Image alt={'LobeChat Example Trace'} src={'https://langfuse.com/images/docs/lobechat-example-trace.png'} />
*[Example trace in the Langfuse UI](https://cloud.langfuse.com/project/cloramnkj0002jz088vzn1ja4/traces/63e9246d-3f22-4e45-936d-b0c4ccf55a1e?timestamp=2024-11-26T17%3A00%3A02.028Z\&observation=7ea75a0c-d9d1-425c-9b88-27561c63b413)*
</Steps>
## Feedback
If you have any feedback or requests, please create a GitHub [Issue](https://langfuse.com/issue) or share your work with the Langfuse community on [Discord](https://discord.langfuse.com/).
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.