Compare commits

..

11 Commits

Author SHA1 Message Date
17cf7a6a55 update models
All checks were successful
Build, Push and Redeploy Docker Image / build-and-push (push) Successful in 5m18s
2026-02-04 18:59:03 +07:00
a66f257fed fix model id
All checks were successful
Build, Push and Redeploy Docker Image / build-and-push (push) Successful in 5m18s
2026-02-04 05:22:34 +07:00
7a4470ab95 add new model in list
All checks were successful
Build, Push and Redeploy Docker Image / build-and-push (push) Successful in 4m43s
2026-02-04 04:37:56 +07:00
e6f2ac2195 add production docker compose 2026-02-03 21:35:33 +07:00
35d0a9db6d fix 3
All checks were successful
Build, Push and Redeploy Docker Image / build-and-push (push) Successful in 7m16s
2026-02-03 21:06:11 +07:00
d484043db5 fix 2
Some checks failed
Build, Push and Redeploy Docker Image / build-and-push (push) Failing after 7m2s
2026-02-03 20:56:06 +07:00
18e2dcd592 fix 1
Some checks failed
Build, Push and Redeploy Docker Image / build-and-push (push) Failing after 6m34s
2026-02-03 20:45:55 +07:00
5a779f44a9 upgrade dockerfile
Some checks failed
Build, Push and Redeploy Docker Image / build-and-push (push) Failing after 3m45s
2026-02-03 20:40:21 +07:00
8782400d7e edit workflow file
Some checks failed
Build, Push and Redeploy Docker Image / build-and-push (push) Failing after 3m36s
2026-02-03 20:13:14 +07:00
d9126af9d7 edit action
Some checks failed
Build, Push and Redeploy Docker Image / build-and-push (push) Failing after 4m3s
2026-02-03 19:14:17 +07:00
f9a81c0752 edit workflows 2026-02-03 19:07:41 +07:00
6 changed files with 88 additions and 80 deletions

View File

@@ -3,7 +3,7 @@ name: Build, Push and Redeploy Docker Image
on:
push:
branches:
- main
- master
jobs:
build-and-push:
@@ -23,8 +23,15 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Container Registry
run: |
echo "${{ secrets.GIT_PASSWORD }}" | docker login "${{ env.REGISTRY_HOST }}" -u "${{ github.actor }}" --password-stdin
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY_HOST }}
username: ${{ gitea.actor }}
password: ${{ secrets.GIT_PASSWORD }}
# - name: Log in to Gitea Container Registry
# run: |
# echo "${{ secrets.GIT_PASSWORD }}" | docker login "${{ env.REGISTRY_HOST }}" -u "${{ github.actor }}" --password-stdin
- name: Get short SHA
id: vars
@@ -41,6 +48,6 @@ jobs:
--push \
.
# - name: Redeploy stack in Portainer
# run: |
# curl -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"
- name: Redeploy stack in Portainer
run: |
curl -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"

View File

