mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
feat: uv dependency management
This commit is contained in:
parent
f384a00cb8
commit
6e094ed56d
5 changed files with 3556 additions and 60 deletions
1
main/xiaozhi-server/.python-version
Normal file
1
main/xiaozhi-server/.python-version
Normal file
|
|
@ -0,0 +1 @@
|
|||
3.11
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# Dockerfile for local development and testing
|
||||
# Build xiaozhi-server image from local source code
|
||||
|
||||
FROM python:3.10-slim
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && \
|
||||
|
|
@ -9,31 +9,29 @@ RUN apt-get update && \
|
|||
libopus0 \
|
||||
ffmpeg \
|
||||
build-essential \
|
||||
curl \
|
||||
git && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Configure pip to use Aliyun mirror for faster downloads in China
|
||||
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
|
||||
pip config set global.trusted-host mirrors.aliyun.com && \
|
||||
pip config set global.timeout 120 && \
|
||||
pip config set install.retries 5
|
||||
# Install uv
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /opt/xiaozhi-esp32-server
|
||||
|
||||
# Copy requirements file
|
||||
COPY requirements.txt .
|
||||
# Copy dependency files first (for better layer caching)
|
||||
COPY pyproject.toml uv.lock ./
|
||||
|
||||
# Install Python dependencies
|
||||
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
|
||||
pip install --no-cache-dir -r requirements.txt --default-timeout=120 --retries 5
|
||||
# Install Python dependencies with uv
|
||||
RUN uv sync --frozen --no-dev
|
||||
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
# Set timezone
|
||||
# Set timezone and Python path
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV PATH="/opt/xiaozhi-esp32-server/.venv/bin:$PATH"
|
||||
|
||||
# Expose ports
|
||||
# 8000: WebSocket server
|
||||
|
|
|
|||
91
main/xiaozhi-server/pyproject.toml
Normal file
91
main/xiaozhi-server/pyproject.toml
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
[project]
|
||||
name = "xiaozhi-server"
|
||||
version = "1.0.0"
|
||||
description = "Xiaozhi AI Voice Assistant Server"
|
||||
requires-python = ">=3.11,<3.12"
|
||||
dependencies = [
|
||||
# Core
|
||||
"pyyml==0.0.2",
|
||||
"numpy==1.26.4",
|
||||
"websockets==14.2",
|
||||
"httpx==0.27.2",
|
||||
"aiohttp==3.12.15",
|
||||
"aiohttp_cors==0.7.0",
|
||||
"requests==2.32.5",
|
||||
"ruamel.yaml==0.18.15",
|
||||
"loguru==0.7.3",
|
||||
"python-dotenv>=1.0.0",
|
||||
"aioconsole==0.8.1",
|
||||
"chardet==5.2.0",
|
||||
"psutil==7.0.0",
|
||||
"portalocker==3.2.0",
|
||||
"Jinja2==3.1.6",
|
||||
"PyJWT==2.8.0",
|
||||
"PySocks==1.7.1",
|
||||
"bs4==0.0.2",
|
||||
"ormsgpack==1.11.0",
|
||||
|
||||
# Audio processing
|
||||
"opuslib_next==1.1.2",
|
||||
"pydub==0.25.1",
|
||||
|
||||
# ML/DL frameworks
|
||||
"torch==2.2.2",
|
||||
"torchaudio==2.2.2",
|
||||
|
||||
# VAD
|
||||
"silero_vad==6.0.0",
|
||||
"funasr==1.2.3",
|
||||
"funasr_onnx==0.4.1",
|
||||
|
||||
# ASR
|
||||
"sherpa_onnx==1.12.11",
|
||||
"vosk==0.3.44",
|
||||
"modelscope==1.23.2",
|
||||
"deepgram-sdk>=3.0.0",
|
||||
|
||||
# LLM
|
||||
"openai==2.5.0",
|
||||
"google-generativeai==0.8.5",
|
||||
"cozepy==0.19.0",
|
||||
"dashscope==1.24.6",
|
||||
|
||||
# TTS
|
||||
"edge_tts==7.0.0",
|
||||
"elevenlabs>=1.11.0",
|
||||
"cartesia>=1.0.0",
|
||||
"fish-audio-sdk>=1.0.0",
|
||||
"baidu-aip==4.16.13",
|
||||
|
||||
# Memory
|
||||
"mem0ai==1.0.0",
|
||||
"memu-py",
|
||||
"redis>=4.0.0,<5.0.0",
|
||||
|
||||
# MCP
|
||||
"mcp==1.13.1",
|
||||
"mcp-proxy==0.8.2",
|
||||
|
||||
# Utilities
|
||||
"cnlunar==0.2.0",
|
||||
"markitdown==0.1.3",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest>=7.0.0",
|
||||
"pytest-asyncio>=0.21.0",
|
||||
"librosa>=0.10.0",
|
||||
"soundfile>=0.12.0",
|
||||
]
|
||||
|
||||
# No build-system needed - this is an application, not a library
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"pytest>=7.0.0",
|
||||
"pytest-asyncio>=0.21.0",
|
||||
"librosa>=0.10.0",
|
||||
"soundfile>=0.12.0",
|
||||
]
|
||||
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
pyyml==0.0.2
|
||||
torch==2.2.2
|
||||
silero_vad==6.0.0
|
||||
websockets==14.2
|
||||
opuslib_next==1.1.2
|
||||
numpy==1.26.4
|
||||
pydub==0.25.1
|
||||
funasr==1.2.3
|
||||
torchaudio==2.2.2
|
||||
openai==2.5.0
|
||||
google-generativeai==0.8.5
|
||||
edge_tts==7.0.0
|
||||
httpx==0.27.2
|
||||
aiohttp==3.12.15
|
||||
aiohttp_cors==0.7.0
|
||||
ormsgpack==1.11.0
|
||||
ruamel.yaml==0.18.15
|
||||
loguru==0.7.3
|
||||
requests==2.32.5
|
||||
cozepy==0.19.0
|
||||
mem0ai==1.0.0
|
||||
memu-py
|
||||
bs4==0.0.2
|
||||
modelscope==1.23.2
|
||||
sherpa_onnx==1.12.11
|
||||
mcp==1.13.1
|
||||
cnlunar==0.2.0
|
||||
PySocks==1.7.1
|
||||
dashscope==1.24.6
|
||||
baidu-aip==4.16.13
|
||||
chardet==5.2.0
|
||||
aioconsole==0.8.1
|
||||
markitdown==0.1.3
|
||||
mcp-proxy==0.8.2
|
||||
PyJWT==2.8.0
|
||||
psutil==7.0.0
|
||||
portalocker==3.2.0
|
||||
Jinja2==3.1.6
|
||||
vosk==0.3.44
|
||||
|
||||
redis>=4.0.0,<5.0.0
|
||||
|
||||
elevenlabs>=1.11.0
|
||||
cartesia>=1.0.0
|
||||
deepgram-sdk>=3.0.0
|
||||
fish-audio-sdk>=1.0.0
|
||||
|
||||
python-dotenv>=1.0.0
|
||||
3454
main/xiaozhi-server/uv.lock
Normal file
3454
main/xiaozhi-server/uv.lock
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue