File tree Expand file tree Collapse file tree 2 files changed +39
-3
lines changed
examples/rkllm_server_demo Expand file tree Collapse file tree 2 files changed +39
-3
lines changed Original file line number Diff line number Diff line change 1
1
FROM python:3.12-slim AS base
2
2
3
+ RUN apt-get update \
4
+ && apt-get install -y --no-install-recommends libgomp1 \
5
+ && rm -rf /var/lib/apt/lists/*
6
+
3
7
WORKDIR /app
4
8
5
9
COPY examples/rkllm_server_demo/rkllm_server /app
6
- COPY runtime/Linux/librkllm_api/aarch64/librkllmrt.so /app/lib
10
+ COPY rkllm- runtime/Linux/librkllm_api/aarch64/librkllmrt.so /app/lib
7
11
8
12
ENV PIP_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple
9
13
EXPOSE 8080
Original file line number Diff line number Diff line change
1
+ # Usage:
2
+ # 1. Download your `your-model.rkllm` model to the `./models/` directory
3
+ # 2. Start the chat-api with:
4
+ # RKLLM_MODEL_FILE="your-model.rkllm" docker compose run --rm -it chat-api
5
+
1
6
services :
2
7
rkllm-server :
3
8
build :
@@ -14,10 +19,37 @@ services:
14
19
ports :
15
20
- ${RKLLM_SERVER_PORT:-8080}:8080
16
21
volumes :
17
- - ./models:/app/models:ro # *.rkllm models
18
- - /sys:/sys:rw # for fix_freq_*.sh scripts
22
+ - ./models:/app/models:ro # *.rkllm models
23
+ - /sys:/sys:rw # for fix_freq_*.sh scripts
19
24
devices :
20
25
- /dev/dri:/dev/dri
21
26
security_opt :
22
27
- systempaths=unconfined
23
28
restart : " no"
29
+
30
+ chat-api :
31
+ build :
32
+ dockerfile_inline : |
33
+ FROM python:3.12-slim
34
+
35
+ RUN [ "${RKLLM_SERVER_INTERFACE:-gradio}" = "gradio" ] \
36
+ && pip install "gradio>=4.24.0"
37
+ volumes :
38
+ - ./:/usr/local/src/app/:ro
39
+ working_dir : /app
40
+ command :
41
+ - " bash"
42
+ - " -c"
43
+ - >-
44
+ >/app/chat_api.py sed "s,172.x.x.x:8080,server:8080,g"
45
+ "/usr/local/src/app/chat_api_${RKLLM_SERVER_INTERFACE:-gradio}.py"
46
+ && python3 -m chat_api
47
+ links :
48
+ - " rkllm-server:server"
49
+ ports :
50
+ - ${RKLLM_CLIENT_PORT:-8888}:8080
51
+ depends_on :
52
+ - rkllm-server # Ensure the server starts first
53
+ stdin_open : true # Keep STDIN open for interactive use
54
+ tty : true # Allocate a TTY for the client
55
+
You can’t perform that action at this time.
0 commit comments