@@ -16,15 +16,39 @@ RUN apt-get update && \
cmake \
&& rm -rf /var/lib/apt/lists/*
# Обновление pip и установка setuptools/wheel
WORKDIR /app
# Кэшируем установку зависимостей Python
COPY requirements.txt .
RUN pip install --upgrade pip && \
pip install setuptools wheel
pip install setuptools wheel && \
pip install --no-cache-dir -r requirements.txt
# Проверка версии Python и pip
RUN python --version && pip --version
# Сборка RKLLM runtime
RUN git clone --depth 1 https://git.byte-mate.ru/drholy/ezrknn-llm /tmp/rkllm-build && \
cp -r /tmp/rkllm-build/rkllm-runtime/runtime/Linux/librkllm_api/aarch64/* /usr/lib && \
cp -r /tmp/rkllm-build/rkllm-runtime/runtime/Linux/librkllm_api/include/* /usr/local/include && \
cd /tmp/rkllm-build/rkllm-runtime/examples/rkllm_api_demo && \
bash build-linux.sh && \
cp ./build/build_linux_aarch64_Release/llm_demo /usr/bin/rkllm && \
# Очистка временных файлов сборки
ldconfig && \
rm -rf /tmp/rkllm-build && \
apt-get purge -y git cmake build-essential libssl-dev && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN pip install --no-cache-dir -r requirements.txt
# Копируем приложение (исключая кэш и модели)
COPY app/ .
# Очистка кэша
RUN apt-get clean && \
rm -rf /tmp/* /var/tmp/*
# Исключаем модели из образа — монтируем как volume при запуске
RUN rm -rf /app/models/* 2>/dev/null || true && \
find /app -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true && \
chmod +x /app/entrypoint.sh
# Порт Gradio по умолчанию
EXPOSE 8080
WORKDIR /app
ENTRYPOINT ["/app/entrypoint.sh"]

View File

@@ -1,34 +1,18 @@
#!/bin/bash
message_print() {
echo
echo "#########################################"
echo $1
echo "#########################################"
echo
}
set -e # Автоматический выход при ошибке
cd /
echo
echo "#########################################"
echo "Starting RKLLM Gradio Server"
echo "#########################################"
echo
message_print "Changing to repository..."
git clone https://git.home/drholy/ezrknn-llm
cd ezrknn-llm/
cp ./rkllm-runtime/runtime/Linux/librkllm_api/aarch64/* /usr/lib
cp ./rkllm-runtime/runtime/Linux/librkllm_api/include/* /usr/local/include
# Проверка наличия моделей (монтируются через volume)
if [ ! -d "/app/models" ] || [ -z "$(ls -A /app/models 2>/dev/null)" ]; then
echo "⚠️ WARNING: Models directory is empty!"
echo " Mount models volume: -v ./models:/app/models"
sleep 5
fi
message_print "Compiling LLM runtime for Linux..."
cd ./rkllm-runtime/examples/rkllm_api_demo/
bash build-linux.sh
message_print "Moving rkllm to /usr/bin..."
cp ./build/build_linux_aarch64_Release/llm_demo /usr/bin/rkllm
echo "* soft nofile 16384" >> /etc/security/limits.conf
echo "* hard nofile 1048576" >> /etc/security/limits.conf
message_print "Increasing file limit for all users (needed for LLMs to run)..."
echo "root soft nofile 16384" >> /etc/security/limits.conf
echo "root hard nofile 1048576" >> /etc/security/limits.conf
message_print "Done installing ezrknn-llm!"
message_print "Start Gradio server"
cd /app
python rkllm_server_gradio.py
# Запуск сервера
exec python rkllm_server_gradio.py

View File

@@ -15,36 +15,9 @@ model_configs = {
"Qwen2.5-3B-Instruct-w8w8": {"filename": "Qwen2.5-3B-Instruct-w8w8.rkllm"}
}
},
"Qwen2.5-Coder-3B-Instruct-w8w8-For-clear-code": {
"Qwen3-4B-Instruct-2507-F16": {
"base_config": {
"st_model_id": "Qwen/Qwen2.5-14B-Instruct",
"max_context_len": 128000,
"max_new_tokens": 8192,
"top_k": 5,
"top_p": 0.8,
"temperature": 0.2,
"repeat_penalty": 1.00,
"frequency_penalty": 0.2,
"system_prompt": """
Ты — эксперт по программированию, и твоя задача — генерировать только рабочий код без каких-либо комментариев, объяснений или дополнительного текста. Вывод должен содержать исключительно код, который можно скопировать и использовать напрямую.
<описание задачи>
Пример:
Если требуется написать функцию на Python, которая суммирует два числа, то ответ должен быть таким:
```
def sum(a, b):
return a + b
```
"""
},
"models": {
"Qwen2.5-Coder-3B-Instruct-w8w8-For-clear-code": {"filename": "Qwen2.5-Coder-3B-Instruct-w8w8.rkllm"}
}
},
"Qwen2.5-Coder-3B-Instruct-w8w8": {
"base_config": {
"st_model_id": "Qwen/Qwen2.5-14B-Instruct",
"st_model_id": "unsloth/Qwen3-4B-Instruct-2507-GGUF",
"max_context_len": 128000,
"max_new_tokens": 8192,
"top_k": 5,
@@ -55,7 +28,7 @@ model_configs = {
"system_prompt": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant"
},
"models": {
"Qwen2.5-Coder-3B-Instruct-w8w8": {"filename": "Qwen2.5-Coder-3B-Instruct-w8w8.rkllm"}
"Qwen3-4B-Instruct-2507-F16": {"filename": "Qwen3-4B-Instruct-2507-F16.rkllm"}
}
}
# "LLaMA-Mesh": {

20
docker-compose-prod.yml Normal file
View File

@@ -0,0 +1,20 @@
services:
rkllm:
image: git.home/drholy/rkllm-gradio-server:latest
container_name: rkllm
restart: always
privileged: true
volumes:
- ./models:/app/models:ro
ulimits:
nofile:
soft: 16384
hard: 1048576
ports:
- "8080:8080"
networks:
- apps
networks:
apps:
name: apps
driver: bridge

View File

@@ -1,16 +1,16 @@
services:
rkllm:
build:
context: .
dockerfile: Dockerfile
build: .
platform: linux/arm64/v8
container_name: rkllm
restart: always
privileged: true
volumes:
- ./app:/app
- ./ezrknn-llm:/ezrknn-llm
entrypoint: ./app/entrypoint.sh
- ./models:/app/models:ro
ulimits:
nofile:
soft: 16384
hard: 1048576
ports:
- "8080:8080"
networks: