Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加对vllm的支持 #46

Open
wants to merge 39 commits into
base: memory
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
70e8041
去掉大模型输出中的特殊字符
Feb 17, 2025
1269404
去掉大模型输出中的特殊字符
Feb 17, 2025
558d327
Merge branch 'xinnan-tech:main' into main
bo-scnu Feb 17, 2025
d30ae93
添加vllm
Feb 17, 2025
6573559
添加vllm支持
Feb 18, 2025
46b432a
添加vllm支持
Feb 18, 2025
acfd21d
Merge branch 'xinnan-tech:main' into main
bo-scnu Feb 18, 2025
899b5b6
fix: 多种docker build 编译方式
TOM88812 Feb 18, 2025
ce7f9fc
fix:push
TOM88812 Feb 18, 2025
cf8f2f8
优化打包速度 (#65)
kalicyh Feb 18, 2025
55981ec
合并多个更新 (#68)
kalicyh Feb 18, 2025
b82aaf4
minimax语音tts和阿里云智能语音tts适配
HonestQiao Feb 18, 2025
174ab7f
本地模型不重复创建,共用一个 (#51)
Eric0308 Feb 18, 2025
44c7060
🎈 perf: 优化开发体验 (#70)
kalicyh Feb 18, 2025
0cd13dc
Merge pull request #71 from xinnan-tech/dev
xinnan-tech Feb 18, 2025
f6baaeb
Merge pull request #69 from HonestQiao/main
openrz Feb 18, 2025
c56e5f9
Merge pull request #64 from TOM88812/main
openrz Feb 18, 2025
1236063
speedtest1.0
Chris-websketch Feb 19, 2025
91bf9f4
Merge pull request #76 from Chris-websketch/speed-test
openrz Feb 19, 2025
e804ab4
update:优化测试工具使用方法
openrz Feb 19, 2025
eac2852
Merge pull request #80 from xinnan-tech/fix-PerformanceTester
openrz Feb 19, 2025
82d7f34
update:更换群二维码
openrz Feb 19, 2025
68accb7
Merge pull request #85 from xinnan-tech/qrcode
xinnan-tech Feb 19, 2025
25c2073
update:更新正在开发的功能
openrz Feb 19, 2025
b264736
Merge pull request #87 from xinnan-tech/update-readme
xinnan-tech Feb 19, 2025
5264bfd
🎈 perf: 优化开发
kalicyh Feb 20, 2025
de79362
Merge pull request #92 from xinnan-tech/doc
xinnan-tech Feb 20, 2025
afa469c
Home assistant (#97)
xinnan-tech Feb 20, 2025
37ca63d
update:配置docker自动编译 (#112)
xinnan-tech Feb 22, 2025
bdcf5c5
Docker build (#113)
xinnan-tech Feb 22, 2025
cba6ec4
Docker build (#114)
xinnan-tech Feb 22, 2025
f054f66
Docker build (#115)
xinnan-tech Feb 22, 2025
6c3fbd7
Doubao asr (#117)
xinnan-tech Feb 23, 2025
1485783
使用配置文件设置日志参数 (#116)
HonestQiao Feb 23, 2025
3bc0b82
update: 修改了服务组件的性能测试代码 (#111)
Alexisxty Feb 23, 2025
2d01812
Performance test (#118)
xinnan-tech Feb 23, 2025
22ff7a9
fixed:ModuleNotFoundError: No module named 'opuslib' (#121)
xinnan-tech Feb 23, 2025
1226e8b
Fix opuslib (#122)
xinnan-tech Feb 23, 2025
8969329
Merge branch 'main' of https://github.com/bo-scnu/xiaozhi-esp32-serve…
Feb 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Docker Image CI

on:
push:
tags:
- 'v*.*.*' # 只在以 v 开头的标签推送时触发,例如 v1.0.0

jobs:
release:
name: Release Docker image
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
id-token: write
issues: write

steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}

- name: Extract version from tag
id: get_version
run: |
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Build and push Docker image
id: build_push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
ghcr.io/${{ github.repository }}:latest
platforms: linux/amd64,linux/arm64
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Byte-compiled / optimized / DLL files
__pycache__/
.idea/
*.py[cod]
*$py.class

Expand All @@ -9,6 +10,7 @@ __pycache__/
# Distribution / packaging
.Python
build/
data/
develop-eggs/
dist/
downloads/
Expand Down Expand Up @@ -143,4 +145,5 @@ tmp
.config.yaml
.secrets.yaml
.private_config.yaml
.env.development
docker-compose.yml
51 changes: 25 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
# 第一阶段:前端构建
FROM node:18 AS frontend-builder

FROM kalicyh/node:v18-alpine AS frontend-builder

WORKDIR /app/ZhiKongTaiWeb

RUN corepack enable && yarn config set registry https://registry.npmmirror.com
# RUN corepack enable && yarn config set registry https://registry.npmmirror.com

COPY ZhiKongTaiWeb/package.json ZhiKongTaiWeb/yarn.lock ./

RUN mkdir node_modules && yarn install --frozen-lockfile
RUN yarn install --frozen-lockfile

COPY ZhiKongTaiWeb .
RUN yarn build

# 第二阶段:构建 Python 依赖
FROM ccr.ccs.tencentyun.com/kalicyh/poetry:v3.10_latest AS builder
WORKDIR /app
COPY pyproject.toml poetry.lock /app/
RUN poetry install --no-root

# 第三阶段:生产镜像
FROM python:3.10-slim
FROM kalicyh/poetry:v3.10_xiaozhi AS builder

WORKDIR /app

WORKDIR /opt/xiaozhi-esp32-server
# 同时拷贝本地环境.venv
COPY . .
# 检查是否有缺失
RUN poetry install --no-root

# 使用清华源加速apt安装
RUN rm -rf /etc/apt/sources.list.d/* && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --no-install-recommends libopus0 ffmpeg && \
apt-get clean
# 使用清华源加速apt安装,该镜像内置所以注释
# RUN rm -rf /etc/apt/sources.list.d/* && \
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
# apt-get update && \
# apt-get install -y --no-install-recommends libopus0 ffmpeg && \
# apt-get clean

# 从构建阶段复制虚拟环境和前端构建产物
COPY --from=builder /app/.venv /opt/venv
COPY --from=frontend-builder /app/ZhiKongTaiWeb/dist /opt/xiaozhi-esp32-server/manager/static/webui
# 设置虚拟环境路径
ENV PATH="/opt/venv/bin:$PATH"
COPY --from=frontend-builder /app/ZhiKongTaiWeb/dist /app/manager/static/webui

# 复制应用代码
COPY . .
# 设置虚拟环境路径
ENV PATH="/app/.venv/bin:$PATH"

# 启动应用
CMD ["python", "app.py"]
ENTRYPOINT ["poetry", "run", "python"]
CMD ["app.py"]
51 changes: 51 additions & 0 deletions Dockerfile-pip
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# 第一阶段:前端构建
FROM node:18 AS frontend-builder

WORKDIR /app/ZhiKongTaiWeb

# 配置npm使用淘宝源
RUN npm config set registry https://registry.npmmirror.com

COPY ZhiKongTaiWeb/package*.json ./

# 安装axios依赖
RUN npm install axios
RUN npm install

COPY ZhiKongTaiWeb .

RUN npm run build

# 第二阶段:构建Python依赖
FROM python:3.10-slim AS builder

WORKDIR /app

COPY requirements.txt .

# 优化apt安装
RUN pip install --no-cache-dir -r requirements.txt \
-i https://mirrors.aliyun.com/pypi/simple/

# 第三阶段:生产镜像
FROM python:3.10-slim

WORKDIR /opt/xiaozhi-esp32-server

# 优化apt安装
RUN echo "deb https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
echo "deb https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --no-install-recommends libopus0 ffmpeg && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# 从构建阶段复制Python包和前端构建产物
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
COPY --from=frontend-builder /app/ZhiKongTaiWeb/dist /opt/xiaozhi-esp32-server/manager/static/webui

# 复制应用代码
COPY . .

# 启动应用
CMD ["python", "app.py"]
Loading