mirror of
https://github.com/docling-project/docling-serve.git
synced 2025-11-29 16:43:24 +00:00
45 lines
2.8 KiB
Markdown
45 lines
2.8 KiB
Markdown
# Configuration
|
|
|
|
The `docling-serve` executable allows to configure the server via command line
|
|
options as well as environment variables.
|
|
Configurations are divided between the settings used for the `uvicorn` asgi
|
|
server and the actual app-specific configurations.
|
|
|
|
> [!WARNING]
|
|
> When the server is running with `reload` or with multiple `workers`, uvicorn
|
|
> will spawn multiple subprocessed. This invalides all the values configured
|
|
> via the CLI command line options. Please use environment variables in this
|
|
> type of deployments.
|
|
|
|
## Webserver configuration
|
|
|
|
The following table shows the options which are propagated directly to the
|
|
`uvicorn` webserver runtime.
|
|
|
|
| CLI option | ENV | Default | Description |
|
|
| -----------|-----|---------|-------------|
|
|
| `--host` | `UVICORN_HOST` | `0.0.0.0` for `run`, `localhost` for `dev` | THe host to serve on. |
|
|
| `--port` | `UVICORN_PORT` | `5001` | The port to serve on. |
|
|
| `--reload` | `UVICORN_RELOAD` | `false` for `run`, `true` for `dev` | Enable auto-reload of the server when (code) files change. |
|
|
| `--workers` | `UVICORN_WORKERS` | `1` | Use multiple worker processes. |
|
|
| `--root-path` | `UVICORN_ROOT_PATH` | `""` | The root path is used to tell your app that it is being served to the outside world with some |
|
|
| `--proxy-headers` | `UVICORN_PROXY_HEADERS` | `true` | Enable/Disable X-Forwarded-Proto, X-Forwarded-For, X-Forwarded-Port to populate remote address info. |
|
|
| `--timeout-keep-alive` | `UVICORN_TIMEOUT_KEEP_ALIVE` | `60` | Timeout for the server response. |
|
|
| `--ssl-certfile` | `UVICORN_SSL_CERTFILE` | | SSL certificate file. |
|
|
| `--ssl-keyfile` | `UVICORN_SSL_KEYFILE` | | SSL key file. |
|
|
| `--ssl-keyfile-password` | `UVICORN_SSL_KEYFILE_PASSWORD` | | SSL keyfile password. |
|
|
|
|
## Docling Serve configuration
|
|
|
|
THe following table describes the options to configure the Docling Serve app.
|
|
|
|
| CLI option | ENV | Default | Description |
|
|
| -----------|-----|---------|-------------|
|
|
| `--artifacts-path` | `DOCLING_SERVE_ARTIFACTS_PATH` | unset | If set to a valid directory, the model weights will be loaded from this path |
|
|
| | `DOCLING_SERVE_STATIC_PATH` | unset | If set to a valid directory, the static assets for the docs and ui will be loaded from this path |
|
|
| `--enable-ui` | `DOCLING_SERVE_ENABLE_UI` | `false` | Enable the demonstrator UI. |
|
|
| | `DOCLING_SERVE_OPTIONS_CACHE_SIZE` | `2` | How many DocumentConveter objects (including their loaded models) to keep in the cache. |
|
|
| | `DOCLING_SERVE_CORS_ORIGINS` | `["*"]` | A list of origins that should be permitted to make cross-origin requests. |
|
|
| | `DOCLING_SERVE_CORS_METHODS` | `["*"]` | A list of HTTP methods that should be allowed for cross-origin requests. |
|
|
| | `DOCLING_SERVE_CORS_HEADERS` | `["*"]` | A list of HTTP request headers that should be supported for cross-origin requests. |
|