]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
server : add support for `embd_normalize` parameter (#14964)
authorDaniel Bevenius <redacted>
Wed, 30 Jul 2025 16:07:11 +0000 (18:07 +0200)
committerGitHub <redacted>
Wed, 30 Jul 2025 16:07:11 +0000 (18:07 +0200)
commit41e78c567e9a8c652e405f4f909deb598deecd31
treec33959e7e10800ba894fee2243c66e5a9ab05977
parentad4a700117d1746799d2d6599e526e2c3a7938d2
server : add support for `embd_normalize` parameter (#14964)

This commit adds support for the `embd_normalize` parameter in the
server code.

The motivation for this is that currently if the server is started with
a pooling type that is not `none`, then Euclidean/L2 normalization will
be the normalization method used for embeddings. However, this is not
always the desired behavior, and users may want to use other
normalization (or none) and this commit allows that.

Example usage:
```console
curl --request POST \
    --url http://localhost:8080/embedding \
    --header "Content-Type: application/json" \
    --data '{"input": "Hello world today", "embd_normalize": -1}
```
tools/server/README.md
tools/server/server.cpp