Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/bright-spark_lobe-chat-vercel.json

1 line
84 KiB
JSON
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"repo": "bright-spark/lobe-chat-vercel", "files": {"Dockerfile.database": {"28cb547bb4f97b3dcc5cd39eab09bc5e065c57bc": {"t": 1785747005.445509, "n": 8182, "h": "cd5b1fe725a86e03", "c": "## Base image for all building stages\nFROM node:20-slim AS base\n\nARG USE_CN_MIRROR\n\nENV DEBIAN_FRONTEND=\"noninteractive\"\n\nRUN \\\n # If you want to build docker in China, build with --build-arg USE_CN_MIRROR=true\n if [ \"${USE_CN_MIRROR:-false}\" = \"true\" ]; then \\\n sed -i \"s/deb.debian.org/mirrors.ustc.edu.cn/g\" \"/etc/apt/sources.list.d/debian.sources\"; \\\n fi \\\n # Add required package\n && apt update \\\n && apt install ca-certificates proxychains-ng -qy \\\n # Prepare required package to distroless\n && mkdir -p /distroless/bin /distroless/etc /distroless/etc/ssl/certs /distroless/lib \\\n # Copy proxychains to distroless\n && cp /usr/lib/$(arch)-linux-gnu/libproxychains.so.4 /distroless/lib/libproxychains.so.4 \\\n && cp /usr/lib/$(arch)-linux-gnu/libdl.so.2 /distroless/lib/libdl.so.2 \\\n && cp /usr/bin/proxychains4 /distroless/bin/proxychains \\\n && cp /etc/proxychains4.conf /distroless/etc/proxychains4.conf \\\n # Copy node to distroless\n && cp /usr/lib/$(arch)-linux-gnu/libstdc++.so.6 /distroless/lib/libstdc++.so.6 \\\n && cp /usr/lib/$(arch)-linux-gnu/libgcc_s.so.1 /distroless/lib/libgcc_s.so.1 \\\n && cp /usr/local/bin/node /distroless/bin/node \\\n # Copy CA certificates to distroless\n && cp /etc/ssl/certs/ca-certificates.crt /distroless/etc/ssl/certs/ca-certificates.crt \\\n # Cleanup temp files\n && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*\n\n## Builder image, install all the dependencies and build the app\nFROM base AS builder\n\nARG USE_CN_MIRROR\nARG NEXT_PUBLIC_BASE_PATH\nARG NEXT_PUBLIC_SERVICE_MODE\nARG NEXT_PUBLIC_SENTRY_DSN\nARG NEXT_PUBLIC_ANALYTICS_POSTHOG\nARG NEXT_PUBLIC_POSTHOG_HOST\nARG NEXT_PUBLIC_POSTHOG_KEY\nARG NEXT_PUBLIC_ANALYTICS_UMAMI\nARG NEXT_PUBLIC_UMAMI_SCRIPT_URL\nARG NEXT_PUBLIC_UMAMI_WEBSITE_ID\n\nENV NEXT_PUBLIC_BASE_PATH=\"${NEXT_PUBLIC_BASE_PATH}\"\n\nENV NEXT_PUBLIC_SERVICE_MODE=\"${NEXT_PUBLIC_SERVICE_MODE:-server}\" \\\n APP_URL=\"http://app.com\" \\\n DATABASE_DRIVER=\"node\" \\\n DATABASE_URL=\"postgres://postgres:password@localhost:5432/postgres\" \\\n KEY_VAULTS_SECRET=\"use-for-build\"\n\n# Sentry\nENV NEXT_PUBLIC_SENTRY_DSN=\"${NEXT_PUBLIC_SENTRY_DSN}\" \\\n SENTRY_ORG=\"\" \\\n SENTRY_PROJECT=\"\"\n\n# Posthog\nENV NEXT_PUBLIC_ANALYTICS_POSTHOG=\"${NEXT_PUBLIC_ANALYTICS_POSTHOG}\" \\\n NEXT_PUBLIC_POSTHOG_HOST=\"${NEXT_PUBLIC_POSTHOG_HOST}\" \\\n NEXT_PUBLIC_POSTHOG_KEY=\"${NEXT_PUBLIC_POSTHOG_KEY}\"\n\n# Umami\nENV NEXT_PUBLIC_ANALYTICS_UMAMI=\"${NEXT_PUBLIC_ANALYTICS_UMAMI}\" \\\n NEXT_PUBLIC_UMAMI_SCRIPT_URL=\"${NEXT_PUBLIC_UMAMI_SCRIPT_URL}\" \\\n NEXT_PUBLIC_UMAMI_WEBSITE_ID=\"${NEXT_PUBLIC_UMAMI_WEBSITE_ID}\"\n\n# Node\nENV NODE_OPTIONS=\"--max-old-space-size=8192\"\n\nWORKDIR /app\n\nCOPY package.json ./\nCOPY .npmrc ./\n\nRUN \\\n # If you want to build docker in China, build with --build-arg USE_CN_MIRROR=true\n if [ \"${USE_CN_MIRROR:-false}\" = \"true\" ]; then \\\n export SENTRYCLI_CDNURL=\"https://npmmirror.com/mirrors/sentry-cli\"; \\\n npm config set registry \"https://registry.npmmirror.com/\"; \\\n echo 'canvas_binary_host_mirror=https://npmmirror.com/mirrors/canvas' >> .npmrc; \\\n fi \\\n # Set the registry for corepack\n && export COREPACK_NPM_REGISTRY=$(npm config get registry | sed 's/\\/$//') \\\n # Enable corepack\n && corepack enable \\\n # Use pnpm for corepack\n && corepack use pnpm \\\n # Install the dependencies\n && pnpm i \\\n # Add sharp and db migration dependencies\n && mkdir -p /deps \\\n && pnpm add sharp pg drizzle-orm --prefix /deps\n\nCOPY . .\n\n# run build standalone for docker version\nRUN npm run build:docker\n\n## Application image, copy all the files for production\nFROM busybox:latest AS app\n\nCOPY --from=base /distroless/ /\n\nCOPY --from=builder /app/public /app/public\n\n# Automatically leverage output traces to reduce image size\n# https://nextjs.org/docs/advanced-features/output-file-tracing\nCOPY --from=builder /app/.next/standalone /app/\nCOPY --from=builder /app/.next/static /app/.next/static\n\n# copy dependencies\nCOPY --from=builder /deps/node_modules/.pnpm /app/node_modules/.pnpm\nCOPY --from=builder /deps/node_modules/pg /app/node_modules/pg\nCOPY --from=builder /deps/node_modules/drizzle-orm /app/node_modules/drizzle-orm\n\n# Copy database migrations\nCOPY --from=builder /app/src/database/server/migrations /app/migrations\nCOPY --from=builder /app/scripts/migrateServerDB/docker.cjs /app/docker.cjs\nCOPY --from=builder /app/scripts/migrateServerDB/errorHint.js /app/errorHint.js\n\n# Copy server launcher\nCOPY --from=builder /app/scripts/serverLauncher/startServer.js /app/startServer.js\n\nRUN \\\n # Add nextjs:nodejs to run the app\n addgroup -S -g 1001 nodejs \\\n && adduser -D -G nodejs -H -S -h /app -u 1001 nextjs \\\n # Set permission for nextjs:nodejs\n && chown -R nextjs:nodejs /app /etc/proxychains4.conf\n\n## Production image, copy all the files and run next\nFROM scratch\n\n# Copy all the files from app, set the correct permission for prerender cache\nCOPY --from=app / /\n\nENV NODE_ENV=\"production\" \\\n NODE_OPTIONS=\"--dns-result-order=ipv4first --use-openssl-ca\" \\\n NODE_EXTRA_CA_CERTS=\"\" \\\n NODE_TLS_REJECT_UNAUTHORIZED=\"\" \\\n SSL_CERT_DIR=\"/etc/ssl/certs/ca-certificates.crt\"\n\n# set hostname to localhost\nENV HOSTNAME=\"0.0.0.0\" \\\n PORT=\"3210\"\n\n# General Variables\nENV ACCESS_CODE=\"\" \\\n APP_URL=\"\" \\\n API_KEY_SELECT_MODE=\"\" \\\n DEFAULT_AGENT_CONFIG=\"\" \\\n SYSTEM_AGENT=\"\" \\\n FEATURE_FLAGS=\"\" \\\n PROXY_URL=\"\"\n\n# Database\nENV KEY_VAULTS_SECRET=\"\" \\\n DATABASE_DRIVER=\"node\" \\\n DATABASE_URL=\"\"\n\n# Next Auth\nENV NEXT_AUTH_SECRET=\"\" \\\n NEXT_AUTH_SSO_PROVIDERS=\"\" \\\n NEXTAUTH_URL=\"\"\n\n# S3\nENV NEXT_PUBLIC_S3_DOMAIN=\"\" \\\n S3_PUBLIC_DOMAIN=\"\" \\\n S3_ACCESS_KEY_ID=\"\" \\\n S3_BUCKET=\"\" \\\n S3_ENDPOINT=\"\" \\\n S3_SECRET_ACCESS_KEY=\"\"\n\n# Model Variables\nENV \\\n # AI21\n AI21_API_KEY=\"\" AI21_MODEL_LIST=\"\" \\\n # Ai360\n AI360_API_KEY=\"\" AI360_MODEL_LIST=\"\" \\\n # Anthropic\n ANTHROPIC_API_KEY=\"\" ANTHROPIC_MODEL_LIST=\"\" ANTHROPIC_PROXY_URL=\"\" \\\n # Amazon Bedrock\n AWS_ACCESS_KEY_ID=\"\" AWS_SECRET_ACCESS_KEY=\"\" AWS_REGION=\"\" AWS_BEDROCK_MODEL_LIST=\"\" \\\n # Azure OpenAI\n AZURE_API_KEY=\"\" AZURE_API_VERSION=\"\" AZURE_ENDPOINT=\"\" AZURE_MODEL_LIST=\"\" \\\n # Baichuan\n BAICHUAN_API_KEY=\"\" BAICHUAN_MODEL_LIST=\"\" \\\n # DeepSeek\n DEEPSEEK_API_KEY=\"\" DEEPSEEK_MODEL_LIST=\"\" \\\n # Fireworks AI\n FIREWORKSAI_API_KEY=\"\" FIREWORKSAI_MODEL_LIST=\"\" \\\n # GitHub\n GITHUB_TOKEN=\"\" GITHUB_MODEL_LIST=\"\" \\\n # Google\n GOOGLE_API_KEY=\"\" GOOGLE_MODEL_LIST=\"\" GOOGLE_PROXY_URL=\"\" \\\n # Groq\n GROQ_API_KEY=\"\" GROQ_MODEL_LIST=\"\" GROQ_PROXY_URL=\"\" \\\n # HuggingFace\n HUGGINGFACE_API_KEY=\"\" HUGGINGFACE_MODEL_LIST=\"\" HUGGINGFACE_PROXY_URL=\"\" \\\n # Hunyuan\n HUNYUAN_API_KEY=\"\" HUNYUAN_MODEL_LIST=\"\" \\\n # Minimax\n MINIMAX_API_KEY=\"\" MINIMAX_MODEL_LIST=\"\" \\\n # Mistral\n MISTRAL_API_KEY=\"\" MISTRAL_MODEL_LIST=\"\" \\\n # Moonshot\n MOONSHOT_API_KEY=\"\" MOONSHOT_MODEL_LIST=\"\" MOONSHOT_PROXY_URL=\"\" \\\n # Novita\n NOVITA_API_KEY=\"\" NOVITA_MODEL_LIST=\"\" \\\n # Ollama\n OLLAMA_MODEL_LIST=\"\" OLLAMA_PROXY_URL=\"\" \\\n # OpenAI\n OPENAI_API_KEY=\"\" OPENAI_MODEL_LIST=\"\" OPENAI_PROXY_URL=\"\" \\\n # OpenRouter\n OPENROUTER_API_KEY=\"\" OPENROUTER_MODEL_LIST=\"\" \\\n # Perplexity\n PERPLEXITY_API_KEY=\"\" PERPLEXITY_MODEL_LIST=\"\" PERPLEXITY_PROXY_URL=\"\" \\\n # Qwen\n QWEN_API_KEY=\"\" QWEN_MODEL_LIST=\"\" \\\n # SenseNova\n SENSENOVA_ACCESS_KEY_ID=\"\" SENSENOVA_ACCESS_KEY_SECRET=\"\" SENSENOVA_MODEL_LIST=\"\" \\\n # SiliconCloud\n SILICONCLOUD_API_KEY=\"\" SILICONCLOUD_MODEL_LIST=\"\" SILICONCLOUD_PROXY_URL=\"\" \\\n # Spark\n SPARK_API_KEY=\"\" SPARK_MODEL_LIST=\"\" \\\n # Stepfun\n STEPFUN_API_KEY=\"\" STEPFUN_MODEL_LIST=\"\" \\\n # Taichu\n TAICHU_API_KEY=\"\" TAICHU_MODEL_LIST=\"\" \\\n # TogetherAI\n TOGETHERAI_API_KEY=\"\" TOGETHERAI_MODEL_LIST=\"\" \\\n # Upstage\n UPSTAGE_API_KEY=\"\" UPSTAGE_MODEL_LIST=\"\" \\\n # Wenxin\n WENXIN_ACCESS_KEY=\"\" WENXIN_SECRET_KEY=\"\" WENXIN_MODEL_LIST=\"\" \\\n # 01.AI\n ZEROONE_API_KEY=\"\" ZEROONE_MODEL_LIST=\"\" \\\n # Zhipu\n ZHIPU_API_KEY=\"\" ZHIPU_MODEL_LIST=\"\"\n\nUSER nextjs\n\nEXPOSE 3210/tcp\n\nENTRYPOINT [\"/bin/node\"]\n\nCMD [\"/app/startServer.js\"]\n"}}, "Dockerfile": {"28cb547bb4f97b3dcc5cd39eab09bc5e065c57bc": {"t": 1785747009.4604416, "n": 7104, "h": "fcc0b5e1e53472dc", "c": "## Base image for all building stages\nFROM node:20-slim AS base\n\nARG USE_CN_MIRROR\n\nENV DEBIAN_FRONTEND=\"noninteractive\"\n\nRUN \\\n # If you want to build docker in China, build with --build-arg USE_CN_MIRROR=true\n if [ \"${USE_CN_MIRROR:-false}\" = \"true\" ]; then \\\n sed -i \"s/deb.debian.org/mirrors.ustc.edu.cn/g\" \"/etc/apt/sources.list.d/debian.sources\"; \\\n fi \\\n # Add required package\n && apt update \\\n && apt install ca-certificates proxychains-ng -qy \\\n # Prepare required package to distroless\n && mkdir -p /distroless/bin /distroless/etc /distroless/etc/ssl/certs /distroless/lib \\\n # Copy proxychains to distroless\n && cp /usr/lib/$(arch)-linux-gnu/libproxychains.so.4 /distroless/lib/libproxychains.so.4 \\\n && cp /usr/lib/$(arch)-linux-gnu/libdl.so.2 /distroless/lib/libdl.so.2 \\\n && cp /usr/bin/proxychains4 /distroless/bin/proxychains \\\n && cp /etc/proxychains4.conf /distroless/etc/proxychains4.conf \\\n # Copy node to distroless\n && cp /usr/lib/$(arch)-linux-gnu/libstdc++.so.6 /distroless/lib/libstdc++.so.6 \\\n && cp /usr/lib/$(arch)-linux-gnu/libgcc_s.so.1 /distroless/lib/libgcc_s.so.1 \\\n && cp /usr/local/bin/node /distroless/bin/node \\\n # Copy CA certificates to distroless\n && cp /etc/ssl/certs/ca-certificates.crt /distroless/etc/ssl/certs/ca-certificates.crt \\\n # Cleanup temp files\n && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*\n\n## Builder image, install all the dependencies and build the app\nFROM base AS builder\n\nARG USE_CN_MIRROR\nARG NEXT_PUBLIC_BASE_PATH\nARG NEXT_PUBLIC_SENTRY_DSN\nARG NEXT_PUBLIC_ANALYTICS_POSTHOG\nARG NEXT_PUBLIC_POSTHOG_HOST\nARG NEXT_PUBLIC_POSTHOG_KEY\nARG NEXT_PUBLIC_ANALYTICS_UMAMI\nARG NEXT_PUBLIC_UMAMI_SCRIPT_URL\nARG NEXT_PUBLIC_UMAMI_WEBSITE_ID\n\nENV NEXT_PUBLIC_BASE_PATH=\"${NEXT_PUBLIC_BASE_PATH}\"\n\n# Sentry\nENV NEXT_PUBLIC_SENTRY_DSN=\"${NEXT_PUBLIC_SENTRY_DSN}\" \\\n SENTRY_ORG=\"\" \\\n SENTRY_PROJECT=\"\"\n\n# Posthog\nENV NEXT_PUBLIC_ANALYTICS_POSTHOG=\"${NEXT_PUBLIC_ANALYTICS_POSTHOG}\" \\\n NEXT_PUBLIC_POSTHOG_HOST=\"${NEXT_PUBLIC_POSTHOG_HOST}\" \\\n NEXT_PUBLIC_POSTHOG_KEY=\"${NEXT_PUBLIC_POSTHOG_KEY}\"\n\n# Umami\nENV NEXT_PUBLIC_ANALYTICS_UMAMI=\"${NEXT_PUBLIC_ANALYTICS_UMAMI}\" \\\n NEXT_PUBLIC_UMAMI_SCRIPT_URL=\"${NEXT_PUBLIC_UMAMI_SCRIPT_URL}\" \\\n NEXT_PUBLIC_UMAMI_WEBSITE_ID=\"${NEXT_PUBLIC_UMAMI_WEBSITE_ID}\"\n\n# Node\nENV NODE_OPTIONS=\"--max-old-space-size=8192\"\n\nWORKDIR /app\n\nCOPY package.json ./\nCOPY .npmrc ./\n\nRUN \\\n # If you want to build docker in China, build with --build-arg USE_CN_MIRROR=true\n if [ \"${USE_CN_MIRROR:-false}\" = \"true\" ]; then \\\n export SENTRYCLI_CDNURL=\"https://npmmirror.com/mirrors/sentry-cli\"; \\\n npm config set registry \"https://registry.npmmirror.com/\"; \\\n echo 'canvas_binary_host_mirror=https://npmmirror.com/mirrors/canvas' >> .npmrc; \\\n fi \\\n # Set the registry for corepack\n && export COREPACK_NPM_REGISTRY=$(npm config get registry | sed 's/\\/$//') \\\n # Enable corepack\n && corepack enable \\\n # Use pnpm for corepack\n && corepack use pnpm \\\n # Install the dependencies\n && pnpm i \\\n # Add sharp dependencies\n && mkdir -p /deps \\\n && pnpm add sharp --prefix /deps\n\nCOPY . .\n\n# run build standalone for docker version\nRUN npm run build:docker\n\n## Application image, copy all the files for production\nFROM busybox:latest AS app\n\nCOPY --from=base /distroless/ /\n\nCOPY --from=builder /app/public /app/public\n\n# Automatically leverage output traces to reduce image size\n# https://nextjs.org/docs/advanced-features/output-file-tracing\nCOPY --from=builder /app/.next/standalone /app/\nCOPY --from=builder /app/.next/static /app/.next/static\nCOPY --from=builder /deps/node_modules/.pnpm /app/node_modules/.pnpm\n\n# Copy server launcher\nCOPY --from=builder /app/scripts/serverLauncher/startServer.js /app/startServer.js\n\nRUN \\\n # Add nextjs:nodejs to run the app\n addgroup -S -g 1001 nodejs \\\n && adduser -D -G nodejs -H -S -h /app -u 1001 nextjs \\\n # Set permission for nextjs:nodejs\n && chown -R nextjs:nodejs /app /etc/proxychains4.conf\n\n## Production image, copy all the files and run next\nFROM scratch\n\n# Copy all the files from app, set the correct permission for prerender cache\nCOPY --from=app / /\n\nENV NODE_ENV=\"production\" \\\n NODE_OPTIONS=\"--dns-result-order=ipv4first --use-openssl-ca\" \\\n NODE_EXTRA_CA_CERTS=\"\" \\\n NODE_TLS_REJECT_UNAUTHORIZED=\"\" \\\n SSL_CERT_DIR=\"/etc/ssl/certs/ca-certificates.crt\"\n\n# set hostname to localhost\nENV HOSTNAME=\"0.0.0.0\" \\\n PORT=\"3210\"\n\n# General Variables\nENV ACCESS_CODE=\"\" \\\n API_KEY_SELECT_MODE=\"\" \\\n DEFAULT_AGENT_CONFIG=\"\" \\\n SYSTEM_AGENT=\"\" \\\n FEATURE_FLAGS=\"\" \\\n PROXY_URL=\"\"\n\n# Model Variables\nENV \\\n # AI21\n AI21_API_KEY=\"\" AI21_MODEL_LIST=\"\" \\\n # Ai360\n AI360_API_KEY=\"\" AI360_MODEL_LIST=\"\" \\\n # Anthropic\n ANTHROPIC_API_KEY=\"\" ANTHROPIC_MODEL_LIST=\"\" ANTHROPIC_PROXY_URL=\"\" \\\n # Amazon Bedrock\n AWS_ACCESS_KEY_ID=\"\" AWS_SECRET_ACCESS_KEY=\"\" AWS_REGION=\"\" AWS_BEDROCK_MODEL_LIST=\"\" \\\n # Azure OpenAI\n AZURE_API_KEY=\"\" AZURE_API_VERSION=\"\" AZURE_ENDPOINT=\"\" AZURE_MODEL_LIST=\"\" \\\n # Baichuan\n BAICHUAN_API_KEY=\"\" BAICHUAN_MODEL_LIST=\"\" \\\n # DeepSeek\n DEEPSEEK_API_KEY=\"\" DEEPSEEK_MODEL_LIST=\"\" \\\n # Fireworks AI\n FIREWORKSAI_API_KEY=\"\" FIREWORKSAI_MODEL_LIST=\"\" \\\n # GitHub\n GITHUB_TOKEN=\"\" GITHUB_MODEL_LIST=\"\" \\\n # Google\n GOOGLE_API_KEY=\"\" GOOGLE_MODEL_LIST=\"\" GOOGLE_PROXY_URL=\"\" \\\n # Groq\n GROQ_API_KEY=\"\" GROQ_MODEL_LIST=\"\" GROQ_PROXY_URL=\"\" \\\n # HuggingFace\n HUGGINGFACE_API_KEY=\"\" HUGGINGFACE_MODEL_LIST=\"\" HUGGINGFACE_PROXY_URL=\"\" \\\n # Hunyuan\n HUNYUAN_API_KEY=\"\" HUNYUAN_MODEL_LIST=\"\" \\\n # Minimax\n MINIMAX_API_KEY=\"\" MINIMAX_MODEL_LIST=\"\" \\\n # Mistral\n MISTRAL_API_KEY=\"\" MISTRAL_MODEL_LIST=\"\" \\\n # Moonshot\n MOONSHOT_API_KEY=\"\" MOONSHOT_MODEL_LIST=\"\" MOONSHOT_PROXY_URL=\"\" \\\n # Novita\n NOVITA_API_KEY=\"\" NOVITA_MODEL_LIST=\"\" \\\n # Ollama\n OLLAMA_MODEL_LIST=\"\" OLLAMA_PROXY_URL=\"\" \\\n # OpenAI\n OPENAI_API_KEY=\"\" OPENAI_MODEL_LIST=\"\" OPENAI_PROXY_URL=\"\" \\\n # OpenRouter\n OPENROUTER_API_KEY=\"\" OPENROUTER_MODEL_LIST=\"\" \\\n # Perplexity\n PERPLEXITY_API_KEY=\"\" PERPLEXITY_MODEL_LIST=\"\" PERPLEXITY_PROXY_URL=\"\" \\\n # Qwen\n QWEN_API_KEY=\"\" QWEN_MODEL_LIST=\"\" \\\n # SenseNova\n SENSENOVA_ACCESS_KEY_ID=\"\" SENSENOVA_ACCESS_KEY_SECRET=\"\" SENSENOVA_MODEL_LIST=\"\" \\\n # SiliconCloud\n SILICONCLOUD_API_KEY=\"\" SILICONCLOUD_MODEL_LIST=\"\" SILICONCLOUD_PROXY_URL=\"\" \\\n # Spark\n SPARK_API_KEY=\"\" SPARK_MODEL_LIST=\"\" \\\n # Stepfun\n STEPFUN_API_KEY=\"\" STEPFUN_MODEL_LIST=\"\" \\\n # Taichu\n TAICHU_API_KEY=\"\" TAICHU_MODEL_LIST=\"\" \\\n # TogetherAI\n TOGETHERAI_API_KEY=\"\" TOGETHERAI_MODEL_LIST=\"\" \\\n # Upstage\n UPSTAGE_API_KEY=\"\" UPSTAGE_MODEL_LIST=\"\" \\\n # Wenxin\n WENXIN_ACCESS_KEY=\"\" WENXIN_SECRET_KEY=\"\" WENXIN_MODEL_LIST=\"\" \\\n # 01.AI\n ZEROONE_API_KEY=\"\" ZEROONE_MODEL_LIST=\"\" \\\n # Zhipu\n ZHIPU_API_KEY=\"\" ZHIPU_MODEL_LIST=\"\"\n\nUSER nextjs\n\nEXPOSE 3210/tcp\n\nENTRYPOINT [\"/bin/node\"]\n\nCMD [\"/app/startServer.js\"]\n"}}, "README.md": {"28cb547bb4f97b3dcc5cd39eab09bc5e065c57bc": {"t": 1785747197.6829197, "n": 55726, "h": "e0839599338ce995", "c": "<div align=\"center\"><a name=\"readme-top\"></a>\n\n[![][image-banner]][vercel-link]\n\n# Lobe Chat\n\nAn open-source, modern-design ChatGPT/LLMs UI/Framework.<br/>\nSupports speech-synthesis, multi-modal, and extensible ([function call][docs-functionc-call]) plugin system.<br/>\nOne-click **FREE** deployment of your private OpenAI ChatGPT/Claude/Gemini/Groq/Ollama chat application.\n\n**English** · [简体中文](./README.zh-CN.md) · [日本語](./README.ja-JP.md) · [Official Site][official-site] · [Changelog](./CHANGELOG.md) · [Documents][docs] · [Blog][blog] · [Feedback][github-issues-link]\n\n<!-- SHIELD GROUP -->\n\n[![][github-release-shield]][github-release-link]\n[![][docker-release-shield]][docker-release-link]\n[![][vercel-shield]][vercel-link]\n[![][discord-shield]][discord-link]<br/>\n[![][codecov-shield]][codecov-link]\n[![][github-action-test-shield]][github-action-test-link]\n[![][github-action-release-shield]][github-action-release-link]\n[![][github-releasedate-shield]][github-releasedate-link]<br/>\n[![][github-contributors-shield]][github-contributors-link]\n[![][github-forks-shield]][github-forks-link]\n[![][github-stars-shield]][github-stars-link]\n[![][github-issues-shield]][github-issues-link]\n[![][github-license-shield]][github-license-link]<br>\n[![][sponsor-shield]][sponsor-link]\n\n**Share LobeChat Repository**\n\n[![][share-x-shield]][share-x-link]\n[![][share-telegram-shield]][share-telegram-link]\n[![][share-whatsapp-shield]][share-whatsapp-link]\n[![][share-reddit-shield]][share-reddit-link]\n[![][share-weibo-shield]][share-weibo-link]\n[![][share-mastodon-shield]][share-mastodon-link]\n[![][share-linkedin-shield]][share-linkedin-link]\n\n<sup>Pioneering the new age of thinking and creating. Built for you, the Super Individual.</sup>\n\n[![][github-trending-shield]][github-trending-url]\n\n[![][image-overview]][vercel-link]\n\n</div>\n\n<details>\n<summary><kbd>Table of contents</kbd></summary>\n\n#### TOC\n\n- [👋🏻 Getting Started & Join Our Community](#-getting-started--join-our-community)\n- [✨ Features](#-features)\n - [`1` File Upload/Knowledge Base](#1-file-uploadknowledge-base)\n - [`2` Multi-Model Service Provider Support](#2-multi-model-service-provider-support)\n - [`3` Local Large Language Model (LLM) Support](#3-local-large-language-model-llm-support)\n - [`4` Model Visual Recognition](#4-model-visual-recognition)\n - [`5` TTS & STT Voice Conversation](#5-tts--stt-voice-conversation)\n - [`6` Text to Image Generation](#6-text-to-image-generation)\n - [`7` Plugin System (Function Calling)](#7-plugin-system-function-calling)\n - [`8` Agent Market (GPTs)](#8-agent-market-gpts)\n - [`9` Support Local / Remote Database](#9-support-local--remote-database)\n - [`10` Support Multi-User Management](#10-support-multi-user-management)\n - [`11` Progressive Web App (PWA)](#11-progressive-web-app-pwa)\n - [`12` Mobile Device Adaptation](#12-mobile-device-adaptation)\n - [`13` Custom Themes](#13-custom-themes)\n - [`*` What's more](#-whats-more)\n- [⚡️ Performance](#️-performance)\n- [🛳 Self Hosting](#-self-hosting)\n - [`A` Deploying with Vercel, Zeabur , Sealos or Alibaba Cloud](#a-deploying-with-vercel-zeabur--sealos-or-alibaba-cloud)\n - [`B` Deploying with Docker](#b-deploying-with-docker)\n - [Environment Variable](#environment-variable)\n- [📦 Ecosystem](#-ecosystem)\n- [🧩 Plugins](#-plugins)\n- [⌨️ Local Development](#️-local-development)\n- [🤝 Contributing](#-contributing)\n- [❤️ Sponsor](#️-sponsor)\n- [🔗 More Products](#-more-products)\n\n####\n\n<br/>\n\n</details>\n\n## 👋🏻 Getting Started & Join Our Community\n\nWe are a group of e/acc design-engineers, hoping to provide modern design components and tools for AIGC.\nBy adopting the Bootstrapping approach, we aim to provide developers and users with a more open, transparent, and user-friendly product ecosystem.\n\nWhether for users or professional developers, LobeHub will be your AI Agent playground. Please be aware that LobeChat is currently under active development, and feedback is welcome for any [issues][issues-link] encountered.\n\n| [![][vercel-shield-badge]][vercel-link] | No installation or registration necessary! Visit our website to experience it firsthand. |\n| :---------------------------------------- | :----------------------------------------------------------------------------------------------------------------- |\n| [![][discord-shield-badge]][discord-link] | Join our Discord community! This is where you can connect with developers and other enthusiastic users of LobeHub. |\n\n> \\[!IMPORTANT]\n>\n> **Star Us**, You will receive all release notifications from GitHub without any delay \\~ ⭐️\n\n[![][image-star]][github-stars-link]\n\n<details>\n <summary><kbd>Star History</kbd></summary>\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=lobehub%2Flobe-chat&theme=dark&type=Date\">\n <img width=\"100%\" src=\"https://api.star-history.com/svg?repos=lobehub%2Flobe-chat&type=Date\">\n </picture>\n</details>\n\n## ✨ Features\n\n[![][image-feat-knowledgebase]][docs-feat-knowledgebase]\n\n### `1` [File Upload/Knowledge Base][docs-feat-knowledgebase]\n\nLobeChat 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.\n\n<https://github.com/user-attachments/assets/faa8cf67-e743-4590-8bf6-ebf6ccc34175>\n\n> \\[!TIP]\n>\n> Learn more on [📘 LobeChat Knowledge Base Launch — From Now On, Every Step Counts](https://lobehub.com/blog/knowledge-base)\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n[![][image-feat-privoder]][docs-feat-provider]\n\n### `2` [Multi-Model Service Provider Support][docs-feat-provider]\n\nIn 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.\n\nIn this way, LobeChat can more flexibly adapt to the needs of different users, while also providing developers with a wider range of choices.\n\n#### Supported Model Service Providers\n\nWe have implemented support for the following model service providers:\n\n- **AWS Bedrock**: Integrated with AWS Bedrock service, supporting models such as **Claude / LLama2**, providing powerful natural language processing capabilities. [Learn more](https://aws.amazon.com/cn/bedrock)\n- **Anthropic (Claude)**: Accessed Anthropic's **Claude** series models, including Claude 3 and Claude 2, with breakthroughs in multi-modal capabilities and extended context, setting a new industry benchmark. [Learn more](https://www.anthropic.com/claude)\n- **Google AI (Gemini Pro, Gemini Vision)**: Access to Google's **Gemini** series models, including Gemini and Gemini Pro, to support advanced language understanding and generation. [Learn more](https://deepmind.google/technologies/gemini/)\n- **Groq**: Accessed Groq's AI models, efficiently processing message sequences and generating responses, capable of multi-turn dialogues and single-interaction tasks. [Learn more](https://groq.com/)\n- **OpenRouter**: Supports routing of models including **Claude 3**, **Gemma**, **Mistral**, **Llama2** and **Cohere**, with intelligent routing optimization to improve usage efficiency, open and flexible. [Learn more](https://openrouter.ai/)\n- **01.AI (Yi Model)**: Integrated the 01.AI models, with series of APIs featuring fast inference speed, which not only shortened the processing time, but also maintained excellent model performance. [Learn more](https://01.ai/)\n- **Together.ai**: Over 100 leading open-source Chat, Language, Image, Code, and Embedding models are available through the Together Inference API. For these models you pay just for what you use. [Learn more](https://www.together.ai/)\n- **ChatGLM**: Added the **ChatGLM** series models from Zhipuai (GLM-4/GLM-4-vision/GLM-3-turbo), providing users with another efficient conversation model choice. [Learn more](https://www.zhipuai.cn/)\n- **Moonshot AI (Dark Side of the Moon)**: Integrated with the Moonshot series models, an innovative AI startup from China, aiming to provide deeper conversation understanding. [Learn more](https://www.moonshot.cn/)\n- **Minimax**: Integrated the Minimax models, including the MoE model **abab6**, offers a broader range of choices. [Learn more](https://www.minimaxi.com/)\n- **DeepSeek**: Integrated with the DeepSeek series models, an innovative AI startup from China, The product has been designed to provide a model that balances performance with price. [Learn more](https://www.deepseek.com/)\n- **Qwen**: Integrated the Qwen series models, including the latest **qwen-turbo**, **qwen-plus** and **qwen-max**. [Learn more](https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction)\n- **Novita AI**: Access **Llama**, **Mistral**, and other leading open-source models at cheapest prices. Engage in uncensored role-play, spark creative discussions, and foster unrestricted innovation. **Pay For What You Use.** [Learn more](https://novita.ai/llm-api?utm_source=lobechat&utm_medium=ch&utm_campaign=api)\n\nAt the same time, we are also planning to support more model service providers, such as Replicate and Perplexity, to further enrich our service provider library. If you would like LobeChat to support your favorite service provider, feel free to join our [community discussion](https://github.com/lobehub/lobe-chat/discussions/1284).\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n[![][image-feat-local]][docs-feat-local]\n\n### `3` [Local Large Language Model (LLM) Support][docs-feat-local]\n\nTo 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.\n\n> \\[!TIP]\n>\n> Learn more about [📘 Using Ollama in LobeChat][docs-usage-ollama] by checking it out.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n[![][image-feat-vision]][docs-feat-vision]\n\n### `4` [Model Visual Recognition][docs-feat-vision]\n\nLobeChat now supports OpenAI's latest [`gpt-4-vision`](https://platform.openai.com/docs/guides/vision) model with visual recognition capabilities,\na multimodal intelligence that can perceive visuals. Users can easily upload or drag and drop images into the dialogue box,\nand the agent will be able to recognize the content of the images and engage in intelligent conversation based on this,\ncreating smarter and more diversified chat scenarios.\n\nThis feature opens up new interactive methods, allowing communication to transcend text and include a wealth of visual elements.\nWhether it's sharing images in daily use or interpreting images within specific industries, the agent provides an outstanding conversational experience.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n[![][image-feat-tts]][docs-feat-tts]\n\n### `5` [TTS & STT Voice Conversation][docs-feat-tts]\n\nLobeChat supports Text-to-Speech (TTS) and Speech-to-Text (STT) technologies, enabling our application to convert text messages into clear voice outputs,\nallowing 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.\n\nMoreover, TTS offers an excellent solution for those who prefer auditory learning or desire to receive information while busy.\nIn LobeChat, we have meticulously selected a range of high-quality voice options (OpenAI Audio, Microsoft Edge Speech) to meet the needs of users from different regions and cultural backgrounds.\nUsers can choose the voice that suits their personal preferences or specific scenarios, resulting in a personalized communication experience.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n[![][image-feat-t2i]][docs-feat-t2i]\n\n### `6` [Text to Image Generation][docs-feat-t2i]\n\nWith 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.\n\nThis enables a more private and immersive creative process, allowing for the seamless integration of visual storytelling into your personal dialogue with the agent.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n[![][image-feat-plugin]][docs-feat-plugin]\n\n### `7` [Plugin System (Function Calling)][docs-feat-plugin]\n\nThe plugin ecosystem of LobeChat is an important extension of its core functionality, greatly enhancing the practicality and flexibility of the LobeChat assistant.\n\n<video controls src=\"https://github.com/lobehub/lobe-chat/assets/28616219/f29475a3-f346-4196-a435-41a6373ab9e2\" muted=\"false\"></video>\n\nBy utilizing plugins, LobeChat assistants can obtain and process real-time information, such as searching for web information and providing users with instant and relevant news.\n\nIn addition, these plugins are not limited to news aggregation, but can also extend to other practical functions, such as quickly searching documents, generating images, obtaining data from various platforms like Bilibili, Steam, and interacting with various third-party services.\n\n> \\[!TIP]\n>\n> Learn more about [📘 Plugin Usage][docs-usage-plugin] by checking it out.\n\n<!-- PLUGIN LIST -->\n\n| Recent Submits | Description |\n| ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |\n| [Tongyi wanxiang Image Generator](https://chat-preview.lobehub.com/settings/agent)<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` |\n| [Shopping tools](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **shoppingtools** on **2024-07-19**</sup> | Search for products on eBay & AliExpress, find eBay events & coupons. Get prompt examples.<br/>`shopping` `e-bay` `ali-express` `coupons` |\n| [Savvy Trader AI](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **savvytrader** on **2024-06-27**</sup> | Realtime stock, crypto and other investment data.<br/>`stock` `analyze` |\n| [Search1API](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **fatwang2** on **2024-05-06**</sup> | Search aggregation service, specifically designed for LLMs<br/>`web` `search` |\n\n> 📊 Total plugins: [<kbd>**49**</kbd>](https://github.com/lobehub/lobe-chat-plugins)\n\n <!-- PLUGIN LIST -->\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n[![][image-feat-agent]][docs-feat-agent]\n\n### `8` [Agent Market (GPTs)][docs-feat-agent]\n\nIn LobeChat Agent Marketplace, creators can discover a vibrant and innovative community that brings together a multitude of well-designed agents,\nwhich not only play an important role in work scenarios but also offer great convenience in learning processes.\nOur marketplace is not just a showcase platform but also a collaborative space. Here, everyone can contribute their wisdom and share the agents they have developed.\n\n> \\[!TIP]\n>\n> By [🤖/🏪 Submit Agents][submit-agents-link], you can easily submit your agent creations to our platform.\n> Importantly, LobeChat has established a sophisticated automated internationalization (i18n) workflow,\n> capable of seamlessly translating your agent into multiple language versions.\n> This means that no matter what language your users speak, they can experience your agent without barriers.\n\n> \\[!IMPORTANT]\n>\n> We welcome all users to join this growing ecosystem and participate in the iteration and optimization of agents.\n> Together, we can create more interesting, practical, and innovative agents, further enriching the diversity and practicality of the agent offerings.\n\n<!-- AGENT LIST -->\n\n| Recent Submits | Description |\n| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [Machine Vision LaTeX](https://chat-preview.lobehub.com/market?agent=cv-latex)<br/><sup>By **[5xiao0qing5](https://github.com/5xiao0qing5)** on **2024-10-29**</sup> | Specializes in explaining concepts of machine learning and deep learning<br/>`machine-learning` `deep-learning` `image-processing` `computer-vision` `la-te-x` |\n| [Domain Analysis Master](https://chat-preview.lobehub.com/market?agent=domain)<br/><sup>By **[ccbikai](https://github.com/ccbikai)** on **2024-10-29**</sup> | Expert in domain analysis and humorous suggestions<br/>`domain-analysis` `humor` `culture` `website-suggestions` `purchase-advice` |\n| [Ingo Hausmann](https://chat-preview.lobehub.com/market?agent=pc-beschaffung-ingo-hausmann)<br/><sup>By **[bionicprompter](https://github.com/bionicprompter)** on **2024-10-29**</sup> | Ingo Hausmann wants to be advised on a new purchase of PCs<br/>`company` `hardware` `needs-assessment` `it` `applications` |\n| [Print to Table](https://chat-preview.lobehub.com/market?agent=print-to-table)<br/><sup>By **[printtotable](https://github.com/printtotable)** on **2024-10-29**</sup> | Transform data from images into organized tables in Excel.<br/>`data-extraction` `tables` `advertising` `influencer` `excel` |\n\n> 📊 Total agents: [<kbd>**430**</kbd> ](https://github.com/lobehub/lobe-chat-agents)\n\n <!-- AGENT LIST -->\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n[![][image-feat-database]][docs-feat-database]\n\n### `9` [Support Local / Remote Database][docs-feat-database]\n\nLobeChat supports the use of both server-side and local databases. Depending on your needs, you can choose the appropriate deployment solution:\n\n- **Local database**: suitable for users who want more control over their data and privacy protection. LobeChat uses CRDT (Conflict-Free Replicated Data Type) technology to achieve multi-device synchronization. This is an experimental feature aimed at providing a seamless data synchronization experience.\n- **Server-side database**: suitable for users who want a more convenient user experience. LobeChat supports PostgreSQL as a server-side database. For detailed documentation on how to configure the server-side database, please visit [Configure Server-side Database](https://lobehub.com/docs/self-hosting/advanced/server-database).\n\nRegardless of which database you choose, LobeChat can provide you with an excellent user experience.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n[![][image-feat-auth]][docs-feat-auth]\n\n### `10` [Support Multi-User Management][docs-feat-auth]\n\nLobeChat supports multi-user management and provides two main user authentication and management solutions to meet different needs:\n\n- **next-auth**: LobeChat integrates `next-auth`, a flexible and powerful identity verification library that supports multiple authentication methods, including OAuth, email login, credential login, etc. With `next-auth`, you can easily implement user registration, login, session management, social login, and other functions to ensure the security and privacy of user data.\n\n- [**Clerk**](https://go.clerk.com/exgqLG0): For users who need more advanced user management features, LobeChat also supports `Clerk`, a modern user management platform. `Clerk` provides richer functions, such as multi-factor authentication (MFA), user profile management, login activity monitoring, etc. With `Clerk`, you can get higher security and flexibility, and easily cope with complex user management needs.\n\nRegardless of which user management solution you choose, LobeChat can provide you with an excellent user experience and powerful functional support.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n[![][image-feat-pwa]][docs-feat-pwa]\n\n### `11` [Progressive Web App (PWA)][docs-feat-pwa]\n\nWe deeply understand the importance of providing a seamless experience for users in today's multi-device environment.\nTherefore, we have adopted Progressive Web Application ([PWA](https://support.google.com/chrome/answer/9658361)) technology,\na modern web technology that elevates web applications to an experience close to that of native apps.\n\nThrough PWA, LobeChat can offer a highly optimized user experience on both desktop and mobile devices while maintaining its lightweight and high-performance characteristics.\nVisually and in terms of feel, we have also meticulously designed the interface to ensure it is indistinguishable from native apps,\nproviding smooth animations, responsive layouts, and adapting to different device screen resolutions.\n\n> \\[!NOTE]\n>\n> If you are unfamiliar with the installation process of PWA, you can add LobeChat as your desktop application (also applicable to mobile devices) by following these steps:\n>\n> - Launch the Chrome or Edge browser on your computer.\n> - Visit the LobeChat webpage.\n> - In the upper right corner of the address bar, click on the <kbd>Install</kbd> icon.\n> - Follow the instructions on the screen to complete the PWA Installation.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n[![][image-feat-mobile]][docs-feat-mobile]\n\n### `12` [Mobile Device Adaptation][docs-feat-mobile]\n\nWe 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.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n[![][image-feat-theme]][docs-feat-theme]\n\n### `13` [Custom Themes][docs-feat-theme]\n\nAs a design-engineering-oriented application, LobeChat places great emphasis on users' personalized experiences,\nhence introducing flexible and diverse theme modes, including a light mode for daytime and a dark mode for nighttime.\nBeyond switching theme modes, a range of color customization options allow users to adjust the application's theme colors according to their preferences.\nWhether it's a desire for a sober dark blue, a lively peach pink, or a professional gray-white, users can find their style of color choices in LobeChat.\n\n> \\[!TIP]\n>\n> The default configuration can intelligently recognize the user's system color mode and automatically switch themes to ensure a consistent visual experience with the operating system.\n> For users who like to manually control details, LobeChat also offers intuitive setting options and a choice between chat bubble mode and document mode for conversation scenarios.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n### `*` What's more\n\nBeside these features, LobeChat also have much better basic technique underground:\n\n- [x] 💨 **Quick Deployment**: Using the Vercel platform or docker image, you can deploy with just one click and complete the process within 1 minute without any complex configuration.\n- [x] 🌐 **Custom Domain**: If users have their own domain, they can bind it to the platform for quick access to the dialogue agent from anywhere.\n- [x] 🔒 **Privacy Protection**: All data is stored locally in the user's browser, ensuring user privacy.\n- [x] 💎 **Exquisite UI Design**: With a carefully designed interface, it offers an elegant appearance and smooth interaction. It supports light and dark themes and is mobile-friendly. PWA support provides a more native-like experience.\n- [x] 🗣️ **Smooth Conversation Experience**: Fluid responses ensure a smooth conversation experience. It fully supports Markdown rendering, including code highlighting, LaTex formulas, Mermaid flowcharts, and more.\n\n> ✨ more features will be added when LobeChat evolve.\n\n---\n\n> \\[!NOTE]\n>\n> You can find our upcoming [Roadmap][github-project-link] plans in the Projects section.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## ⚡️ Performance\n\n> \\[!NOTE]\n>\n> The complete list of reports can be found in the [📘 Lighthouse Reports][docs-lighthouse]\n\n| Desktop | Mobile |\n| :-----------------------------------------: | :----------------------------------------: |\n| ![][chat-desktop] | ![][chat-mobile] |\n| [📑 Lighthouse Report][chat-desktop-report] | [📑 Lighthouse Report][chat-mobile-report] |\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## 🛳 Self Hosting\n\nLobeChat provides Self-Hosted Version with Vercel, Alibaba Cloud, and [Docker Image][docker-release-link]. This allows you to deploy your own chatbot within a few minutes without any prior knowledge.\n\n> \\[!TIP]\n>\n> Learn more about [📘 Build your own LobeChat][docs-self-hosting] by checking it out.\n\n### `A` Deploying with Vercel, Zeabur , Sealos or Alibaba Cloud\n\n\"If you want to deploy this service yourself on Vercel, Zeabur or Alibaba Cloud, you can follow these steps:\n\n- Prepare your [OpenAI API Key](https://platform.openai.com/account/api-keys).\n- Click the button below to start deployment: Log in directly with your GitHub account, and remember to fill in the `OPENAI_API_KEY`(required) and `ACCESS_CODE` (recommended) on the environment variable section.\n- After deployment, you can start using it.\n- Bind a custom domain (optional): The DNS of the domain assigned by Vercel is polluted in some areas; binding a custom domain can connect directly.\n\n<div align=\"center\">\n\n| Deploy with Vercel | Deploy with Zeabur | Deploy with Sealos | Deploy with RepoCloud | Deploy with Alibaba Cloud |\n| :-------------------------------------: | :---------------------------------------------------------: | :---------------------------------------------------------: | :---------------------------------------------------------------: | :-----------------------------------------------------------------------: |\n| [![][deploy-button-image]][deploy-link] | [![][deploy-on-zeabur-button-image]][deploy-on-zeabur-link] | [![][deploy-on-sealos-button-image]][deploy-on-sealos-link] | [![][deploy-on-repocloud-button-image]][deploy-on-repocloud-link] | [![][deploy-on-alibaba-cloud-button-image]][deploy-on-alibaba-cloud-link] |\n\n</div>\n\n#### After Fork\n\nAfter fork, only retain the upstream sync action and disable other actions in your repository on GitHub.\n\n#### Keep Updated\n\nIf you have deployed your own project following the one-click deployment steps in the README, you might encounter constant prompts indicating \"updates available.\" This is because Vercel defaults to creating a new project instead of forking this one, resulting in an inability to detect updates accurately.\n\n> \\[!TIP]\n>\n> We suggest you redeploy using the following steps, [📘 Auto Sync With Latest][docs-upstream-sync]\n\n<br/>\n\n### `B` Deploying with Docker\n\n[![][docker-release-shield]][docker-release-link]\n[![][docker-size-shield]][docker-size-link]\n[![][docker-pulls-shield]][docker-pulls-link]\n\nWe provide a Docker image for deploying the LobeChat service on your own private device. Use the following command to start the LobeChat service:\n\n```fish\n$ docker run -d -p 3210:3210 \\\n -e OPENAI_API_KEY=sk-xxxx \\\n -e ACCESS_CODE=lobe66 \\\n --name lobe-chat \\\n lobehub/lobe-chat\n```\n\n> \\[!TIP]\n>\n> If you need to use the OpenAI service through a proxy, you can configure the proxy address using the `OPENAI_PROXY_URL` environment variable:\n\n```fish\n$ docker run -d -p 3210:3210 \\\n -e OPENAI_API_KEY=sk-xxxx \\\n -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \\\n -e ACCESS_CODE=lobe66 \\\n --name lobe-chat \\\n lobehub/lobe-chat\n```\n\n> \\[!NOTE]\n>\n> For detailed instructions on deploying with Docker, please refer to the [📘 Docker Deployment Guide][docs-docker]\n\n<br/>\n\n### Environment Variable\n\nThis project provides some additional configuration items set with environment variables:\n\n| Environment Variable | Required | Description | Example |\n| -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |\n| `OPENAI_API_KEY` | Yes | This is the API key you apply on the OpenAI account page | `sk-xxxxxx...xxxxxx` |\n| `OPENAI_PROXY_URL` | No | If you manually configure the OpenAI interface proxy, you can use this configuration item to override the default OpenAI API request base URL | `https://api.chatanywhere.cn` or `https://aihubmix.com/v1` <br/>The default value is<br/>`https://api.openai.com/v1` |\n| `ACCESS_CODE` | No | Add a password to access this service; you can set a long password to avoid leaking. If this value contains a comma, it is a password array. | `awCTe)re_r74` or `rtrt_ewee3@09!` or `code1,code2,code3` |\n| `OPENAI_MODEL_LIST` | No | Used to control the model list. Use `+` to add a model, `-` to hide a model, and `model_name=display_name` to customize the display name of a model, separated by commas. | `qwen-7b-chat,+glm-6b,-gpt-3.5-turbo` |\n\n> \\[!NOTE]\n>\n> The complete list of environment variables can be found in the [📘 Environment Variables][docs-env-var]\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## 📦 Ecosystem\n\n| NPM | Repository | Description | Version |\n| --------------------------------- | --------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------- |\n| [@lobehub/ui][lobe-ui-link] | [lobehub/lobe-ui][lobe-ui-github] | Open-source UI component library dedicated to building AIGC web applications. | [![][lobe-ui-shield]][lobe-ui-link] |\n| [@lobehub/icons][lobe-icons-link] | [lobehub/lobe-icons][lobe-icons-github] | Popular AI / LLM Model Brand SVG Logo and Icon Collection. | [![][lobe-icons-shield]][lobe-icons-link] |\n| [@lobehub/tts][lobe-tts-link] | [lobehub/lobe-tts][lobe-tts-github] | High-quality & reliable TTS/STT React Hooks library | [![][lobe-tts-shield]][lobe-tts-link] |\n| [@lobehub/lint][lobe-lint-link] | [lobehub/lobe-lint][lobe-lint-github] | Configurations for ESlint, Stylelint, Commitlint, Prettier, Remark, and Semantic Release for LobeHub. | [![][lobe-lint-shield]][lobe-lint-link] |\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## 🧩 Plugins\n\nPlugins provide a means to extend the [Function Calling][docs-functionc-call] capabilities of LobeChat. They can be used to introduce new function calls and even new ways to render message results. If you are interested in plugin development, please refer to our [📘 Plugin Development Guide][docs-plugin-dev] in the Wiki.\n\n- [lobe-chat-plugins][lobe-chat-plugins]: This is the plugin index for LobeChat. It accesses index.json from this repository to display a list of available plugins for LobeChat to the user.\n- [chat-plugin-template][chat-plugin-template]: This is the plugin template for LobeChat plugin development.\n- [@lobehub/chat-plugin-sdk][chat-plugin-sdk]: The LobeChat Plugin SDK assists you in creating exceptional chat plugins for Lobe Chat.\n- [@lobehub/chat-plugins-gateway][chat-plugins-gateway]: The LobeChat Plugins Gateway is a backend service that provides a gateway for LobeChat plugins. We deploy this service using Vercel. The primary API POST /api/v1/runner is deployed as an Edge Function.\n\n> \\[!NOTE]\n>\n> The plugin system is currently undergoing major development. You can learn more in the following issues:\n>\n> - [x] [**Plugin Phase 1**](https://github.com/lobehub/lobe-chat/issues/73): Implement separation of the plugin from the main body, split the plugin into an independent repository for maintenance, and realize dynamic loading of the plugin.\n> - [x] [**Plugin Phase 2**](https://github.com/lobehub/lobe-chat/issues/97): The security and stability of the plugin's use, more accurately presenting abnormal states, the maintainability of the plugin architecture, and developer-friendly.\n> - [x] [**Plugin Phase 3**](https://github.com/lobehub/lobe-chat/issues/149): Higher-level and more comprehensive customization capabilities, support for plugin authentication, and examples.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## ⌨️ Local Development\n\nYou can use GitHub Codespaces for online development:\n\n[![][codespaces-shield]][codespaces-link]\n\nOr clone it for local development:\n\n```fish\n$ git clone https://github.com/lobehub/lobe-chat.git\n$ cd lobe-chat\n$ pnpm install\n$ pnpm dev\n```\n\nIf you would like to learn more details, please feel free to look at our [📘 Development Guide][docs-dev-guide].\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## 🤝 Contributing\n\nContributions 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.\n\n> \\[!TIP]\n>\n> We are creating a technology-driven forum, fostering knowledge interaction and the exchange of ideas that may culminate in mutual inspiration and collaborative innovation.\n>\n> Help us make LobeChat better. Welcome to provide product design feedback, user experience discussions directly to us.\n>\n> **Principal Maintainers:** [@arvinxx](https://github.com/arvinxx) [@canisminor1990](https://github.com/canisminor1990)\n\n[![][pr-welcome-shield]][pr-welcome-link]\n[![][submit-agents-shield]][submit-agents-link]\n[![][submit-plugin-shield]][submit-plugin-link]\n\n<a href=\"https://github.com/lobehub/lobe-chat/graphs/contributors\" target=\"_blank\">\n <table>\n <tr>\n <th colspan=\"2\">\n <br><img src=\"https://contrib.rocks/image?repo=lobehub/lobe-chat\"><br><br>\n </th>\n </tr>\n <tr>\n <td>\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://next.ossinsight.io/widgets/official/compose-org-active-contributors/thumbnail.png?activity=active&period=past_28_days&owner_id=131470832&repo_ids=643445235&image_size=2x3&color_scheme=dark\">\n <img src=\"https://next.ossinsight.io/widgets/official/compose-org-active-contributors/thumbnail.png?activity=active&period=past_28_days&owner_id=131470832&repo_ids=643445235&image_size=2x3&color_scheme=light\">\n </picture>\n </td>\n <td rowspan=\"2\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://next.ossinsight.io/widgets/official/compose-org-participants-growth/thumbnail.png?activity=active&period=past_28_days&owner_id=131470832&repo_ids=643445235&image_size=4x7&color_scheme=dark\">\n <img src=\"https://next.ossinsight.io/widgets/official/compose-org-participants-growth/thumbnail.png?activity=active&period=past_28_days&owner_id=131470832&repo_ids=643445235&image_size=4x7&color_scheme=light\">\n </picture>\n </td>\n </tr>\n <tr>\n <td>\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://next.ossinsight.io/widgets/official/compose-org-active-contributors/thumbnail.png?activity=new&period=past_28_days&owner_id=131470832&repo_ids=643445235&image_size=2x3&color_scheme=dark\">\n <img src=\"https://next.ossinsight.io/widgets/official/compose-org-active-contributors/thumbnail.png?activity=new&period=past_28_days&owner_id=131470832&repo_ids=643445235&image_size=2x3&color_scheme=light\">\n </picture>\n </td>\n </tr>\n </table>\n</a>\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## ❤️ Sponsor\n\nEvery bit counts and your one-time donation sparkles in our galaxy of support! You're a shooting star, making a swift and bright impact on our journey. Thank you for believing in us – your generosity guides us toward our mission, one brilliant flash at a time.\n\n<a href=\"https://opencollective.com/lobehub\" target=\"_blank\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/lobehub/.github/blob/main/static/sponsor-dark.png?raw=true\">\n <img src=\"https://github.com/lobehub/.github/blob/main/static/sponsor-light.png?raw=true\">\n </picture>\n</a>\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n## 🔗 More Products\n\n- **[🅰️ Lobe SD Theme][lobe-theme]:** Modern theme for Stable Diffusion WebUI, exquisite interface design, highly customizable UI, and efficiency-boosting features.\n- **[⛵️ Lobe Midjourney WebUI][lobe-midjourney-webui]:** WebUI for Midjourney, leverages AI to quickly generate a wide array of rich and diverse images from text prompts, sparking creativity and enhancing conversations.\n- **[🌏 Lobe i18n][lobe-i18n] :** Lobe i18n is an automation tool for the i18n (internationalization) translation process, powered by ChatGPT. It supports features such as automatic splitting of large files, incremental updates, and customization options for the OpenAI model, API proxy, and temperature.\n- **[💌 Lobe Commit][lobe-commit]:** Lobe Commit is a CLI tool that leverages Langchain/ChatGPT to generate Gitmoji-based commit messages.\n\n<div align=\"right\">\n\n[![][back-to-top]](#readme-top)\n\n</div>\n\n---\n\n<details><summary><h4>📝 License</h4></summary>\n\n[![][fossa-license-shield]][fossa-license-link]\n\n</details>\n\nCopyright © 2024 [LobeHub][profile-link]. <br />\nThis project is [Apache 2.0](./LICENSE) licensed.\n\n<!-- LINK GROUP -->\n\n[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square\n[blog]: https://lobehub.com/blog\n[chat-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/desktop/pagespeed.svg\n[chat-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/desktop/chat_preview_lobehub_com_chat.html\n[chat-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/mobile/pagespeed.svg\n[chat-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/mobile/chat_preview_lobehub_com_chat.html\n[chat-plugin-sdk]: https://github.com/lobehub/chat-plugin-sdk\n[chat-plugin-template]: https://github.com/lobehub/chat-plugin-template\n[chat-plugins-gateway]: https://github.com/lobehub/chat-plugins-gateway\n[codecov-link]: https://codecov.io/gh/lobehub/lobe-chat\n[codecov-shield]: https://img.shields.io/codecov/c/github/lobehub/lobe-chat?labelColor=black&style=flat-square&logo=codecov&logoColor=white\n[codespaces-link]: https://codespaces.new/lobehub/lobe-chat\n[codespaces-shield]: https://github.com/codespaces/badge.svg\n[deploy-button-image]: https://vercel.com/button\n[deploy-link]: https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat&env=OPENAI_API_KEY,ACCESS_CODE&envDescription=Find%20your%20OpenAI%20API%20Key%20by%20click%20the%20right%20Learn%20More%20button.%20%7C%20Access%20Code%20can%20protect%20your%20website&envLink=https%3A%2F%2Fplatform.openai.com%2Faccount%2Fapi-keys&project-name=lobe-chat&repository-name=lobe-chat\n[deploy-on-alibaba-cloud-button-image]: https://service-info-public.oss-cn-hangzhou.aliyuncs.com/computenest-en.svg\n[deploy-on-alibaba-cloud-link]: https://computenest.console.aliyun.com/service/instance/create/default?type=user&ServiceName=LobeChat%E7%A4%BE%E5%8C%BA%E7%89%88\n[deploy-on-repocloud-button-image]: https://d16t0pc4846x52.cloudfront.net/deploylobe.svg\n[deploy-on-repocloud-link]: https://repocloud.io/details/?app_id=248\n[deploy-on-sealos-button-image]: https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg\n[deploy-on-sealos-link]: https://cloud.sealos.io/?openapp=system-template%3FtemplateName%3Dlobe-chat\n[deploy-on-zeabur-button-image]: https://zeabur.com/button.svg\n[deploy-on-zeabur-link]: https://zeabur.com/templates/VZGGTI\n[discord-link]: https://discord.gg/AYFPHvv2jT\n[discord-shield]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=flat-square\n[discord-shield-badge]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=for-the-badge\n[docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat\n[docker-pulls-shield]: https://img.shields.io/docker/pulls/lobehub/lobe-chat?color=45cc11&labelColor=black&style=flat-square\n[docker-release-link]: https://hub.docker.com/r/lobehub/lobe-chat\n[docker-release-shield]: https://img.shields.io/docker/v/lobehub/lobe-chat?color=369eff&label=docker&labelColor=black&logo=docker&logoColor=white&style=flat-square\n[docker-size-link]: https://hub.docker.com/r/lobehub/lobe-chat\n[docker-size-shield]: https://img.shields.io/docker/image-size/lobehub/lobe-chat?color=369eff&labelColor=black&style=flat-square\n[docs]: https://lobehub.com/docs/usage/start\n[docs-dev-guide]: https://github.com/lobehub/lobe-chat/wiki/index\n[docs-docker]: https://lobehub.com/docs/self-hosting/platform/docker\n[docs-env-var]: https://lobehub.com/docs/self-hosting/environment-variables\n[docs-feat-agent]: https://lobehub.com/docs/usage/features/agent-market\n[docs-feat-auth]: https://lobehub.com/docs/usage/features/auth\n[docs-feat-database]: https://lobehub.com/docs/usage/features/database\n[docs-feat-knowledgebase]: https://lobehub.com/blog/knowledge-base\n[docs-feat-local]: https://lobehub.com/docs/usage/features/local-llm\n[docs-feat-mobile]: https://lobehub.com/docs/usage/features/mobile\n[docs-feat-plugin]: https://lobehub.com/docs/usage/features/plugin-system\n[docs-feat-provider]: https://lobehub.com/docs/usage/features/multi-ai-providers\n[docs-feat-pwa]: https://lobehub.com/docs/usage/features/pwa\n[docs-feat-t2i]: https://lobehub.com/docs/usage/features/text-to-image\n[docs-feat-theme]: https://lobehub.com/docs/usage/features/theme\n[docs-feat-tts]: https://lobehub.com/docs/usage/features/tts\n[docs-feat-vision]: https://lobehub.com/docs/usage/features/vision\n[docs-functionc-call]: https://lobehub.com/blog/openai-function-call\n[docs-lighthouse]: https://github.com/lobehub/lobe-chat/wiki/Lighthouse\n[docs-plugin-dev]: https://lobehub.com/docs/usage/plugins/development\n[docs-self-hosting]: https://lobehub.com/docs/self-hosting/start\n[docs-upstream-sync]: https://lobehub.com/docs/self-hosting/advanced/upstream-sync\n[docs-usage-ollama]: https://lobehub.com/docs/usage/providers/ollama\n[docs-usage-plugin]: https://lobehub.com/docs/usage/plugins/basic\n[fossa-license-link]: https://app.fossa.com/projects/git%2Bgithub.com%2Flobehub%2Flobe-chat\n[fossa-license-shield]: https://app.fossa.com/api/projects/git%2Bgithub.com%2Flobehub%2Flobe-chat.svg?type=large\n[github-action-release-link]: https://github.com/actions/workflows/lobehub/lobe-chat/release.yml\n[github-action-release-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/lobe-chat/release.yml?label=release&labelColor=black&logo=githubactions&logoColor=white&style=flat-square\n[github-action-test-link]: https://github.com/actions/workflows/lobehub/lobe-chat/test.yml\n[github-action-test-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/lobe-chat/test.yml?label=test&labelColor=black&logo=githubactions&logoColor=white&style=flat-square\n[github-contributors-link]: https://github.com/lobehub/lobe-chat/graphs/contributors\n[github-contributors-shield]: https://img.shields.io/github/contributors/lobehub/lobe-chat?color=c4f042&labelColor=black&style=flat-square\n[github-forks-link]: https://github.com/lobehub/lobe-chat/network/members\n[github-forks-shield]: https://img.shields.io/github/forks/lobehub/lobe-chat?color=8ae8ff&labelColor=black&style=flat-square\n[github-issues-link]: https://github.com/lobehub/lobe-chat/issues\n[github-issues-shield]: https://img.shields.io/github/issues/lobehub/lobe-chat?color=ff80eb&labelColor=black&style=flat-square\n[github-license-link]: https://github.com/lobehub/lobe-chat/blob/main/LICENSE\n[github-license-shield]: https://img.shields.io/badge/license-apache%202.0-white?labelColor=black&style=flat-square\n[github-project-link]: https://github.com/lobehub/lobe-chat/projects\n[github-release-link]: https://github.com/lobehub/lobe-chat/releases\n[github-release-shield]: https://img.shields.io/github/v/release/lobehub/lobe-chat?color=369eff&labelColor=black&logo=github&style=flat-square\n[github-releasedate-link]: https://github.com/lobehub/lobe-chat/releases\n[github-releasedate-shield]: https://img.shields.io/github/release-date/lobehub/lobe-chat?labelColor=black&style=flat-square\n[github-stars-link]: https://github.com/lobehub/lobe-chat/network/stargazers\n[github-stars-shield]: https://img.shields.io/github/stars/lobehub/lobe-chat?color=ffcb47&labelColor=black&style=flat-square\n[github-trending-shield]: https://trendshift.io/api/badge/repositories/2256\n[github-trending-url]: https://trendshift.io/repositories/2256\n[image-banner]: https://github.com/lobehub/lobe-chat/assets/28616219/9f155dff-4737-429f-9cad-a70a1a860c5f\n[image-feat-agent]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670869-f1ffbf66-42b6-42cf-a937-9ce1f8328514.png\n[image-feat-auth]: https://github.com/lobehub/lobe-chat/assets/17870709/8ce70e15-40df-451e-b700-66090fe5b8c2\n[image-feat-database]: https://github.com/lobehub/lobe-chat/assets/17870709/c27a0234-a4e9-40e5-8bcb-42d5ce7e40f9\n[image-feat-knowledgebase]: https://github.com/user-attachments/assets/77e58e1c-c82f-4341-b159-f4eeede9967f\n[image-feat-local]: https://github.com/lobehub/lobe-chat/assets/28616219/ca9a21bc-ea6c-4c90-bf4a-fa53b4fb2b5c\n[image-feat-mobile]: https://gw.alipayobjects.com/zos/kitchen/R441AuFS4W/mobile.webp\n[image-feat-plugin]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670883-33c43a5c-a512-467e-855c-fa299548cce5.png\n[image-feat-privoder]: https://github.com/lobehub/lobe-chat/assets/28616219/b164bc54-8ba2-4c1e-b2f2-f4d7f7e7a551\n[image-feat-pwa]: https://gw.alipayobjects.com/zos/kitchen/69x6bllkX3/pwa.webp\n[image-feat-t2i]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/297746445-0ff762b9-aa08-4337-afb7-12f932b6efbb.png\n[image-feat-theme]: https://gw.alipayobjects.com/zos/kitchen/pvus1lo%26Z7/darkmode.webp\n[image-feat-tts]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072124-c9853d8d-f1b5-44a8-a305-45ebc0f6d19a.png\n[image-feat-vision]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072129-382bdf30-e3d6-4411-b5a0-249710b8ba08.png\n[image-overview]: https://github.com/lobehub/lobe-chat/assets/17870709/56b95d48-f573-41cd-8b38-387bf88bc4bf\n[image-star]: https://github.com/lobehub/lobe-chat/assets/17870709/cb06b748-513f-47c2-8740-d876858d7855\n[issues-link]: https://img.shields.io/github/issues/lobehub/lobe-chat.svg?style=flat\n[lobe-chat-plugins]: https://github.com/lobehub/lobe-chat-plugins\n[lobe-commit]: https://github.com/lobehub/lobe-commit/tree/master/packages/lobe-commit\n[lobe-i18n]: https://github.com/lobehub/lobe-commit/tree/master/packages/lobe-i18n\n[lobe-icons-github]: https://github.com/lobehub/lobe-icons\n[lobe-icons-link]: https://www.npmjs.com/package/@lobehub/icons\n[lobe-icons-shield]: https://img.shields.io/npm/v/@lobehub/icons?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square\n[lobe-lint-github]: https://github.com/lobehub/lobe-lint\n[lobe-lint-link]: https://www.npmjs.com/package/@lobehub/lint\n[lobe-lint-shield]: https://img.shields.io/npm/v/@lobehub/lint?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square\n[lobe-midjourney-webui]: https://github.com/lobehub/lobe-midjourney-webui\n[lobe-theme]: https://github.com/lobehub/sd-webui-lobe-theme\n[lobe-tts-github]: https://github.com/lobehub/lobe-tts\n[lobe-tts-link]: https://www.npmjs.com/package/@lobehub/tts\n[lobe-tts-shield]: https://img.shields.io/npm/v/@lobehub/tts?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square\n[lobe-ui-github]: https://github.com/lobehub/lobe-ui\n[lobe-ui-link]: https://www.npmjs.com/package/@lobehub/ui\n[lobe-ui-shield]: https://img.shields.io/npm/v/@lobehub/ui?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square\n[official-site]: https://lobehub.com\n[pr-welcome-link]: https://github.com/lobehub/lobe-chat/pulls\n[pr-welcome-shield]: https://img.shields.io/badge/🤯_pr_welcome-%E2%86%92-ffcb47?labelColor=black&style=for-the-badge\n[profile-link]: https://github.com/lobehub\n[share-linkedin-link]: https://linkedin.com/feed\n[share-linkedin-shield]: https://img.shields.io/badge/-share%20on%20linkedin-black?labelColor=black&logo=linkedin&logoColor=white&style=flat-square\n[share-mastodon-link]: https://mastodon.social/share?text=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source,%20extensible%20(Function%20Calling),%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT/LLM%20web%20application.%20https://github.com/lobehub/lobe-chat%20#chatbot%20#chatGPT%20#openAI\n[share-mastodon-shield]: https://img.shields.io/badge/-share%20on%20mastodon-black?labelColor=black&logo=mastodon&logoColor=white&style=flat-square\n[share-reddit-link]: https://www.reddit.com/submit?title=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source%2C%20extensible%20%28Function%20Calling%29%2C%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT%2FLLM%20web%20application.%20%23chatbot%20%23chatGPT%20%23openAI&url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat\n[share-reddit-shield]: https://img.shields.io/badge/-share%20on%20reddit-black?labelColor=black&logo=reddit&logoColor=white&style=flat-square\n[share-telegram-link]: https://t.me/share/url\"?text=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source%2C%20extensible%20%28Function%20Calling%29%2C%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT%2FLLM%20web%20application.%20%23chatbot%20%23chatGPT%20%23openAI&url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat\n[share-telegram-shield]: https://img.shields.io/badge/-share%20on%20telegram-black?labelColor=black&logo=telegram&logoColor=white&style=flat-square\n[share-weibo-link]: http://service.weibo.com/share/share.php?sharesource=weibo&title=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source%2C%20extensible%20%28Function%20Calling%29%2C%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT%2FLLM%20web%20application.%20%23chatbot%20%23chatGPT%20%23openAI&url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat\n[share-weibo-shield]: https://img.shields.io/badge/-share%20on%20weibo-black?labelColor=black&logo=sinaweibo&logoColor=white&style=flat-square\n[share-whatsapp-link]: https://api.whatsapp.com/send?text=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source%2C%20extensible%20%28Function%20Calling%29%2C%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT%2FLLM%20web%20application.%20https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat%20%23chatbot%20%23chatGPT%20%23openAI\n[share-whatsapp-shield]: https://img.shields.io/badge/-share%20on%20whatsapp-black?labelColor=black&logo=whatsapp&logoColor=white&style=flat-square\n[share-x-link]: https://x.com/intent/tweet?hashtags=chatbot%2CchatGPT%2CopenAI&text=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source%2C%20extensible%20%28Function%20Calling%29%2C%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT%2FLLM%20web%20application.&url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat\n[share-x-shield]: https://img.shields.io/badge/-share%20on%20x-black?labelColor=black&logo=x&logoColor=white&style=flat-square\n[sponsor-link]: https://opencollective.com/lobehub 'Become ❤️ LobeHub Sponsor'\n[sponsor-shield]: https://img.shields.io/badge/-Sponsor%20LobeHub-f04f88?logo=opencollective&logoColor=white&style=flat-square\n[submit-agents-link]: https://github.com/lobehub/lobe-chat-agents\n[submit-agents-shield]: https://img.shields.io/badge/🤖/🏪_submit_agent-%E2%86%92-c4f042?labelColor=black&style=for-the-badge\n[submit-plugin-link]: https://github.com/lobehub/lobe-chat-plugins\n[submit-plugin-shield]: https://img.shields.io/badge/🧩/🏪_submit_plugin-%E2%86%92-95f3d9?labelColor=black&style=for-the-badge\n[vercel-link]: https://chat-preview.lobehub.com\n[vercel-shield]: https://img.shields.io/badge/vercel-online-55b467?labelColor=black&logo=vercel&style=flat-square\n[vercel-shield-badge]: https://img.shields.io/badge/TRY%20LOBECHAT-ONLINE-55b467?labelColor=black&logo=vercel&style=for-the-badge\n"}}, "src/libs/agent-runtime/ai360/index.test.ts": {"28cb547bb4f97b3dcc5cd39eab09bc5e065c57bc": {"t": 1785809836.5267916, "n": 7744, "h": "0a90fc2c380d8604", "c": "// @vitest-environment node\nimport OpenAI from 'openai';\nimport { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';\n\nimport {\n ChatStreamCallbacks,\n LobeOpenAICompatibleRuntime,\n ModelProvider,\n} from '@/libs/agent-runtime';\n\nimport * as debugStreamModule from '../utils/debugStream';\nimport { LobeAi360AI } from './index';\n\nconst provider = ModelProvider.Ai360;\nconst defaultBaseURL = 'https://ai.360.cn/v1';\n\nconst bizErrorType = 'ProviderBizError';\nconst invalidErrorType = 'InvalidProviderAPIKey';\n\n// Mock the console.error to avoid polluting test output\nvi.spyOn(console, 'error').mockImplementation(() => {});\n\nlet instance: LobeOpenAICompatibleRuntime;\n\nbeforeEach(() => {\n instance = new LobeAi360AI({ apiKey: 'test' });\n\n // 使用 vi.spyOn 来模拟 chat.completions.create 方法\n vi.spyOn(instance['client'].chat.completions, 'create').mockResolvedValue(\n new ReadableStream() as any,\n );\n});\n\nafterEach(() => {\n vi.clearAllMocks();\n});\n\ndescribe('LobeAi360AI', () => {\n describe('init', () => {\n it('should correctly initialize with an API key', async () => {\n const instance = new LobeAi360AI({ apiKey: 'test_api_key' });\n expect(instance).toBeInstanceOf(LobeAi360AI);\n expect(instance.baseURL).toEqual(defaultBaseURL);\n });\n });\n\n describe('chat', () => {\n describe('Error', () => {\n it('should return OpenAIBizError with an openai error response when OpenAI.APIError is thrown', async () => {\n // Arrange\n const apiError = new OpenAI.APIError(\n 400,\n {\n status: 400,\n error: {\n message: 'Bad Request',\n },\n },\n 'Error message',\n {},\n );\n\n vi.spyOn(instance['client'].chat.completions, 'create').mockRejectedValue(apiError);\n\n // Act\n try {\n await instance.chat({\n messages: [{ content: 'Hello', role: 'user' }],\n model: '360gpt-turbo',\n temperature: 0,\n });\n } catch (e) {\n expect(e).toEqual({\n endpoint: defaultBaseURL,\n error: {\n error: { message: 'Bad Request' },\n status: 400,\n },\n errorType: bizErrorType,\n provider,\n });\n }\n });\n\n it('should throw AgentRuntimeError with NoOpenAIAPIKey if no apiKey is provided', async () => {\n try {\n new LobeAi360AI({});\n } catch (e) {\n expect(e).toEqual({ errorType: invalidErrorType });\n }\n });\n\n it('should return OpenAIBizError with the cause when OpenAI.APIError is thrown with cause', async () => {\n // Arrange\n const errorInfo = {\n stack: 'abc',\n cause: {\n message: 'api is undefined',\n },\n };\n const apiError = new OpenAI.APIError(400, errorInfo, 'module error', {});\n\n vi.spyOn(instance['client'].chat.completions, 'create').mockRejectedValue(apiError);\n\n // Act\n try {\n await instance.chat({\n messages: [{ content: 'Hello', role: 'user' }],\n model: '360gpt-turbo',\n temperature: 0,\n });\n } catch (e) {\n expect(e).toEqual({\n endpoint: defaultBaseURL,\n error: {\n cause: { message: 'api is undefined' },\n stack: 'abc',\n },\n errorType: bizErrorType,\n provider,\n });\n }\n });\n\n it('should return OpenAIBizError with an cause response with desensitize Url', async () => {\n // Arrange\n const errorInfo = {\n stack: 'abc',\n cause: { message: 'api is undefined' },\n };\n const apiError = new OpenAI.APIError(400, errorInfo, 'module error', {});\n\n instance = new LobeAi360AI({\n apiKey: 'test',\n\n baseURL: 'https://api.abc.com/v1',\n });\n\n vi.spyOn(instance['client'].chat.completions, 'create').mockRejectedValue(apiError);\n\n // Act\n try {\n await instance.chat({\n messages: [{ content: 'Hello', role: 'user' }],\n model: '360gpt-turbo',\n temperature: 0,\n });\n } catch (e) {\n expect(e).toEqual({\n endpoint: 'https://api.***.com/v1',\n error: {\n cause: { message: 'api is undefined' },\n stack: 'abc',\n },\n errorType: bizErrorType,\n provider,\n });\n }\n });\n\n it('should throw an InvalidAi360APIKey error type on 401 status code', async () => {\n // Mock the API call to simulate a 401 error\n const error = new Error('Unauthorized') as any;\n error.status = 401;\n vi.mocked(instance['client'].chat.completions.create).mockRejectedValue(error);\n\n try {\n await instance.chat({\n messages: [{ content: 'Hello', role: 'user' }],\n model: '360gpt-turbo',\n temperature: 0,\n });\n } catch (e) {\n // Expect the chat method to throw an error with InvalidAi360APIKey\n expect(e).toEqual({\n endpoint: defaultBaseURL,\n error: new Error('Unauthorized'),\n errorType: invalidErrorType,\n provider,\n });\n }\n });\n\n it('should return AgentRuntimeError for non-OpenAI errors', async () => {\n // Arrange\n const genericError = new Error('Generic Error');\n\n vi.spyOn(instance['client'].chat.completions, 'create').mockRejectedValue(genericError);\n\n // Act\n try {\n await instance.chat({\n messages: [{ content: 'Hello', role: 'user' }],\n model: '360gpt-turbo',\n temperature: 0,\n });\n } catch (e) {\n expect(e).toEqual({\n endpoint: defaultBaseURL,\n errorType: 'AgentRuntimeError',\n provider,\n error: {\n name: genericError.name,\n cause: genericError.cause,\n message: genericError.message,\n stack: genericError.stack,\n },\n });\n }\n });\n });\n\n describe('DEBUG', () => {\n it('should call debugStream and return StreamingTextResponse when DEBUG_AI360_CHAT_COMPLETION is 1', async () => {\n // Arrange\n const mockProdStream = new ReadableStream() as any; // 模拟的 prod 流\n const mockDebugStream = new ReadableStream({\n start(controller) {\n controller.enqueue('Debug stream content');\n controller.close();\n },\n }) as any;\n mockDebugStream.toReadableStream = () => mockDebugStream; // 添加 toReadableStream 方法\n\n // 模拟 chat.completions.create 返回值,包括模拟的 tee 方法\n (instance['client'].chat.completions.create as Mock).mockResolvedValue({\n tee: () => [mockProdStream, { toReadableStream: () => mockDebugStream }],\n });\n\n // 保存原始环境变量值\n const originalDebugValue = process.env.DEBUG_AI360_CHAT_COMPLETION;\n\n // 模拟环境变量\n process.env.DEBUG_AI360_CHAT_COMPLETION = '1';\n vi.spyOn(debugStreamModule, 'debugStream').mockImplementation(() => Promise.resolve());\n\n // 执行测试\n // 运行你的测试函数,确保它会在条件满足时调用 debugStream\n // 假设的测试函数调用,你可能需要根据实际情况调整\n await instance.chat({\n messages: [{ content: 'Hello', role: 'user' }],\n model: '360gpt-turbo',\n stream: true,\n temperature: 0,\n });\n\n // 验证 debugStream 被调用\n expect(debugStreamModule.debugStream).toHaveBeenCalled();\n\n // 恢复原始环境变量值\n process.env.DEBUG_AI360_CHAT_COMPLETION = originalDebugValue;\n });\n });\n });\n});\n"}}, "src/libs/agent-runtime/sensenova/index.ts": {"28cb547bb4f97b3dcc5cd39eab09bc5e065c57bc": {"t": 1785809865.368832, "n": 3303, "h": "ed19bd85f7450e4a", "c": "import OpenAI, { ClientOptions } from 'openai';\n\nimport { LobeRuntimeAI } from '../BaseAI';\nimport { AgentRuntimeErrorType } from '../error';\nimport { ChatCompetitionOptions, ChatStreamPayload, ModelProvider } from '../types';\nimport { AgentRuntimeError } from '../utils/createError';\nimport { debugStream } from '../utils/debugStream';\nimport { desensitizeUrl } from '../utils/desensitizeUrl';\nimport { handleOpenAIError } from '../utils/handleOpenAIError';\nimport { convertOpenAIMessages } from '../utils/openaiHelpers';\nimport { StreamingResponse } from '../utils/response';\nimport { OpenAIStream } from '../utils/streams';\nimport { generateApiToken } from './authToken';\n\nconst DEFAULT_BASE_URL = 'https://api.sensenova.cn/compatible-mode/v1';\n\nexport class LobeSenseNovaAI implements LobeRuntimeAI {\n private client: OpenAI;\n\n baseURL: string;\n\n constructor(oai: OpenAI) {\n this.client = oai;\n this.baseURL = this.client.baseURL;\n }\n\n static async fromAPIKey({ apiKey, baseURL = DEFAULT_BASE_URL, ...res }: ClientOptions = {}) {\n const invalidSenseNovaAPIKey = AgentRuntimeError.createError(\n AgentRuntimeErrorType.InvalidProviderAPIKey,\n );\n\n if (!apiKey) throw invalidSenseNovaAPIKey;\n\n let token: string;\n\n try {\n token = await generateApiToken(apiKey);\n } catch {\n throw invalidSenseNovaAPIKey;\n }\n \n const header = { Authorization: `Bearer ${token}` };\n\n const llm = new OpenAI({ apiKey, baseURL, defaultHeaders: header, ...res });\n\n return new LobeSenseNovaAI(llm);\n }\n\n async chat(payload: ChatStreamPayload, options?: ChatCompetitionOptions) {\n try {\n const params = await this.buildCompletionsParams(payload);\n\n const response = await this.client.chat.completions.create(\n params as unknown as OpenAI.ChatCompletionCreateParamsStreaming,\n );\n\n const [prod, debug] = response.tee();\n\n if (process.env.DEBUG_SENSENOVA_CHAT_COMPLETION === '1') {\n debugStream(debug.toReadableStream()).catch(console.error);\n }\n\n return StreamingResponse(OpenAIStream(prod), {\n headers: options?.headers,\n });\n } catch (error) {\n const { errorResult, RuntimeError } = handleOpenAIError(error);\n\n const errorType = RuntimeError || AgentRuntimeErrorType.ProviderBizError;\n let desensitizedEndpoint = this.baseURL;\n\n if (this.baseURL !== DEFAULT_BASE_URL) {\n desensitizedEndpoint = desensitizeUrl(this.baseURL);\n }\n throw AgentRuntimeError.chat({\n endpoint: desensitizedEndpoint,\n error: errorResult,\n errorType,\n provider: ModelProvider.SenseNova,\n });\n }\n }\n\n private async buildCompletionsParams(payload: ChatStreamPayload) {\n const { frequency_penalty, messages, temperature, top_p, ...params } = payload;\n\n return {\n messages: await convertOpenAIMessages(messages as any),\n ...params,\n frequency_penalty: (frequency_penalty !== undefined && frequency_penalty > 0 && frequency_penalty <= 2) ? frequency_penalty : undefined,\n stream: true,\n temperature: (temperature !== undefined && temperature > 0 && temperature <= 2) ? temperature : undefined,\n top_p: (top_p !== undefined && top_p > 0 && top_p < 1) ? top_p : undefined,\n };\n }\n}\n\nexport default LobeSenseNovaAI;\n"}}}}