Skip to content

Commit 76395c0

Browse files
committed
docs(docker): document model settings in the default container
1 parent 98c25a5 commit 76395c0

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,20 @@ A Docker image is available on [GHCR](https://ghcr.io/abetlen/llama-cpp-python).
738738
docker run --rm -it -p 8000:8000 -v /path/to/models:/models -e MODEL=/models/llama-model.gguf ghcr.io/abetlen/llama-cpp-python:latest
739739
```
740740

741+
The default container command starts Uvicorn, so pass model settings as environment variables such as `N_CTX` and `USE_MLOCK`.
742+
Uvicorn accepts its own command-line options and rejects model flags such as `--n_ctx`.
743+
744+
```bash
745+
docker run --rm -it -p 127.0.0.1:8000:8000 \
746+
-v /path/to/models:/models:ro \
747+
-e MODEL=/models/llama-model.gguf \
748+
-e N_CTX=4096 \
749+
-e USE_MLOCK=false \
750+
ghcr.io/abetlen/llama-cpp-python:latest
751+
```
752+
753+
See the [server settings reference](https://llama-cpp-python.readthedocs.io/en/latest/server/#server-options-reference) for more options.
754+
741755
[Docker on termux (requires root)](https://gist.github.com/FreddieOliveira/efe850df7ff3951cb62d74bd770dce27) is currently the only known way to run this on phones, see [termux support issue](https://github.com/abetlen/llama-cpp-python/issues/389)
742756

743757
## Low-level API

0 commit comments

Comments
 (0)