Coverage for src/local_deep_research/settings/env_definitions/server.py: 100%
2 statements
« prev ^ index » next coverage.py v7.16.0, created at 2026-09-06 15:42 +0000
« prev ^ index » next coverage.py v7.16.0, created at 2026-09-06 15:42 +0000
1"""
2Server runtime environment settings.
4These settings control server-level parameters that require a restart
5to take effect. They are not editable via the UI.
6"""
8from ..env_settings import BooleanSetting, IntegerSetting
10SERVER_SETTINGS = [
11 IntegerSetting(
12 key="server.max_concurrent_research",
13 description="Server-wide maximum concurrent research operations. Requires restart.",
14 min_value=1,
15 max_value=1000,
16 default=10,
17 deprecated_env_var="LDR_MAX_GLOBAL_CONCURRENT",
18 ),
19 IntegerSetting(
20 key="web.threadpool_max_threads",
21 description=(
22 "Maximum AnyIO worker threads serving synchronous route "
23 "handlers. Leave unset to use AnyIO's default of 40. Every "
24 "plain `def` route occupies one worker for its whole duration, "
25 "and the pool is shared with async dependency solving and "
26 "response validation, so exhausting it slows async routes too. "
27 "Raise it if concurrent requests queue behind each other under "
28 "load; each extra thread costs context switching and contends "
29 "for the same per-user database pool. Requires restart."
30 ),
31 min_value=1,
32 max_value=1000,
33 default=None,
34 ),
35 BooleanSetting(
36 key="vite.dev_mode",
37 description=(
38 "When true, templates link to the Vite dev server at "
39 "http://localhost:5173 for HMR instead of the built manifest "
40 "under static/dist. Set to true when running `npm run dev` "
41 "alongside the Python server."
42 ),
43 default=False,
44 ),
45]