当前位置: 首页 > news >正文

LibreChat-图文并茂手把手教你搭建自己的AI机器人 Step-by-step guide to building your own chatbot

LibreChat是什么 | About LibreChat

  • LibreChat是一个革命性的人工智能聊天机器人,采用了先进的技术,如OpenAI、GPT-4 Vision、Bing、Anthropic、OpenRouter、Google Gemini等。LibreChat完全开源,支持自托管,为用户提供了极大的灵活性和自定义选项。
  • LibreChat is a revolutionary artificial intelligence chatbot that adopts advanced technologies such as OpenAI, GPT-4 Vision, Bing, Anthropic, OpenRouter, Google Gemini, etc. LibreChat is fully open source and supports self-hosting, providing users with great flexibility and customization options.

📌 使用 npm 本地安装 LibreChat | Install LibreChat Locally Using npm

🔧 前提条件 | Prerequisites

  1. Node.js 18+:

    • 官网下载链接:nodejs.org/en/download
    • Official download: nodejs.org/en/download
  2. Git:

    • 安装指南:git-scm.com/download/
    • Installation guide: git-scm.com/download/
  3. MongoDB (可选) | MongoDB (Optional):

    • 云托管方案 | Cloud-hosted solution
      MongoDB Atlas (cloud.mongodb.com)
    • 本地部署方案 | Self-hosted solution:
      MongoDB Community Server (mongodb.com/try)

🚀 安装流程 | Installation Process

1. 克隆仓库 | Clone Repository

git clone https://github.com/danny-avila/LibreChat.git
cd LibreChat  # 进入项目目录 | Enter project directory

2. 配置文件 | Configure Environment

# Windows 用户用 copy 命令 | Windows users use copy command
cp .env.example .env
  • 配置数据库 | Configure Database:
    .env 文件中设置 MONGO_URI
    Set MONGO_URI in .env file
    示例/Example: mongodb://localhost:27017/LibreChat

3. 安装依赖 | Install Dependencies

npm ci  # 严格依赖安装 | Strict dependency installation

4. 构建前端 | Build Frontend

npm run frontend  # 生成静态资源 | Generate static assets

image

5. 启动服务 | Start Backend

npm run backend  # 运行Node.js服务器 | Run Node.js server

image

6. 访问应用 | Access Application

打开浏览器访问:http://localhost:3080
Open browser at:http://localhost:3080
image
image
image


🔄 更新指南 | Update Guide

  1. 停止服务 | Stop Running Instance
    Ctrl+C 终止进程
    Terminate process with Ctrl+C

  2. 同步最新代码 | Sync Latest Code

    git pull origin main
    
  3. 清理缓存 | Clean Cache

    npm run clean
    
  4. 重建前端 | Rebuild Frontend

    npm run frontend
    
  5. 重启服务 | Restart Service

    npm run backend
    

⚙️ 高级配置 | Advanced Configurations

功能 Function 配置说明 Configuration
向量搜索 Vector Search 需安装Meilisearch Requires Meilisearch setup
自定义API Custom APIs 修改.env的API_ENDPOINT Edit API_ENDPOINT in .env
多模型支持 Multi-Model 配置多个OPENAI_MODELS Configure multiple OPENAI_MODELS
身份验证 Authentication 启用ALLOW_SOCIAL_LOGIN Enable ALLOW_SOCIAL_LOGIN

🛠️ 故障排查 | Troubleshooting

  1. 端口冲突 | Port Conflict

    # 修改端口号 | Change port number
    echo PORT=4000 >> .env
    
  2. 依赖安装失败 | Dependency Failure

    rm -rf node_modules  # 删除依赖 | Remove dependencies
    npm cache clean --force  # 清理缓存 | Clear cache
    npm ci  # 重新安装 | Reinstall
    
  3. MongoDB连接问题 | MongoDB Connection
    检查防火墙是否开放27017端口
    Check firewall for port 27017 access


📚 完整文档资源 | Full Documentation

  • GitHub 仓库:github.com/danny-avila/LibreChat
  • 官方文档站:www.librechat.ai/docs
  • Discord 社区:discord.gg/weRG8K5ned

Conclusion | 结语

  • That's all for today~ - | 今天就写到这里啦~

  • Guys, ( ̄ω ̄( ̄ω ̄〃 ( ̄ω ̄〃)ゝ See you tomorrow~~ | 小伙伴们,( ̄ω ̄( ̄ω ̄〃 ( ̄ω ̄〃)ゝ我们明天再见啦~~

  • Everyone, be happy every day! 大家要天天开心哦

  • Welcome everyone to point out any mistakes in the article~ | 欢迎大家指出文章需要改正之处~

  • Learning has no end; win-win cooperation | 学无止境,合作共赢

  • Welcome all the passers-by, boys and girls, to offer better suggestions! ~~~ | 欢迎路过的小哥哥小姐姐们提出更好的意见哇~~

image

http://www.hskmm.com/?act=detail&tid=27674

相关文章:

  • NOISG 2025 Prelim
  • STM32 教程
  • 先进反应堆:BWRX-300
  • ch58x/ch59x系列芯片Indication添加
  • Lab 4 Challenge - Sum of Proper Elements
  • perl经典hash解决问题
  • LCR 129. 字母迷宫
  • Ignite3 竟然变成分布式数据库了!
  • NUIST 《程序设计基础》 实验1
  • 10.9总结
  • [MIT 6.828] Lab 1 C, Assembly, Tools, and Bootstrapping
  • WCH低功耗蓝牙系列芯片usb烧录故障排查
  • 使用docker构建.net api镜像及nginx反向代理 - binzi
  • 利用sprintf与snprintf巧妙实现数值变量转换为字符串型
  • Helmholtz-Gibbs自由能与熵弹性
  • 日志|电话号码的字母组合|子集|回溯
  • Docker实用篇(初识Docker,Docker的基本操作,Dockerfile自定义镜像,Docker-Compose,Docker镜像仓库) - a
  • ROIR 2023
  • Rust 的验证码图像识别系统设计与实现
  • 【题解】P12992 [GCJ 2022 #1C] Intranets
  • ysyx:pa3.1批处理系统
  • C 语言的验证码图像识别系统实现
  • Nginx典型流控配置示例
  • 基于 C 语言的验证码图像识别系统实现
  • oppoR9m刷Linux系统: 引导知识
  • 操作系统知识点
  • JAVA: Mybatis添加xml执行多行更新语句时报错
  • 安装Docker(CentOS安装Docker,CentOS7安装DockerCompose,Docker镜像仓库) - a
  • 上代码演示下Profile-Guided Optimization (PGO)
  • 所有文档每页的第一行居中对齐