10000 server : revamp chat UI with vuejs and daisyui by ngxson · Pull Request #10175 · ggml-org/llama.cpp · GitHub
[go: up one dir, main page]

Skip to content

server : revamp chat UI with vuejs and daisyui #10175

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

Merged
merged 24 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
10000
Diff view
Prev Previous commit
Next Next commit
docs: how to use legacy ui
  • Loading branch information
ngxson committed Nov 5, 2024
commit 9096e5ed5e349fbcd9d9dc42ae0397c4c7f9b4be
10 changes: 10 additions & 0 deletions examples/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,16 @@ Apart from error types supported by OAI, we also have custom types that are spec
}
```

### Legacy completion web UI

A new chat-based UI has replaced the old completion-based since [this PR](https://github.com/ggerganov/llama.cpp/pull/10175). If you want to use the old completion, start the server with `--path ./examples/server/public_legacy`

For example:

```sh
./llama-server -m my_model.gguf -c 8192 --path ./examples/server/public_legacy
```

### Extending or building alternative Web Front End

You can extend the front end by running the server binary with `--path` set to `./your-directory` and importing `/completion.js` to get access to the llamaComplete() method.
Expand Down
3 changes: 2 additions & 1 deletion examples/server/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
.btn-mini {
@apply cursor-pointer opacity-0 group-hover:opacity-100 hover:shadow-md;
}
.chat-screen { max-width: 900px; }
</style>
</head>

Expand Down Expand Up @@ -52,7 +53,7 @@ <h2 class="font-bold mb-4 ml-4">Conversations</h2>
</div>
</div>

<div class="flex flex-col w-screen h-screen max-w-screen-md px-8 mx-auto">
<div class="chat-screen flex flex-col w-screen h-screen px-8 mx-auto">
<!-- header -->
<div class="flex flex-row items-center">
<div class="grow text-2xl font-bold mt-8 mb-6">
Expand Down
13 changes: 5 additions & 8 deletions examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3112,14 +3112,11 @@ int main(int argc, char ** argv) {
// register static assets routes
if (!params.public_path.empty()) {
// Set the base directory for serving static files
svr->set_base_dir(params.public_path);
}

if (!params.api_keys.empty()) {
// for now, if API key is set, web UI is unusable
svr->Get("/", [&](const httplib::Request &, httplib::Response & res) {
return res.set_content("Web UI is disabled because API key is set.", "text/html; charset=utf-8");
});
bool is_found = svr->set_mount_point("/", params.public_path);
if (!is_found) {
LOG_ERR("%s: static assets path not found: %s\n", __func__, params.public_path.c_str());
return 1;
}
} else {
// using embedded static files
svr->Get("/", handle_static_file(index_html, index_html_len, "text/html; charset=utf-8"));
Expand Down
Loading
0