Skip to content

Commit 059a755

Browse files
committed
use npm as deps manager and vite as bundler
1 parent 116fc4e commit 059a755

File tree

18 files changed

+927
-27266
lines changed

18 files changed

+927
-27266
lines changed

.github/workflows/server.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,6 @@ jobs:
7676
run: |
7777
pip install -r examples/server/tests/requirements.txt
7878
79-
- name: Verify server deps
80-
id: verify_server_deps
81-
run: |
82-
git config --global --add safe.directory $(realpath .)
83-
cd examples/server
84-
git ls-files --others --modified
85-
git status
86-
./deps.sh
87-
git status
88-
not_ignored_files="$(git ls-files --others --modified)"
89-
echo "Modified files: ${not_ignored_files}"
90-
if [ -n "${not_ignored_files}" ]; then
91-
echo "Repository is dirty or server deps are not built as expected"
92-
echo "${not_ignored_files}"
93-
exit 1
94-
fi
95-
9679
- name: Build (no OpenMP)
9780
id: cmake_build_no_openmp
9881
if: ${{ matrix.sanitizer == 'THREAD' }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ examples/server/*.mjs.hpp
104104
!examples/sycl/*.bat
105105
!examples/sycl/*.sh
106106

107+
# Server Web UI temporary files
108+
node_modules
109+
examples/server/webui/dist
110+
examples/server/webui/package-lock.json
111+
107112
# Python
108113

109114
/.venv

examples/server/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,37 @@ services:
223223
cmake --build build --config Release -t llama-server
224224
```
225225

226+
## Web UI
227+
228+
The project includes a web-based user interface that enables interaction with the model through the `/chat/completions` endpoint.
229+
230+
The web UI is developed using:
231+
- `vue` framework for frontend development
232+
- `tailwindcss` and `daisyui` for styling
233+
- `vite` for build tooling
234+
235+
A pre-built version is available as a single HTML file under `/public` directory.
236+
237+
To build or to run the dev server (with hot reload):
238+
239+
```sh
240+
# make sure you have nodejs installed
241+
cd examples/server/webui
242+
npm i
243+
244+
# to run the dev server
245+
npm run dev
246+
247+
# to build the public/index.html
248+
npm run build
249+
```
250+
251+
NOTE: if you are using the vite dev server, you can change the API base URL to llama.cpp. To do that, run this code snippet in browser's console:
252+
253+
```js
254+
localStorage.setItem('base', 'http://localhost:8080')
255+
```
256+
226257
## Quick Start
227258

228259
To get started right away, run the following command, making sure to use the correct path for the model you have:

examples/server/deps.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

examples/server/public/deps_daisyui.min.css

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)